-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing: device availability #775
Comments
doesnt work with hassio/zigbee2mqtt-edge. |
Should be, can you post your startup log? |
sure. 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 |
I stopped/started the zigbee2mqtt-edge addon in hassio this morningn (auto-update is on), but still on commit #2a197a4. |
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... |
Can you post a bit more of you startup log? I'm especially interested in the |
sure! |
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: and config yaml: EDIT! will test again with |
YES! we are getting somewhere! |
Can you post your log_level: debug log? |
https://pastebin.com/bbu0MEnD |
Found the bug, should be fixed |
Koen, thanks! |
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 ! |
Another improvement would be:
|
Great feature ! |
Question.. I have the E11-G13 - Sengled Element Classic (A19) (EndDevice) bulbs, these do not report when they are turned ON by the wall switch nor their status periodically. |
@Iv4nS you should modify this function: https://github.com/Koenkk/zigbee2mqtt/blob/dev/lib/extension/deviceAvailability.js#L29 to also return true when the modelId is the one of your bulb. |
@Koenkk Starting with Home Assistant 0.112.5, it's possible to configure multiple availability topics, for example: availability:
- topic: zigbee2mqtt/bridge/state
- topic: zigbee2mqtt/0x00158d0001d0f272/availability An updated availability on any configured topic will flick availabaility, so for this to work:
HA PR: home-assistant/core#37418 |
@emontnemery thanks, so if I understand correctly, I should change the following in the device discovery payload: availability_topic: zigbee2mqtt/my_device/availability to availability:
- topic: zigbee2mqtt/my_device/availability
- topic: zigbee2mqtt/bridge/state If yes, for backwards compatibility purposes is it allowed to have both (will this work on both < 0.112.5 and 0.112.5 >=)? availability_topic: zigbee2mqtt/my_device/availability
availability:
- topic: zigbee2mqtt/my_device/availability
- topic: zigbee2mqtt/bridge/state |
availability:
- topic: zigbee2mqtt/my_device/availability
- topic: zigbee2mqtt/bridge/state Exactly! Just take care not to send
No, that's unfortunetaly not allowed :( |
@emontnemery thanks, I will set a reminder to update this after the 0.114 release (so everybody got time to update). |
For non-pingable devices I would suggest moving from a global "availability_timeout" to a device specific. That is, move this option under the individual device sections of the configuration file. Justification is that some battery sensors update more regularly than others. For example Xiaomi temperature sensors are typically updating every 1000 seconds, while their contact sensors may only update every 5000 seconds. |
Would it be possible to enable the "ping-poll" for some of the battery powered devices? Use case: contact or motion sensors, where it would be good to learn within a few minutes that the sensor is offline. For eg: loss of a contact/motion sensor can be a sign of a possible security breach/tampering. |
I have try to change type of Bulb which is often shutdown from Router to EndDevice to avoid some other device choose this router, but now i cannot ping them with availibility time out ... Is ther a way to ping specifically End Device ? (in my cas bulb wich is not on battery) @Koenkk ? |
Don't do this, this will have zero effect |
Strange, in Zigbee2mqttassitant, it show my bulb in cercle since i have change device type in the database file and i have no arrow who go to in. It seems work. It's just an error of zigbeetomqttassistant ? |
@Koenkk The possibility to define a list of availability topics was included in HA 0.112, and 0.117 will be released in a couple of days. I think it's OK to change zigbee2mqtt to use the list now. |
@emontnemery yes you are right, implemented this. Thanks for pinging! |
Would it be possible to show a device as unavailable if Z2M is unable to reach it? IE if a device is switched on and doesn't respond and throws up this message:
|
Hello @Koenkk , |
@Indybeak done |
Hi, You say this : Possible to make an option to change the timeout for non pingable devices ? I think is a best option if user use it with an alarm. |
@Koenkk
|
@Indybeak thanks fixed. Fix will be in master with next z2m release (1 feb) |
Should the availability_timeout parameter work with a Domoticz environment as well? I have added this parameter, but |
Same question. For water leak sensors 25 hours may be too late :) |
I don't worry about the battery powered devices, because I have a script that alerts me if one is not available for some time (not a water leak sensor by the way ;-) ). I want to check availability of the IKEA bulbs to detect when it's switched off. In case power is switched off manually Domoticz doesn't update the bulb status. The availability feature doesn't make a difference. |
Can you share the script ? how did you do that ? I try to create a think like this in Node red |
I have used this post to set up my script. Works as expected |
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 beingoffline
andonline
.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
How to test
Update zigbee2mqtt to the latest dev branch (edge for hassio users). Stop zigbee2mqtt, add to zigbee2mqtt
configuration.yaml
start zigbee2mqtt and restart Home Assistant.
Most of the credits of this feature go to @ugrug
The text was updated successfully, but these errors were encountered: