Running a smart plug through Tasmota/MQTT into HA, everything works fine control-wise, I'm just hoping to find a way to add a auto-updating/live-streaming line chart of instant power number, and all I can find is time range-based aggregates. I know my plug can update power numbers on at least a 3-second interval, so if I can get that it'll be great.
#Dashboard graph for live streaming instant power number ?
1 messages · Page 1 of 1 (latest)
For a graph, just make a graph. For more graph options, use ApaxCharts or Mini graph card.
For a flow card like in the energy dashboard for energy, use the Power Flow Chart Plus card.
The problem is, that HA doesn't provide streaming of history events in a way that can be easily consumed by custom cards.
You have to poll them using the websocket methods provided.
I created a custom card that might fit your needs.
It can display raw values instead of aggregated values as an alternative, and it has an auto-refresh of 60s for raw signals that can also be adjusted by the user to a shorter interval.
It also re-uses the internal echart instance HA uses by default.
That way it doesn't need to load another large charting framework into the memory and it uses the same look and feel.
Home Assistant Community
OK, this topic has been on my to-do list for a VERY long time. Including an extremely detailed list of features that I wanted, which developed over time in my notes app. (Since the energy dashboard with its date picker was released.) A chart that interacts with the Energy Date Picker uses the HA internal Echart instance without requiring addi...
The problem is, that HA doesn't provide streaming of history events in a way that can be easily consumed by custom cards.
You're sure about this? Custom cards can use all the same APIs as the main frontend. You should be able to subscribe to history.
Maybe I looked at it the wrong way as I just recently added support for RAW data additionally to aggregated values where I seem to have to request data from recorder (which doesn't seem to be possible as streaming over the callWS call).
So maybe I was just thinking too much with my existing request logic in mind.
But you're right, for RAW values it would be simply possible to listen to the current value changes of the entity (which is available as endpoint for sure) and add these data points to the chart.
Thanks for heads-up. 😉
Ok, I also found history/stream now after looking at the code of hui-history-graph.
Might be even better.