itavero / homebridge-z2m

Expose your Zigbee devices to HomeKit with ease, by integrating 🐝 Zigbee2MQTT with 🏠 Homebridge.
https://z2m.dev
Apache License 2.0
311 stars 49 forks source link

[Bug] StatusLowBattery for several devices is not available in HOME+ app (version 5.3.3) #421

Closed JayJay-Master closed 2 years ago

JayJay-Master commented 2 years ago

Please use the template and fill in all the data requested below!

Describe the bug A clear and concise description of what the bug is. For following devices StatusLowBattery is not available in HOME+ app (version 5.3.3):

For comparison, StatusLowBattery is available in Home+ app on this device:

Related devices Are you experiencing this behavior with a particular device? Please list which device(s) you experience this with.

To Reproduce Steps to reproduce the behavior, for example:

  1. Change '...' via the Home app.
  2. Log shows MQTT message '...' being published to topic '...'
  3. The device does the following: '...' I want to create an automation that sends a notification when a device's battery status is low. With the Aqara WaterLeakSensor I can select this in the Home+ app, with the other devices mentioned there is no option. There you can only query the sensor value.

Expected behavior A clear and concise description of what you expected to happen, compared to what actually happened. Possibility to select the StatusLowBattery in the Home+ app for use in automations. If no direct battery_low state is available, it would be great to get the battery state in %.

MQTT messages If possible (and applicable), please provide the following:

