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

15002 endpoint #106

Closed
nykfank opened this issue Sep 19, 2018 · 4 comments
Closed

15002 endpoint #106

nykfank opened this issue Sep 19, 2018 · 4 comments

Comments

@nykfank
Copy link

nykfank commented Sep 19, 2018

I saw in endpoints.ts that you found an endpoint called hsAccessoryLink with the code 15002. I failed to access this one though the coap-client, while all the other ones worked fine. Is there something special for this endpoint to make it work? I am interested in it because it might help with this question. I was wondering how to detect if a bulb in IKEA trådfri is "Unreachable"? This is the case when the bulb has it's power turned off. I tried to read this state using the API of the gateway through COAP, but there was no change in bulb status after turning off is power. I hoped this would be possible though the 15002 endpoint.

@AlCalzone
Copy link
Owner

AlCalzone commented Sep 20, 2018

Having 15002 in endpoints is a red herring. Back when I tried to started developing this, I copied constants from the decompiled app around and tried to make sense of them. hsAccessoryLink shouldn't be there since it is a sub property of groups, which links groups and the devices in it:

function parseAccessoryLink(link: AccessoryLink): number[] {

Regarding your other question, #93 has some answers.
Basically the gateway assumes a device is "alive" until it stops responding to requests. You can try to force a check by sending a slightly changed value, e.g. a change of the brightness by +/- 1. If a bulb it offline, this should result in the alive state becoming false after a while.

@nykfank
Copy link
Author

nykfank commented Sep 20, 2018

Thanks again, I've got it working now. Just realized the alive property is just the 9019 code in the device endpoint. I get reliable results by changing brightness by 1, waiting for 10 seconds, then checking alive.

@nykfank nykfank closed this as completed Sep 20, 2018
@nykfank
Copy link
Author

nykfank commented Sep 20, 2018

Better even to change warmth by 1 (and back) each seconds for 5 seconds. This will not turn on the bulb if it was alive and turned off and still detects alive status reliably.

@AlCalzone
Copy link
Owner

Good idea! I think this should be documented. Would you be willing to describe your process briefly #107?

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

2 participants