From 709046db2add77f18549d317ad5fad7340d707b6 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 26 Feb 2019 20:59:33 +0100 Subject: [PATCH] Add binary battery low sensor for HS1SA and HS3SA. https://github.com/Koenkk/zigbee2mqtt/issues/1159 --- lib/extension/homeassistant.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/extension/homeassistant.js b/lib/extension/homeassistant.js index 39eb3bb1..37df1c28 100644 --- a/lib/extension/homeassistant.js +++ b/lib/extension/homeassistant.js @@ -76,6 +76,16 @@ const configurations = { device_class: 'connectivity', }, }, + 'binary_sensor_battery_low': { + type: 'binary_sensor', + object_id: 'battery_low', + discovery_payload: { + payload_on: true, + payload_off: false, + value_template: '{{ value_json.battery_low}}', + device_class: 'battery', + }, + }, // Sensor 'sensor_illuminance': { @@ -452,12 +462,12 @@ const mapping = { '900008-WW': [configurations.light_brightness], 'Mega23M12': [configurations.light_brightness_colortemp_colorxy], 'PSS-23ZBS': [configurations.switch], - 'HS1SA': [configurations.binary_sensor_smoke], + 'HS1SA': [configurations.binary_sensor_smoke, configurations.binary_sensor_battery_low], 'Z01-A19NAE26': [configurations.light_brightness_colortemp], 'AC01353010G': [configurations.binary_sensor_occupancy, configurations.sensor_temperature], 'SP 120': [configurations.switch, configurations.sensor_power], 'RB 248 T': [configurations.light_brightness_colortemp], - 'HS3SA': [configurations.binary_sensor_smoke], + 'HS3SA': [configurations.binary_sensor_smoke, configurations.binary_sensor_battery_low], 'HS1DS': [configurations.binary_sensor_contact], 'HS1WL': [configurations.binary_sensor_water_leak], '421786': [configurations.light_brightness],