Ingesting of energy sensors, energy data entry?

I want to create a dashboard where I can visually compare the historical consumption data against the entity status history in a chart.
series 1: historical hourly energy consumption totals
series 2 to n: historical on/off % values for various tuya lights and switches

I cannot create my energy consumption as sensor with history because i get the data from a provider xml which is always 1 day old. I cannot injest it on the day it happens.

I can however load the daily/hourly names and values into homeassistant as a sensor or an entity. I’m not sure what the sensor / entity should look like in order to be used to create series 1 above.

Should I add each day / hour as an attribute to a single entity? Can attributes as dates be parsed into a graph series later?
Should I just load the whole day/hour/totals as JSON into a state attribute? Can that be parse into a graph later?

I read this just now. Thank you for the reference I can check. I don’t like the idea of manually sending events from the devtools. The comments seem to suggest it wasn’t possible to do via automation/scripts. Is that right?

:man_shrugging:

Not sure I don’t use it, just remembered the topic from the other day.

thanks let me try it out.

Do you know what poster might means by “send events” in this description?

It looks quite simple - you just have to send a bunch of events like this, with your entity id (which should be already created in system), state value, and last_updated timestamp.

   event_data:
     entity_id: sensor.3c71bf4822b8_i2saccoef
     new_state:
       entity_id: sensor.3c71bf4822b8_i2saccoef
       state: "1.4"
       last_updated: "2022-07-25T23:00:25.082925+00:00"```

Ask them in the other topic.

1 Like