Simplest question/action: get date time of last change of input_boolean?

Hello,

for example i have

So how can i get this value in Node Red?
image

Please do not advise me to use Current State Node or Trigger Тode because they give me only time of last restart of Home Assitant and not of actual change
image
It is the greatest bug of HA hat did not fixed thill this time!

Actually “time of last change” is the basics of all automatisations, but in fact i can not get it… Maybe someone could explain me that…

Thanks for help.

You can only get the value if you haven’t restarted since the last value changed. It’s not a bug, HA actively does not store or retrieve this information after a restart.

If you want this information to persist, you’ll need to create an automation that sets an input_datetime or an mqtt sensor. Or you could use an SQL sensor to find the last changed that is in the database. However, if the last changed time is beyond what your database stores, you’ll get nothing back.

1 Like

But how do see this value after restart here?
image

But it is folly… I have this infomarion here
image
but i do not have access it without creating an extra sensor…

it’s in the database. Again, you can’t access it without doing a lookup with a SQL sensor.

It’s not a folly, its how home assistant is designed.

Correct. You do not.

Very old discussion, but if its the way it is desinged, you see the last changed time stamp on the ui even if rebootet, but don’t have access using the attribute, its defect by design. Hard to accept that the design has flaws, but sometimes happens,…

It’s not an attribute, it’s a property and you do have access to it via templates or certain cards in the frontend. After a restart it will have the restart value because that’s the last time the object was updated. It does not look in the database and assume that the previous database result is the last measurement. This is what you’re asking for, the system to assume the last state was from before it restarted. When the system 100% knows that the current value at startup is the last value.