1. Xiaomi GZCGQ01LM (MiJia light intensity sensor) device entry from zigbee2mqtt/bridge/devices: { "date_code": "20200312", "definition": { "description": "MiJia light intensity sensor", "exposes": [ { "access": 1, "description": "Remaining battery in %", "name": "battery", "property": "battery", "type": "numeric", "unit": "%", "value_max": 100, "value_min": 0 }, { "access": 1, "description": "Voltage of the battery in millivolts", "name": "voltage", "property": "voltage", "type": "numeric", "unit": "mV" }, { "access": 1, "description": "Raw measured illuminance", "name": "illuminance", "property": "illuminance", "type": "numeric" }, { "access": 1, "description": "Measured illuminance in lux", "name": "illuminance_lux", "property": "illuminance_lux", "type": "numeric", "unit": "lx" }, { "access": 1, "description": "Link quality (signal strength)", "name": "linkquality", "property": "linkquality", "type": "numeric", "unit": "lqi", "value_max": 255, "value_min": 0 } ], "model": "GZCGQ01LM", "options": [ { "access": 2, "description": "Number of digits after decimal point for illuminance, takes into effect on next report of device.", "name": "illuminance_precision", "property": "illuminance_precision", "type": "numeric", "value_max": 3, "value_min": 0 }, { "access": 2, "description": "Calibrates the illuminance value (percentual offset), takes into effect on next report of device.", "name": "illuminance_calibration", "property": "illuminance_calibration", "type": "numeric" }, { "access": 2, "description": "Number of digits after decimal point for illuminance_lux, takes into effect on next report of device.", "name": "illuminance_lux_precision", "property": "illuminance_lux_precision", "type": "numeric", "value_max": 3, "value_min": 0 }, { "access": 2, "description": "Calibrates the illuminance_lux value (percentual offset), takes into effect on next report of device.", "name": "illuminance_lux_calibration", "property": "illuminance_lux_calibration", "type": "numeric" } ], "supports_ota": false, "vendor": "Xiaomi" }, "endpoints": { "1": { "bindings": [ { "cluster": "genPowerCfg", "target": { "endpoint": 1, "ieee_address": "0x00212effff0781ef", "type": "endpoint" } }, { "cluster": "msIlluminanceMeasurement", "target": { "endpoint": 1, "ieee_address": "0x00212effff0781ef", "type": "endpoint" } } ], "clusters": { "input": [ "genBasic", "msIlluminanceMeasurement", "genIdentify", "genPowerCfg" ], "output": [ "genIdentify" ] }, "configured_reportings": [ { "attribute": "batteryVoltage", "cluster": "genPowerCfg", "maximum_report_interval": 62000, "minimum_report_interval": 3600, "reportable_change": 0 }, { "attribute": "measuredValue", "cluster": "msIlluminanceMeasurement", "maximum_report_interval": 3600, "minimum_report_interval": 15, "reportable_change": 500 } ], "scenes": [] } }, "friendly_name": "Lichtsensor_WZ", "ieee_address": "0x54ef4410001a3d59", "interview_completed": true, "interviewing": false, "manufacturer": "XIAOMI", "model_id": "lumi.sen_ill.mgl01", "network_address": 6994, "power_source": "Battery", "software_build_id": "2019\u0000www.", "supported": true, "type": "EndDevice" }, Status update from `zigbee2mqtt/[FRIENDLY_NAME]: {"battery":100,"device":{"applicationVersion":27,"dateCode":"20200312","friendlyName":"Lichtsensor_WZ","hardwareVersion":1,"ieeeAddr":"0x54ef4410001a3d59","manufacturerID":4718,"manufacturerName":"XIAOMI","model":"GZCGQ01LM","networkAddress":6994,"powerSource":"Battery","softwareBuildID":"2019\u0000www.","stackVersion":2,"type":"EndDevice","zclVersion":3},"illuminance":20828,"illuminance_lux":121,"linkquality":255,"voltage":3100}

2. Xiaomi WSDCGQ11LM (Aqara temperature, humidity and pressure sensor) device entry from zigbee2mqtt/bridge/devices { "date_code": "20191205", "definition": { "description": "Aqara temperature, humidity and pressure sensor", "exposes": [ { "access": 1, "description": "Remaining battery in %", "name": "battery", "property": "battery", "type": "numeric", "unit": "%", "value_max": 100, "value_min": 0 }, { "access": 1, "description": "Measured temperature value", "name": "temperature", "property": "temperature", "type": "numeric", "unit": "°C" }, { "access": 1, "description": "Measured relative humidity", "name": "humidity", "property": "humidity", "type": "numeric", "unit": "%" }, { "access": 1, "description": "The measured atmospheric pressure", "name": "pressure", "property": "pressure", "type": "numeric", "unit": "hPa" }, { "access": 1, "description": "Voltage of the battery in millivolts", "name": "voltage", "property": "voltage", "type": "numeric", "unit": "mV" }, { "access": 1, "description": "Link quality (signal strength)", "name": "linkquality", "property": "linkquality", "type": "numeric", "unit": "lqi", "value_max": 255, "value_min": 0 } ], "model": "WSDCGQ11LM", "options": [ { "access": 2, "description": "Number of digits after decimal point for temperature, takes into effect on next report of device.", "name": "temperature_precision", "property": "temperature_precision", "type": "numeric", "value_max": 3, "value_min": 0 }, { "access": 2, "description": "Calibrates the temperature value (absolute offset), takes into effect on next report of device.", "name": "temperature_calibration", "property": "temperature_calibration", "type": "numeric" }, { "access": 2, "description": "Number of digits after decimal point for humidity, takes into effect on next report of device.", "name": "humidity_precision", "property": "humidity_precision", "type": "numeric", "value_max": 3, "value_min": 0 }, { "access": 2, "description": "Calibrates the humidity value (absolute offset), takes into effect on next report of device.", "name": "humidity_calibration", "property": "humidity_calibration", "type": "numeric" }, { "access": 2, "description": "Number of digits after decimal point for pressure, takes into effect on next report of device.", "name": "pressure_precision", "property": "pressure_precision", "type": "numeric", "value_max": 3, "value_min": 0 }, { "access": 2, "description": "Calibrates the pressure value (absolute offset), takes into effect on next report of device.", "name": "pressure_calibration", "property": "pressure_calibration", "type": "numeric" } ], "supports_ota": false, "vendor": "Xiaomi" }, "endpoints": { "1": { "bindings": [], "clusters": { "input": [ "genBasic", "genIdentify", "65535", "msTemperatureMeasurement", "msPressureMeasurement", "msRelativeHumidity" ], "output": [ "genBasic", "genGroups", "65535" ] }, "configured_reportings": [], "scenes": [] } }, "friendly_name": "Temperatursensor_SZ", "ieee_address": "0x00158d0007befa97", "interview_completed": true, "interviewing": false, "manufacturer": "LUMI", "model_id": "lumi.weather", "network_address": 58101, "power_source": "Battery", "software_build_id": "3000-0001", "supported": true, "type": "EndDevice" }, Status update from `zigbee2mqtt/[FRIENDLY_NAME]: {"battery":99,"device":{"applicationVersion":5,"dateCode":"20191205","friendlyName":"Temperatursensor_SZ","ieeeAddr":"0x00158d0007befa97","manufacturerID":4151,"manufacturerName":"LUMI","model":"WSDCGQ11LM","networkAddress":19978,"powerSource":"Battery","softwareBuildID":"3000-0001","type":"EndDevice","zclVersion":1},"humidity":35.86,"linkquality":255,"pressure":1011.5,"temperature":19.7,"voltage":2985}

