ApexCharts card - A highly customizable graph card

Hello,

I use the Goodwe integration for my solar panels.
This gives me a sensor that displays each day’s total generated that day.
Somehow this often goes wrong and this value does not reset at 00:00.
To solve this problem I write the value to an input number, I reset it every day at 00:00 with an automation.
Then i use a template to display the value of the input number as a sensor.
Template sensor:

- sensor:
    - name: "GW2000_XS_TOTAAL_VERMOGEN_VANDAAG"
      unique_id: 'gw2000_xs_totaal_vermogen_vandaag'
      unit_of_measurement: "kWh"
      state: >
        {{ float(states("input_number.gw2000_xs_totaal_vermogen_vandaag")) }}

This works perfect.
History from the past days in my history. (my recorder records like 3 days)

But now i want to see the data from the past.
I have my solar panels now for 2 years, and my HomeAssistant about a year.
So i needed a DataBase where i can write data from the past in it.
Finally my search ended at influxdb.
So i installed the Community Add-on: InfluxDB
The handy thing is that I can upload my data from the past here by means of a CSV file.
Every day i write the kw’s from this day to the CSV file.
Works fine, with this CSV file i can add history data to my DataBase, and if my DataBase crashes.
I upload the CSV file and the data is back.
I have added my sensor.gw2000_xs_totaal_vermogen_vandaag to InfluxDB.
So it records sensor.gw2000_xs_totaal_vermogen_vandaag sensor in the InfluxDB.
So if i add the data manual, every day will get 1 value, the recording of the sensor.gw2000_xs_totaal_vermogen_vandaag to InfluxDB is “live”. So on 14:00 it will be 2.0kW and on 16:00 it will be 2.6kW.

With this url i can see the data in my browser:

192.168.2.19:8086/query?u=homeassistant&p=homeassistant&db=homeassistant&q=SELECT+max("value")+FROM+"sensor.gw2000_xs_totaal_vermogen_vandaag"+WHERE+("entity_id"+=+'gw2000_xs_totaal_vermogen_vandaag')+GROUP+BY+time(1d)+fill(none)

u= the Username of the user of the database
p= the Password of the user of the databse
db= name of the database
Then i select the max( “value”), so if this day on 14:00 i have 2.0kW and on 16:00 i have 2.6kW, the output is 2.6kW.
And i group this by(1d).
So it gives me the max(“value”) of every day.
See image:

And now is the goal to plot a graph where i can see the monthly values of the solar panels.

I was trying with the rest sensor

rest:
  - authentication: basic
    scan_interval: 90
    resource: http://192.168.2.19:8086/query?u=homeassistant&p=homeassistant&db=homeassistant&q=SELECT+max(%22value%22)+FROM+%22sensor.gw2000_xs_totaal_vermogen_vandaag%22+WHERE+(%22entity_id%22+=+%27gw2000_xs_totaal_vermogen_vandaag%27)+GROUP+BY+time(1d)+fill(none)
    sensor:
      - name: "RestTest6"
        value_template: "OK"
        json_attributes_path: "$.results[0].series[0]"
        json_attributes:
          - values

To get the values.
For now it looks like this:
image

Don’t believe this, i have started my old Raspberry PI.
And with the code i make the graph.
The differents is now that the DB not is on the PI, but on the NUC.
Trying to find the problem now, the PI is only local, maybe there is a problem.

1 Like