but in this case rain_sensor itself has no value to change.
And in any case I still want to know if the child-attribute changes. All the children change independently for different reasons.
Just so you know what I mean, remaining starts at 60 (the value of delay) and decreases with time until it reaches zero. Unless or until it goes back to 60 when triggered becomes true again.
Please show a screenshot of the state of your entities in the developer tools, because the way you show it doesn’t make sense in HA: attributes have only 1 “level”.
So the attributes of the “vacuum.landroid” entity might look similar to
I think you might need to add a helper to hold the last value of the attribute and then use a template trigger to run the actions when the new attribute is not equal to the old attribute value:
My pure guess … I would believe that you could use a template trigger on the attribute ‘rain_sensor’ and trigger variables trigger.from_state and trigger.to_state to evaluate whether the change was in the remaining. Then use that variable boolean to do nothing or do something in the automation.
EDIT: As pointed out below, the [0] index selection may not be necessary, but I do not use the device or integration in question and I am unable to test its necessity. Try it without first, and if you get errors try it with the index selection.
Most of the weather integrations that offer forecasts use something similar…
Why [0]? It’s not an array.
If {{ state_attr('vacuum.landroid','rain_sensor').remaining }} works in the developers tool, then indeed a template is the way to go.
I could only find 1 entity in my instance that is similar to OP’s with just a single set of sub-attributes instead of an explicit array like the weather forecasts and it throws an error (UndefinedError: 'homeassistant.helpers.template.Wrapper object' has no attribute 'today') if I don’t use [0]…
That’s because it’s an array, as can be seen in the dev tools.
If the “children” start with an hyphen, it’s an array, and then [<index>] is required, indeed.
But that’s not the case for the OP, as can be seen from his screenshot.
The States tool doesn’t always show a hyphen for arrays. (See any thread regarding the mobile app’s Bluetooth Connection sensor and its connected_paired_devices and paired_devices attributes)