3. Xiaomi MCCGQ11LM (Aqara door & window contact sensor) device entry from zigbee2mqtt/bridge/devices { "date_code": "20161128", "definition": { "description": "Aqara door & window contact sensor", "exposes": [ { "access": 1, "description": "Remaining battery in %", "name": "battery", "property": "battery", "type": "numeric", "unit": "%", "value_max": 100, "value_min": 0 }, { "access": 1, "description": "Indicates if the contact is closed (= true) or open (= false)", "name": "contact", "property": "contact", "type": "binary", "value_off": true, "value_on": false }, { "access": 1, "description": "Measured temperature value", "name": "temperature", "property": "temperature", "type": "numeric", "unit": "°C" }, { "access": 1, "description": "Voltage of the battery in millivolts", "name": "voltage", "property": "voltage", "type": "numeric", "unit": "mV" }, { "access": 1, "description": "Link quality (signal strength)", "name": "linkquality", "property": "linkquality", "type": "numeric", "unit": "lqi", "value_max": 255, "value_min": 0 } ], "model": "MCCGQ11LM", "options": [ { "access": 2, "description": "Number of digits after decimal point for temperature, takes into effect on next report of device.", "name": "temperature_precision", "property": "temperature_precision", "type": "numeric", "value_max": 3, "value_min": 0 }, { "access": 2, "description": "Calibrates the temperature value (absolute offset), takes into effect on next report of device.", "name": "temperature_calibration", "property": "temperature_calibration", "type": "numeric" } ], "supports_ota": false, "vendor": "Xiaomi" }, "endpoints": { "1": { "bindings": [], "clusters": { "input": [ "genBasic", "genIdentify", "65535", "genOnOff" ], "output": [ "genBasic", "genGroups", "65535" ] }, "configured_reportings": [], "scenes": [] } }, "friendly_name": "Wohnungstuer", "ieee_address": "0x00158d0007006211", "interview_completed": true, "interviewing": false, "manufacturer": "LUMI", "model_id": "lumi.sensor_magnet.aq2", "network_address": 30144, "power_source": "Battery", "software_build_id": "3000-0001", "supported": true, "type": "EndDevice" }, Status update from `zigbee2mqtt/[FRIENDLY_NAME]: {"battery":99,"contact":true,"device":{"applicationVersion":3,"dateCode":"20161128","friendlyName":"Wohnungstuer","hardwareVersion":2,"ieeeAddr":"0x00158d0007006211","manufacturerID":4151,"manufacturerName":"LUMI","model":"MCCGQ11LM","networkAddress":30144,"powerSource":"Battery","softwareBuildID":"3000-0001","stackVersion":2,"type":"EndDevice","zclVersion":1},"linkquality":255,"temperature":20,"voltage":2975}

4. IKEA E1525/E1745 (TRADFRI motion sensor) device entry from zigbee2mqtt/bridge/devices { "date_code": "20190308", "definition": { "description": "TRADFRI motion sensor", "exposes": [ { "access": 1, "description": "Remaining battery in %", "name": "battery", "property": "battery", "type": "numeric", "unit": "%", "value_max": 100, "value_min": 0 }, { "access": 1, "description": "Indicates whether the device detected occupancy", "name": "occupancy", "property": "occupancy", "type": "binary", "value_off": false, "value_on": true }, { "access": 1, "name": "requested_brightness_level", "property": "requested_brightness_level", "type": "numeric", "value_max": 254, "value_min": 76 }, { "access": 1, "name": "requested_brightness_percent", "property": "requested_brightness_percent", "type": "numeric", "value_max": 100, "value_min": 30 }, { "access": 1, "description": "Indicates whether the device detected bright light (works only in night mode)", "name": "illuminance_above_threshold", "property": "illuminance_above_threshold", "type": "binary", "value_off": false, "value_on": true }, { "access": 1, "description": "Link quality (signal strength)", "name": "linkquality", "property": "linkquality", "type": "numeric", "unit": "lqi", "value_max": 255, "value_min": 0 } ], "model": "E1525/E1745", "options": [ { "access": 2, "description": "Time in seconds after which occupancy is cleared after detecting it (default 90 seconds).", "name": "occupancy_timeout", "property": "occupancy_timeout", "type": "numeric", "value_min": 0 }, { "access": 2, "description": "Set to false to also send messages when illuminance is above threshold in night mode (default true).", "name": "illuminance_below_threshold_check", "property": "illuminance_below_threshold_check", "type": "binary", "value_off": false, "value_on": true } ], "supports_ota": true, "vendor": "IKEA" }, "endpoints": { "1": { "bindings": [ { "cluster": "genPollCtrl", "target": { "endpoint": 1, "ieee_address": "0x00212effff0781ef", "type": "endpoint" } }, { "cluster": "genPowerCfg", "target": { "endpoint": 1, "ieee_address": "0x00212effff0781ef", "type": "endpoint" } } ], "clusters": { "input": [ "genBasic", "genPowerCfg", "genIdentify", "genAlarms", "genPollCtrl", "touchlink", "64636" ], "output": [ "genIdentify", "genGroups", "genOnOff", "genLevelCtrl", "genOta", "touchlink" ] }, "configured_reportings": [ { "attribute": "batteryPercentageRemaining", "cluster": "genPowerCfg", "maximum_report_interval": 62000, "minimum_report_interval": 3600, "reportable_change": 0 } ], "scenes": [] } }, "friendly_name": "Bewegungsmelder Wandschrank", "ieee_address": "0x50325ffffe260ad3", "interview_completed": true, "interviewing": false, "manufacturer": "IKEA of Sweden", "model_id": "TRADFRI motion sensor", "network_address": 34903, "power_source": "Battery", "software_build_id": "2.0.022", "supported": true, "type": "EndDevice" }, Status update from `zigbee2mqtt/[FRIENDLY_NAME]: {"battery":60,"device":{"applicationVersion":32,"dateCode":"20190308","friendlyName":"Bewegungsmelder Wandschrank","hardwareVersion":1,"ieeeAddr":"0x50325ffffe260ad3","manufacturerID":4476,"manufacturerName":"IKEA of Sweden","model":"E1525/E1745","networkAddress":34903,"powerSource":"Battery","softwareBuildID":"2.0.022","stackVersion":98,"type":"EndDevice","zclVersion":3},"illuminance_above_threshold":false,"linkquality":255,"occupancy":true,"update":{"state":"idle"},"update_available":false}

