Graph for 30 days

Hi.
I have one sensor that tell me today used energy. How can i make graph contain 30 day (mayble only 15). I want one bar per day. Every bar must cointan this sensor for different day but at 23:59 a clock

This and more would be trivial if you use Influxdb and Grafana, both has plugins for Hassio.


Other option is to create a new sensor from your existing used_energy sensor at midnight with an automation

- alias: record cumulative powergen to midnight
  initial_state: 'on'
  trigger:
  - platform: time
    at: '23:59:00'
  action:
    service: mqtt.publish
    data_template:
      topic: home/power/generation/date_prior
      retain: true
      payload: '{"day_1":"{{states.sensor.energy_generation.state}}"}'

and use the new_sensor along with MiniGraph Card in bar-chart mode to get this:
mini_graph

Limitation of this method is that you can only get graph for number of days the history is kept(By default I guess 12 days).
Hope this helps

1 Like