#Dashboard graph for live streaming instant power number ?

1 messages · Page 1 of 1 (latest)

tough gulch
#

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.

solid finch
#

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.

vivid robin
#

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.

https://community.home-assistant.io/t/energy-custom-graph-a-custom-card-trying-to-fill-the-gap-in-the-energy-dashboard/948412

summer pewter
#

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.

vivid robin
# summer pewter > The problem is, that HA doesn't provide streaming of history events in a way t...

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. 😉

vivid robin
#

Ok, I also found history/stream now after looking at the code of hui-history-graph.
Might be even better.