Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding 'very high' and 'max' to level sensitivity of hue motion sensors #4762

Merged
merged 6 commits into from
Oct 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -7039,7 +7039,7 @@ const converters = {
type: ['attributeReport', 'readResponse'],
convert: (model, msg, publish, options, meta) => {
if (msg.data.hasOwnProperty('48')) {
const lookup = ['low', 'medium', 'high'];
const lookup = ['low', 'medium', 'high', 'very_high', 'max'];
return {motion_sensitivity: lookup[msg.data['48']]};
}
},
Expand Down
4 changes: 1 addition & 3 deletions converters/toZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -2106,10 +2106,8 @@ const converters = {
// motion detect sensitivity, philips specific
key: ['motion_sensitivity'],
convertSet: async (entity, key, value, meta) => {
// hue_sml:
// 0: low, 1: medium, 2: high (default)
// make sure you write to second endpoint!
const lookup = {'low': 0, 'medium': 1, 'high': 2};
const lookup = {'low': 0, 'medium': 1, 'high': 2, 'very_high': 3, 'max': 4};
value = value.toLowerCase();
utils.validateValue(value, Object.keys(lookup));

Expand Down
4 changes: 2 additions & 2 deletions devices/philips.js
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,7 @@ module.exports = [
fromZigbee: [fz.battery, fz.occupancy, fz.temperature, fz.occupancy_timeout, fz.illuminance,
fz.hue_motion_sensitivity, fz.hue_motion_led_indication],
exposes: [e.temperature(), e.occupancy(), e.battery(), e.illuminance_lux(), e.illuminance(),
exposes.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high']),
exposes.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high', 'very_high', 'max']),
exposes.binary('led_indication', ea.ALL, true, false).withDescription('Blink green LED on motion detection'),
exposes.numeric('occupancy_timeout', ea.ALL).withUnit('second').withValueMin(0).withValueMax(65535)],
toZigbee: [tz.occupancy_timeout, tz.hue_motion_sensitivity, tz.hue_motion_led_indication],
Expand Down Expand Up @@ -2021,7 +2021,7 @@ module.exports = [
fromZigbee: [fz.battery, fz.occupancy, fz.temperature, fz.illuminance, fz.occupancy_timeout,
fz.hue_motion_sensitivity, fz.hue_motion_led_indication],
exposes: [e.temperature(), e.occupancy(), e.battery(), e.illuminance_lux(), e.illuminance(),
exposes.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high']),
exposes.enum('motion_sensitivity', ea.ALL, ['low', 'medium', 'high', 'very_high', 'max']),
exposes.binary('led_indication', ea.ALL, true, false).withDescription('Blink green LED on motion detection'),
exposes.numeric('occupancy_timeout', ea.ALL).withUnit('second').withValueMin(0).withValueMax(65535)],
toZigbee: [tz.occupancy_timeout, tz.hue_motion_sensitivity, tz.hue_motion_led_indication],
Expand Down