Skip to content

Commit

Permalink
Support very_high and max motion_sensitivity for Philips 929003…
Browse files Browse the repository at this point in the history
…0675 and 9290030674 (#4762)

* Update philips.js

* Update fromZigbee.js

* Update toZigbee.js

* Update fromZigbee.js

* Update toZigbee.js

* Update philips.js

Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
  • Loading branch information
MattL0 and Koenkk committed Oct 10, 2022
1 parent 46fa107 commit ee2637a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
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

0 comments on commit ee2637a

Please sign in to comment.