sensor.p1_meter_5c2faf04a1f2_peak_demand_current_month**.last_changed** still gives me the date of today. what can I do to see the date when the sensor value has changed
What is its state under the dev tools? Are you sure it had a change since? Is the device on and/or connected to HA?
What I think is happening… Each time I restart HA (to check my code) it places this date.
The value doesnt change, but maybe because of the restart something changes ?
Put this in your template editor on HA and show the result here:
{{ states.sensor.p1_meter_5c2faf04a1f2_peak_demand_current_month.last_changed }}
{{ states.sensor.p1_meter_5c2faf04a1f2_peak_demand_current_month.last_updated }}
Resultaattype: string
2023-04-25 05:10:35.535425+00:00
2023-04-25 05:10:35.535425+00:00
Are these what you expected them to be?
What is this?
I missed this earlier.
Check: last_changed
vs last_updated
.
the image is the value is the moment when the sensor changed value… 17 april, 22 april
so the last changed should be 22 of april