I’m writing an automaton to send a notification when my cats use our litter robot. They each weigh different weights, so when the robot reports a cat’s weight, I know who it is. Here is a graph showing the three cat weight bands over the last few days:
The one extra-low 5lb weight is when a cat touches the robot with its paws, peeks in, and then goes away. I’ve written the trigger to only respond for weights between the focus range of 8<x<16.
Would I be correct in assuming that this entity isn’t returning a weight when there is no cat? Ideally, the entity would return 0 for that scenario or something, but in any case, if there is no value returned for the entity, then perhaps this feature request I created is narrower than it should be (unless your litter robot is also a Z-Wave device).
That having been said, regardless of what the chart shows, maybe you can work around this by using that trigger as a condition. For instance, if the device provides any other indication of presence, that could be the trigger (with a delay added via the “for” piece if necessary to get the correct weight reading) and the weight could be the condition. Alternatively, if you only have the weight, perhaps the entity reflects a state other than the number (like unavailable), in which case the trigger could be when that state changes from unavailable (or whatever means there is no weight detected).
Another thought, since I know nothing about your device, if the weight is always accurate and includes the litter, you could have multiple triggers, one for each cat, but you’d have to maintain them as the unoccupied weight changes. You could also use helpers and automations to deal with that.
That FR makes no sense with battery devices. Instead you can poll the zwave device after a specific period to see if it’s dead. It will show up as unavailable.
Otherwise, if we were to go ahead with that FR, your battery devices would go unavailable if they didn’t periodically check in at a rate that HA expects.
@petro Awesome! I had the right concept but not in the right places. Thanks!!
@The00Dustin The Litter Robot only reports a value when a cat is detected. Having the Home Assistant trigger platform “state” looking at the specific pet weight entity essentially translates the trigger into, “If you receive any value at any time, run this automation”, which is exactly what I need it to do.
@petro we can take this dicussion to my request or elsewhere if that would be better and there is any value in continuing it after this post, but I wasn’t sure where to reply.
I see what you mean about battery devices in general (and this is, in fact, why Z-Wave doesn’t ever report battery devices as dead), however, what I just stated in parenthesis also mean that no, I can’t do what you suggest. The feature request also suggests the timeouts be adjustable with reasonable timeouts, so I’m not sure how it is’t already addressing the things you suggest don’t make sense.