-
Notifications
You must be signed in to change notification settings - Fork 510
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
Proposal: deprecate reachable
attributes
#2590
Comments
Thanks !! |
Did some testing and managed to add That value is kept in local time, so I needed to convert it to UTC. I daren't change the I didn't (yet?) create a proper Will look at |
To be honsest, I really like the idea. I never had any real use for it based on the mechanism behind it as it was not precise enough for my needs. Also, it didn't help to determine if any of the devices may have any issues (emty battery or whatever). In the end, I created custom functions in my middleware to check if certain boundaries have been exceeded to derive it a device is having issues and that partially required for timestamps to be created and tracked. If we'd use something like last seen with the value of a timestamp, I could directly use if and spare some code elsewhere to get a clean indication if everything's in order. For my taste, we don't need miliseconds here, that's a bit over the top. |
Thanks for you reaction, @SwoopX. Would you need push notifications when |
Actually, I'd prefer to have it pushed automatically upon change. |
why not calc yourself? e.g. |
Yeah, sure. It's an improvement, but it will still have the same underlying constraints as I'm not against this PR, I'm just saying that some of us have found a more or less "useful" usage of Edit: @manup below just read my mind. It's a way too big step for every enduser to figure out the thresholds on their own.
|
IMHO
I'd suggest we model the value of the attribute based on the knowledge that we have about devices:
|
As I tried to explain above, that depends on many factors. For devices (like IKEA lights) that support attribute reporting, it depends on the reporting configuration. This should be configured by the REST API plugin, but might be changed by the user in the GUI. For devices that are only updated from polling, it depends on the size of your network. I my experience polling works rather unpredictably; some devices seem to be polled more frequently than others and I haven't been able to understand why.
In my experience, that doesn't work as there's dependencies on local settings and on the local network.
What about a |
I think that sounds like a good idea. I can help to test this feature since I already today rely heavily on |
Wouldn't
@manup I believe it would pay off, also giving more flexibility. I personally love to stay in control. Anyway, I'd also be happy with the ability to define some device specific timeouts as well. Downside I see here is that I wouldn't introduce this in the code keeping API v2 in mind. I'd rather vouche for introducing device specific config files then or extending the database model (which also could use some overhauling ;) ). Lastly, also happy to contribute in testing and trying out various approaches in my test network. |
In my current testing, I based
How would they do that, when there's no power to drive the radio? Of course, when turned off but still powered, the lights continue to send reports and respond to requests from the gateway. |
I meant indeed turned off, not powered off. |
And this is why we did it!
Not too happy with the need to include
|
Only update |
reachable (true) is very important for me, my IKEA lights and all my light automations to trigger a light or lights at specific CT and brightness when reachable is true. For example: if a light/s are reachable (true) and the time is between 6:30 - 22:00 it triggers to switch them to CT 250, brightness: 212. If the same light/s are "reachable" (true) between 22:30 - 6:30 it triggers them to switch to CT 370, brightness: 127. The automations triggers only on state change. So, if the automation was triggered ones the state should become false, to be able to re-trigger again, when become true. My main lights are controled most of the time from the old wall switchs and the reachable (true) attributes is very reliable to switch the lights at specific color and brightness. Reachable (false) is not so relaiable but I actually dont use it for anything but just to to orientate myself, when the lights were powerd off +-15/30mins. As was mentioned earlier my Ikea lights needs about 15-30mins to report them as reachable (false), when they are powered off. Comparing them to my Aqara CT lights which only needs about 5-6min. to report them as reachable (false). The real problem right now is that if a light is reachable (false), its "on" attributes stays (true), it does not update to false. if the state is not changing its a problem for automations. in the example below you can see what I mean. The light is actually powerd off from the wall switch, and since it was preaviously reachable (true), also on (true). it updates reachable to (false) but on stays always (true), if I power off from the wall switch.
For a light that is always reachable (true) (for example my night lights), on true/false is important because I control the light base on that attributs, reachable is useless at that case. IMHO, to consider reachable is useless or not is very dependent on the way a light is used. |
Hi Erik, in commits 61bfd6d 2d71369 131815d you've changed the time stamp formats for 'lastseen' and refer to this issue, I got hit by your changes when updating to deconz 2.05.80 and 2.05.81 as my own code using REST didn't accept the new format anymore, using format "%Y-%m-%dT%H:%M:%S.%N" (with and without trailing ".N") with strftime(3) and date(1), if I'm interested in less resolution, I always can reduce at the client level, no need to not provide exact times via REST (and I understand very well how "exact" those values are;) now looking at the current code, there still 4 different formats for time stamps, two with "Z" and two without:
for now I very much prefer always having "ss.zzz" with fractions of seconds to use some heuristics to determine if 3 measurements for Xiaomi Aqara temperature/humidity/pressure multi_sensor node are from one measurements (e.g. within 0.5 secs, this is getting worse to useless when having resolution of seconds or even minutes). so for testing I've changed all 43 time stamps except those 7 labeled ISO 8601 formats to "yyyy-MM-ddTHH:mm:ss.zzz" for my setup (mostly only sensor monitoring: 30+ routers, 50+ sensors, some extra stuff, and many more sensor nodes to come). let me see how this works... please always consider if such REST interface changes should be upward compatible and transparent, to avoid surprises in unknown use cases! comments very welcome! |
What part of “Changed API” don’t you understand? https://github.com/dresden-elektronik/deconz-rest-plugin/releases/tag/V2_05_80:
|
Hi Erik,
On 9/29/20 6:19 PM, Erik Baauw wrote:
without any hints in release notes or similar that the format in
REST interface changed
What part of “Changed API” don’t you understand?
https://github.com/dresden-elektronik/deconz-rest-plugin/releases/tag/V2_05_80:
*Changed API*: Report |lastseen| with a resolution of minutes, and
issue at most one web socket notification per minute per device
for |lastseen|, see #2590
<#2590>.
oh sorry!
this rant wasn't about your releases of deconz-rest-plugin, but about
the "deconz" package from dresden-elektronik.
right now I'm only a user of the deconz raspian package, and after
upgrade I got hit by this incompatible change.
and looking through their web pages (which I did not before upgrading,
shame on me too;) I still can't find hints
about any changes between deconz 2.05.79 and 2.05.80/81) -- and their
changelog stopped at 2.05.77:
https://phoscon.de/en/conbee2/software#deconz
https://dresden-elektronik.github.io/deconz-rest-doc/
https://phoscon.de/en/changelog
but maybe, breaking the API shouldn't be kept "Under the hood" ? ;-))
anyway, thanks a lot for your all your work!!
I still wonder if a single (and stable;) format for all time stamps
wouldn't be better... ?!
Mit freundlichen Grüßen / Best regards
*Harald König *
Engineering Optical Systems (BST/EOS2)
Bosch Sensortec GmbH | Gerhard-Kindler-Straße 9 | 72770 Reutlingen |
GERMANY | _www.bosch-sensortec.com_ <http://www.bosch-sensortec.com>
Tel. +49 7121 35-38606 | Fax +49 711 8115140583 |
[email protected]_
<mailto:[email protected]>
Sitz: Kusterdingen, Registergericht: Stuttgart HRB 382674,
Ust.IdNr. DE 183276693 - Steuer-Nr. 99012/08040
Geschäftsführung: Stefan Finkbeiner, Jens-Knut Fabrowsky
|
The format follows ISO8601, which defines the milliseconds, seconds, and even minutes as optional, according to https://en.wikipedia.org/wiki/ISO_8601. Except for Most timestamps have a resolution of one second. We changed |
@ebaauw is reachable now deprecated with v80 or newer? I have used the reachable in the past for my fire/smoke sensors and dont want to loose this functionality. |
It's still there. You need to ask @manup for the official status.
I don't know fhem. |
FHEM simply doesn't expose I have to see that I follow up on this... |
Thx, please keep us updated |
Tomorrows fhem update should add the lastseen as stated here: https://forum.fhem.de/index.php/topic,95288.msg1090054.html#msg1090054 thx |
I propose to deprecate and eventually remove the
state.reachable
attribute from/lights
resources and theconfig.reachable
attribute from/sensors
resources. These attributes are utterly useless. They do not indicate whether a device is, in fact, reachable. They certainly don't indicate whether a device is powered. They cause a lot of confusion and fruitless discussions.As indicated earlier, I think the REST API should expose a
lastseen
attribute instead, indicating the last time a message from the device was received.Background
ZigBee doesn't know the concept of connections; it only deals with messages. The deCONZ GUI is like a city map: it displays roads, not actual traffic. The GUI draws lines for neighbour table entries, as reported by the devices. Just like a city map doesn't show whether a road is actually being used, the GUI doesn't show whether there's any messages using these routes.
Technically, end devices are unreachable almost all of the time. They turn off their radio, to preserve (battery) power. They can only be reached through their parent router, who acts like a post office holding poste restante (general delivery) mail. ZigBee routers, however only keep the message addressed to the end device for like 7 seconds. Light sleepers, end-devices that wake up once every 5 seconds to check whether their parent has any messages for them, can be reached "normally", albeit with a slight delay. Deep sleepers, that only poll their parent like once an hour, can only be reached for 10 to 100 milliseconds per hour.
The REST API plugin sets the
reachable
attribute when it receives a message from the corresponding device. So far, so good. However, clearing thereachable
attribute is far more elaborate. For devices that are polled by the gatewayreachable
is cleared after not receiving a response to a message for a couple of times in succession. Depending on the size of your network (devices take turns being polled), this might take a couple of seconds to minutes. Devices that support attribute reporting aren't polled, soreachable
cleared after missing a couple of expected reports in a row. For deep sleepers, you'd only expect a report once per hour, so it takes several hours forreachable
to be cleared.The text was updated successfully, but these errors were encountered: