#states not matching on automation

1 messages · Page 1 of 1 (latest)

atomic forum
#

I have a utility meter (sensor.daily_electric_peak_usage) and a template sensor (sensor.electric_peak_energy)

the template_sensor updates on state change for my energy_total_sensor and this park of the automation works great, but I have a discrepncy between my utility_sensor (which is linked to my template_sensor)

see image.

my template_sensor is updating with the automation and is showing 0.18kWh however my utility meter seems to see 0.10 and i have no idea why as its last valid state is showing 0.18

have i missed something here?

supple ember
#

Can you show the history of both sensors from when the reset occurred?

atomic forum
#

how to i do that? i was waiting for a midnight reset tonight and this is the current states:

#

is it possible my template_sensor is updating when the measure_sensor changes states and the utility_meter tries at same time?

#

but misses it?

#

now it will be 0.28kWh behind all day

#

maybe i need to create the utility_meter again with a 1 minute delay or something to make sure it updates after the template_sensor... if this makes any sense...

supple ember
#

if you go into the "history" page you can add both sensors and then select the time range to be when the reset happened

atomic forum
#

handy to know

#

looks like its wrong way round for the reset... i need the electric peak energy to update first

supple ember
#

i think more importantly the second one isn't resetting to 0

atomic forum
#

aaah

supple ember
#

that's the template sensor, right?

atomic forum
#

correct

supple ember
#

what's the template you're using?

atomic forum
#

{{ [states('sensor.dcc_sourced_smart_electricity_meter_usage_today')|float, 2]|min }}

#

my source sensor doesnt go to zero either

supple ember
#

well... that's probably the problem then... that's weird though, does it go to the same value every day?

atomic forum
#

no varies

supple ember
#

weird.. what's the integration that provides the sensor?

atomic forum
#

hilderbrand glow

supple ember
#

oh, the little esp32 thing?

atomic forum
#

no its the glow app i assume its an API pull

#

i am waiting for there MQTT IHD to be back in stock

#

for better values

supple ember
#

ohh i see - there's an electricity meter reader thing called glow as well ^^

atomic forum
#

counts the LED pulses?

supple ember
#

yeah

atomic forum
#

i have a few ESP32 in my drawer i could knock something up but thought this might be better

#

proven it isnt

supple ember
#

hmmm - well given the behaviour we're seeing - what is the actual problem it's causing?

atomic forum
#

just my numbers are always slighlty out when calculating costs each day

#

because the main sensor never appears to start at 0kWh at midnight reset

#

and each day its random, yesterday started at 0.8kWh at reset, today at 0.2kWh

supple ember
#

is there a sensor that doesn't reset?

#

energy total or something?

atomic forum
supple ember
#

ok, use a utility meter on that sensor directly - that should eliminate the reset

#

you can then use that in the energy dashboard and it will work properly

atomic forum
#

cheers just done it 🙂