trying something lik this:
{% for state in states.sensor| selectattr('last_changed') | sort(attribute='last_changed', reverse=true) -%}
{{ state.last_changed.timestamp() | timestamp_local }} : {{ state.entity_id }}
{% endfor %}
renders a list of the sensors last updated. this is a snapshot though, and we can hit the enter key, to see if there’s a sensor in the top 10 or so that stays there, indicating its frequent updating.
I was hoping this could be made more intelligent, and have the jinja select that for us.
reason I ask is that for several sensors, I need more frequent updating than is possible now.
- wait_template: >
{% set updater = states('sensors_huidig_verbruik_summed') %}
{{(now() - state_attr('script.play_sleep_radio','last_triggered')|default(0)).total_seconds()
> states('input_number.sleep_delay')|int * 60}}
in the above, we normally enter sensor.time for the update trigger, but in this case once a minute is way behind the needs for this situation. the sensor.time could cause a max delay of 59 seconds So, in order to get a more precise template, I now use a sensor that is connected to my smart meters updating, which is rather more frequent. But still not each second.
What I am really looking for, is for this specific template, to update each second.
I can of course, and have, create an automation triggering each second, but I don’t want to overload the full system with the need for this 1 template (well, 2 actually)
Was hoping to find the sensor in the system that updates most frequently, and use that as trigger here, so no extra overhead was created.
Of course, if we could simply use the heartbeat of the state machine, that would be even better…