Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95419

Last changed xy minutes ago

$
0
0

@szucs.krisz wrote:

I’m trying to add a sensor to see the last time, my heat turned on.

The attribute of the sensors, I’d like to read is:

entity: sensor.pump
states: ‘Kikapcsolva’ / ‘Bekapcsolva’

I’d like the xy minutes ago to read when the sensor turned to ‘Bekapcsolva’ state.
I couldn’t find any solution, then I turned to “states.sensur.pump.last_changed” soution. It is a bit confusing, because it will be reset in both states, but I gave it a try.

ngbs_turned_on1:
friendly_name: Minutes ago
value_template: “{{ ((as_timestamp(now()) - as_timestamp(states.sensor.pump.last_changed))) | round(0) }}”

The problem is, it is not changing. It does reset the counter, when the sate changes, but the counter doesn’t rise. It keeps showing me 0. :frowning:

image

It’s like the as_timestamp(now()) not reading the correct timestamp.
If anyone has any idea, or a better solution to read ‘Bekapcsolva’ state, I’d be really glad. :slight_smile:

Posts: 7

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 95419

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>