5. IKEA E1812 (TRADFRI shortcut button) device entry from zigbee2mqtt/bridge/devices { "date_code": "20211118", "definition": { "description": "TRADFRI control outlet", "exposes": [ { "features": [ { "access": 7, "description": "On/off state of the switch", "name": "state", "property": "state", "type": "binary", "value_off": "OFF", "value_on": "ON", "value_toggle": "TOGGLE" } ], "type": "switch" }, { "access": 7, "description": "Controls the behaviour when the device is powered on", "name": "power_on_behavior", "property": "power_on_behavior", "type": "enum", "values": [ "off", "previous", "on" ] }, { "access": 1, "description": "Link quality (signal strength)", "name": "linkquality", "property": "linkquality", "type": "numeric", "unit": "lqi", "value_max": 255, "value_min": 0 } ], "model": "E1603/E1702/E1708", "options": [], "supports_ota": true, "vendor": "IKEA" }, "endpoints": { "1": { "bindings": [ { "cluster": "genOnOff", "target": { "endpoint": 1, "ieee_address": "0x00212effff0781ef", "type": "endpoint" } } ], "clusters": { "input": [ "genBasic", "genIdentify", "genGroups", "genScenes", "genOnOff", "genLevelCtrl", "touchlink" ], "output": [ "genScenes", "genOta", "genPollCtrl", "touchlink" ] }, "configured_reportings": [ { "attribute": "onOff", "cluster": "genOnOff", "maximum_report_interval": 3600, "minimum_report_interval": 0, "reportable_change": 0 } ], "scenes": [] }, "242": { "bindings": [], "clusters": { "input": [ "greenPower" ], "output": [ "greenPower" ] }, "configured_reportings": [], "scenes": [] } }, "friendly_name": "Steckdose 4", "ieee_address": "0xcc86ecfffe9f65ef", "interview_completed": true, "interviewing": false, "manufacturer": "IKEA of Sweden", "model_id": "TRADFRI control outlet", "network_address": 28860, "power_source": "Mains (single phase)", "software_build_id": "2.3.089", "supported": true, "type": "Router" }, { "date_code": "20210727", "definition": { "description": "TRADFRI shortcut button", "exposes": [ { "access": 1, "description": "Remaining battery in %", "name": "battery", "property": "battery", "type": "numeric", "unit": "%", "value_max": 100, "value_min": 0 }, { "access": 1, "description": "Triggered action (e.g. a button click)", "name": "action", "property": "action", "type": "enum", "values": [ "on", "off", "brightness_move_up", "brightness_stop" ] }, { "access": 1, "description": "Link quality (signal strength)", "name": "linkquality", "property": "linkquality", "type": "numeric", "unit": "lqi", "value_max": 255, "value_min": 0 } ], "model": "E1812", "options": [ { "description": "Simulate a brightness value. If this device provides a brightness_move_up or brightness_move_down action it is possible to specify the update interval and delta.", "features": [ { "access": 2, "description": "Delta per interval, 20 by default", "name": "delta", "property": "delta", "type": "numeric", "value_min": 0 }, { "access": 2, "description": "Interval duration", "name": "interval", "property": "interval", "type": "numeric", "unit": "ms", "value_min": 0 } ], "name": "simulated_brightness", "property": "simulated_brightness", "type": "composite" } ], "supports_ota": true, "vendor": "IKEA" }, "endpoints": { "1": { "bindings": [ { "cluster": "genPollCtrl", "target": { "endpoint": 1, "ieee_address": "0x00212effff0781ef", "type": "endpoint" } }, { "cluster": "genPowerCfg", "target": { "endpoint": 1, "ieee_address": "0x00212effff0781ef", "type": "endpoint" } } ], "clusters": { "input": [ "genBasic", "genPowerCfg", "genIdentify", "genAlarms", "genPollCtrl", "touchlink" ], "output": [ "genIdentify", "genGroups", "genOnOff", "genLevelCtrl", "genOta", "closuresWindowCovering", "touchlink" ] }, "configured_reportings": [ { "attribute": "batteryPercentageRemaining", "cluster": "genPowerCfg", "maximum_report_interval": 62000, "minimum_report_interval": 3600, "reportable_change": 0 } ], "scenes": [] } }, "friendly_name": "SHORTCUT Button Bad", "ieee_address": "0x0c4314fffeae62bd", "interview_completed": true, "interviewing": false, "manufacturer": "IKEA of Sweden", "model_id": "TRADFRI SHORTCUT Button", "network_address": 45327, "power_source": "Battery", "software_build_id": "2.3.080", "supported": true, "type": "EndDevice" }, Status update from `zigbee2mqtt/[FRIENDLY_NAME]: {"action":"on","battery":87,"device":{"applicationVersion":33,"dateCode":"20210727","friendlyName":"SHORTCUT Button Bad","hardwareVersion":1,"ieeeAddr":"0x0c4314fffeae62bd","manufacturerID":4476,"manufacturerName":"IKEA of Sweden","model":"E1812","networkAddress":45327,"powerSource":"Battery","softwareBuildID":"2.3.080","stackVersion":98,"type":"EndDevice","zclVersion":3},"linkquality":255,"update":{"state":"idle"},"update_available":false}

For comparison (see above) Xiaomi SJCGQ11LM (Aqara water leak sensor) device entry from zigbee2mqtt/bridge/devices { "date_code": "20200310", "definition": { "description": "Aqara water leak sensor", "exposes": [ { "access": 1, "description": "Remaining battery in %", "name": "battery", "property": "battery", "type": "numeric", "unit": "%", "value_max": 100, "value_min": 0 }, { "access": 1, "description": "Indicates whether the device detected a water leak", "name": "water_leak", "property": "water_leak", "type": "binary", "value_off": false, "value_on": true }, { "access": 1, "description": "Indicates if the battery of this device is almost empty", "name": "battery_low", "property": "battery_low", "type": "binary", "value_off": false, "value_on": true }, { "access": 1, "description": "Voltage of the battery in millivolts", "name": "voltage", "property": "voltage", "type": "numeric", "unit": "mV" }, { "access": 1, "description": "Measured temperature value", "name": "temperature", "property": "temperature", "type": "numeric", "unit": "°C" }, { "access": 1, "description": "Link quality (signal strength)", "name": "linkquality", "property": "linkquality", "type": "numeric", "unit": "lqi", "value_max": 255, "value_min": 0 } ], "model": "SJCGQ11LM", "options": [ { "access": 2, "description": "Number of digits after decimal point for temperature, takes into effect on next report of device.", "name": "temperature_precision", "property": "temperature_precision", "type": "numeric", "value_max": 3, "value_min": 0 }, { "access": 2, "description": "Calibrates the temperature value (absolute offset), takes into effect on next report of device.", "name": "temperature_calibration", "property": "temperature_calibration", "type": "numeric" } ], "supports_ota": false, "vendor": "Xiaomi" }, "endpoints": { "1": { "bindings": [], "clusters": { "input": [ "genBasic", "genIdentify", "genPowerCfg" ], "output": [ "genOta" ] }, "configured_reportings": [], "scenes": [] } }, "friendly_name": "Wassersensor_Kueche", "ieee_address": "0x00158d000774cfbd", "interview_completed": true, "interviewing": false, "manufacturer": "LUMI", "model_id": "lumi.sensor_wleak.aq1", "network_address": 35051, "power_source": "Battery", "software_build_id": "3000-0001", "supported": true, "type": "EndDevice" }, Status update from `zigbee2mqtt/[FRIENDLY_NAME]: {"battery":99,"battery_low":false,"device":{"applicationVersion":6,"dateCode":"20200310","friendlyName":"Wassersensor_Kueche","hardwareVersion":2,"ieeeAddr":"0x00158d000774cfbd","manufacturerID":4151,"manufacturerName":"LUMI","model":"SJCGQ11LM","networkAddress":35051,"powerSource":"Battery","softwareBuildID":"3000-0001","stackVersion":2,"type":"EndDevice","zclVersion":1},"linkquality":255,"tamper":false,"temperature":24,"voltage":2985,"water_leak":false}

Versions used Please provide the version of the following pieces of software:

itavero commented 2 years ago

The code for the battery service is literally the same code on this plugin, for all devices that support it. I also have the same devices and have had indications in Home.app when they had a low battery.

Can it be that it is not showing because they do not have a low battery?

If I look in the Home.app or the Eve app for instance, I do see the battery status for my Xiaomi Aqara sensors. No sensors that are almost empty at the moment though, so no easy way to check that from my phone right now.

Also keep in mind that it's a separate service, so perhaps that particular app (which I'm not familiar with) is displaying it a bit weird.

JayJay-Master commented 2 years ago

I can confirm, that Apples Home app and Eve app have a indication for low battery, but it is not avaiable for automations in this apps. In the Home+ app it should also be available for automations. With node-red I'm able to get the StatusLowBattery, but it would be nice have everything in one automation and not to split it on different plattforms (Home+ app and node-red). With node-red I can not reach the Eve devices. they are only in Home or comatible apps available.

JayJay-Master commented 2 years ago

Seems, that it was a bug in Home+ app. With a newer release everything works fine. therefore I close this issue.