Hi,
I’m a HASS newbee and learning something about automation.
Therefore I’d like to use the value of “last_changed” in a script, but it doesn’t work as expected.
OK, thanks! A simple but also very helpful tip!
But let’s go to advanced topics, which will cause another problem:
My var “entity” is set by a variable from a blueprint.
variables:
sensor: !input contact_sensor
entity: states.{{sensor}}.last_changed
...
...
action:
message: "Send this demo-message with {{ as_timestamp(entity) }}"
As far as I could see, this will be used as a string again and causing the following error:
Error: Error rendering data template: ValueError: Template error: as_timestamp got invalid input 'states.binary_sensor.hm_sci_3_fm_keq1234567_1_state.last_changed' when rendering template 'Send this demo-message with {{ as_timestamp(entity) }}' but no default was specified