Skip to content

Commit

Permalink
Support battery_low and power_type for Neo NAS-AB02B0. Koenkk/zigbee2…
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Feb 24, 2021
1 parent b48153f commit bb9ede9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -1856,8 +1856,11 @@ const converters = {
return {humidity_min: value};
case tuya.dataPoints.neoMaxHumidity: // 0x026E [0,0,0,80] max alarm humidity
return {humidity_max: value};
case tuya.dataPoints.neoUnknown1: // 0x0465 [4]
break;
case tuya.dataPoints.neoPowerType: // 0x0465 [4]
return {
power_type: {0: 'battery_full', 1: 'battery_high', 2: 'battery_medium', 3: 'battery_low', 4: 'usb'}[value],
battery_low: value === 3,
};
case tuya.dataPoints.neoMelody: // 0x0466 [5] Melody
return {melody: value};
case tuya.dataPoints.neoUnknown3: // 0x0473 [0]
Expand Down
3 changes: 2 additions & 1 deletion devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -2108,7 +2108,7 @@ const devices = [
fromZigbee: [fz.neo_t_h_alarm, fz.ignore_basic_report],
toZigbee: [tz.neo_t_h_alarm],
exposes: [
e.temperature(), e.humidity(), exposes.binary('humidity_alarm', ea.STATE_SET, true, false),
e.temperature(), e.humidity(), exposes.binary('humidity_alarm', ea.STATE_SET, true, false), e.battery_low(),
exposes.binary('temperature_alarm', ea.STATE_SET, true, false),
exposes.binary('alarm', ea.STATE_SET, true, false),
exposes.enum('melody', ea.STATE_SET, Array.from(Array(18).keys()).map((x)=>(x+1).toString())),
Expand All @@ -2118,6 +2118,7 @@ const devices = [
exposes.numeric('humidity_min', ea.STATE_SET).withUnit('%'),
exposes.numeric('humidity_max', ea.STATE_SET).withUnit('%'),
exposes.enum('volume', ea.STATE_SET, ['low', 'medium', 'high']),
exposes.enum('power_type', ea.STATE, ['battery_full', 'battery_high', 'battery_medium', 'battery_low', 'usb']),
],
},

Expand Down
2 changes: 1 addition & 1 deletion lib/tuya.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const dataPoints = {
moesSchedule: 101,
etopErrorStatus: 13,
// Neo T&H
neoUnknown1: 101,
neoPowerType: 101,
neoMelody: 102,
neoDuration: 103,
neoAlarm: 104,
Expand Down

0 comments on commit bb9ede9

Please sign in to comment.