Skip to content
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

Reachability #9

Closed
cflurin opened this issue Oct 18, 2016 · 15 comments
Closed

Reachability #9

cflurin opened this issue Oct 18, 2016 · 15 comments

Comments

@cflurin
Copy link
Owner

cflurin commented Oct 18, 2016

I've added homebridge/to/set/reachability

topic: homebridge/to/set/reachability
payload: {"name": "flex_lamp", "reachable": true}
or
payload: {"name": "flex_lamp", "reachable": false}

Please install from GitHub:

sudo npm install -g cflurin/homebridge-mqtt
@cflurin
Copy link
Owner Author

cflurin commented Oct 18, 2016

It seems that the Apple home app doesn't support this feature.
I've test it with EVE and here works.

@cflurin cflurin mentioned this issue Oct 18, 2016
@ArnieX
Copy link

ArnieX commented Oct 18, 2016

@cflurin indeed Home.app doesn't support it. Then it is even more strange behaviour while Philips Hue is able to set "No response" status in Home.app the reachability characteristic does not. Any ideas? I have also come by reachability characteristic in Apple's datasheet for HomeKit but even thought I tried it before somehow it didn't work so I thought I'm doing something wrong and gave up. I have no idea what else it could be as Apple's datasheet doesn't quite give a lot info.

@cflurin
Copy link
Owner Author

cflurin commented Oct 19, 2016

@ArnieX:

Please install the latest version from GitHub.
It should now work for Home too (No Response)

Note: at Homebridge start reachable is set true.

@ArnieX
Copy link

ArnieX commented Oct 19, 2016

You are officially my HERO! ;)

Now I will just periodically test if device is connected or not.

@cflurin
Copy link
Owner Author

cflurin commented Oct 19, 2016

great! thanks for your feedback.

@tvillingett
Copy link

tvillingett commented Oct 19, 2016

@ArnieX maybe you can use a "last Will and Testament" if your mqtt client supports that, which helps to see if it is unreachable, instead of writing extra client code. See example of use:
http://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament

@ArnieX
Copy link

ArnieX commented Oct 20, 2016

@tvillingett that is a good idea and less overkill than pinging the device every 60second.

@cflurin cflurin closed this as completed Dec 7, 2016
@CaptiveCreeper
Copy link

how do I make it so that the reachability is false when the device is not connected (off or not on the network).

@cflurin
Copy link
Owner Author

cflurin commented Aug 15, 2017

@CaptiveCreeper
Copy link

The documentation only shows how to set the reachability. It doesnt say anything about how to make it so that when the device no longer responds that it will show as not reachable

@tvillingett
Copy link

@CaptiveCreeper Is the idea to use "last will" that I wrote about above not working for you?

@CaptiveCreeper
Copy link

@tvillingett When I was looking into last will at first I apparently skimmed though it too much and misunderstood how it worked. After you responded saying that it should work I looked into it more and now it does work. Sorry for wasting your time with something that was already solved.

@ArnieX
Copy link

ArnieX commented Aug 29, 2017

@tvillingett I have also used it on your tip, thanks for that.

@linjiejim
Copy link

Thanks for your reference @cflurin , and your tips @ArnieX @tvillingett
Could you tell me how to set the accessory "NO RESPONSE", by using"homebridge/to/set/reachability" at server side? thank you in advance!
However, @tvillingett 's idea can be used on specific Topic, but "HB-mqtt APIs" are general topics, so it seems that the "last will testament" feature doesn't work fine with it? I will be grateful if you correct my mistake.

@linjiejim
Copy link

Cool! And thank you guys for your inspirations.
Finally I find it out and here is a brief for those who may need:
1.[mqtt client] publish a "LWT" to broker when connect with [topic] "homebridge/to/set/reachability "
and [payload] "name": "YOUR_CLIENT_NAME", "reachable": false).
2.homebridge-mqtt will subscribe this topic and set to "unreachable" once client was ungracefully dropped.
3.remember to set reachability to true when CLIENT starts so that you can wake it up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants