Testing: device availability
This allows zigbee2mqtt to mark individual devices as offline. E.g. when you switch a bulb off using the regular switch.
The device availability is published on zigbee2mqtt/[FRIENLDY_NAME]/availability with possible payloads being offline and online.
Home Assistant integration has been updated, devices will be shown as unavailable when they are offline.
Device availability is only checked for AC powered routers.
Todos
- [x] Check device availability for new paired devices (without having to restart zigbee2mqtt)
- [x] Mark device online when message is received
- [x] Retrieve state after online
- [x] Update documentation
- [x] Allow to blacklist devices from being checked
- [x] Availability timeout for non AC-powered devices (#1020)
- [ ] Test, test and test
How to test
Update zigbee2mqtt to the latest dev branch (edge for hassio users). Stop zigbee2mqtt, add to zigbee2mqtt configuration.yaml
advanced:
availability_timeout: 60 # Availability check interval
start zigbee2mqtt and restart Home Assistant.
Most of the credits of this feature go to @ugrug
doesnt work with hassio/zigbee2mqtt-edge. Can't see anything different. (when is zigbee2mqtt-edge updated to most recent source?)
Should be, can you post your startup log?
sure. https://pastebin.com/VaamLD4M and in configuration.yaml: experimental: availablility_timeout: 60
regards,
@wimpie007 I see that your are running #2a197a4, this was introduced in a later commit #afeed4f372bced737206bd91f8e62ce65b127eb9 (this can be seen in the startup log).
Note that also a typo has just been fixed availablility -> availability, I've updated the configuration in the OP. Wait at least one hour to give the hassio addon some time to regenerate.
I stopped/started the zigbee2mqtt-edge addon in hassio this morningn (auto-update is on), but still on commit #2a197a4. In hassio, i can't do more to 'force' the update?
I dont understand why, the image has been updated 14 hours ago which makes sense (https://hub.docker.com/r/dwelch2101/zigbee2mqtt-edge-armhf/tags). @danielwelch could you help?
I don’t think starting and stopping alone should work, as this doesn’t pull the new image. You need to uninstall and re-install.
Thanks! uninstall/install did the trick, bit annoying, but ok!:) will report later on....
doesnt seem to do anything... here is the start-log. https://pastebin.com/u5kANWCm
Can you post a bit more of you startup log? I'm especially interested in the homeassistant/ topic it publishes to.
sure! https://pastebin.com/WmXvQ2Qz PS Happy 2019!!:)
Happy 2019! Somehow the functionallity is not enabled yet (because it still publishes zigbee2mqtt/bridge/state as availabillity topic). Can you post the experimental part of your configuration.yaml again?
config in hass.io: { "data_path": "/share/zigbee2mqtt", "homeassistant": true, "permit_join": false, "mqtt_base_topic": "zigbee2mqtt", "mqtt_server": "mqtt://homeassistant:1883", "serial_port": "/dev/ttyACM0", "disable_led": true, "log_level": "debug", "zigbee_shepherd_debug": false }
and config yaml: https://pastebin.com/mtYCa2G4
EDIT! DOH! i did a paste from the instruction site, and copied also the typo: availablility_timeout: 60
will test again with availability_timeout
YES! we are getting somewhere! for the lights it works! show up as "unavailable" when powered-off. BUT... also for al the sensors. Sensors show all up as unavailable as they do not respond to ping... "Device availability is only checked for AC powered routers.": not true!:)
Can you post your log_level: debug log?
https://pastebin.com/bbu0MEnD see for example device: 0x00158d00029c076d (0x00158d00029c076d): RTCGQ11LM - Xiaomi Aqara human body movement and illuminance sensor (EndDevice)
Found the bug, should be fixed
Koen, thanks! it works now! state of the lamps doesnt reflect reality after power off/on, but that is another issue... a big step for this project! nice!
I think that could be fixed relatively easy, we just need to poll the state when yhe bulb comes back online. (unfortunately I dont have access to my laptop for a few days)
@Koenkk I can also confirm that it works for me on a bunch of different Trådfri bulbs as well as some Philips Hues. I don't see any updates for my battery driven sensors/buttons as expected..
It would be great if you also manage the state of the lights send to Home Assistant as mentioned by @wimpie007.
Under all circumstances - thanks for doing/maintaining this brilliant project !