Energy display wrong valueat 00:00

Hello
I am trying to use the energy feature
I am running HA 2021.09;0

A python program write the electricity consommation in a InfluxDB V2 database
Using grafana I can display the graph of the daily consommation, that means that the values stored in influxdb are correct.

I have defined a sensor to retrieve the data from influxdb :

- platform: influxdb
  api_version: 2
  ssl: false
  host: "192.168.1.104"
  port: 8086
  organization: "25ecb6f683ea145d"
  token: "pDXVnztbFANSK2SHeUXsVsTCjnDFzhkFrKxc6j0bJiVM98SmZH_jEAMKvGRHgnQN6Hc2YzyQp3gURP7LhuWQhw=="
  bucket: 'EDF'
  queries_flux:
    - group_function: last
      name: "EDF_Conso"
      query: >
          filter(fn: (r) => r._measurement == "linky" and r._field == "conso")
      range_start: "-1d"

then I have defined these sensors :

utility_meter:
  yearly_energy:
    source: sensor.edf_conso
    cycle: yearly
  monthly_energy:
    source: sensor.edf_conso
    cycle: monthly
  daily_energy:
    source: sensor.edf_conso
    cycle: daily

and :

  - platform: template
    sensors:
      
      monthly_energy_kwh:
        unique_id: teleinfomoisconsokwh
        friendly_name: Consommation electricité du mois
        unit_of_measurement: kWh
        device_class: energy
        value_template: "{{ (states('sensor.monthly_energy')|float / 1000) | round(1) }}"
      yearly_energy_kwh:
        unique_id: teleinfoanneeconsokwh
        friendly_name: Consommation electricité de l'année
        unit_of_measurement: kWh
        device_class: energy
        value_template: "{{ (states('sensor.yearly_energy')|float / 1000) | round(1) }}"
template:
  - sensor:
      - name: EDF_daily_conso
        unique_id: teleinfojourconsokwh
        state: "{{ states('sensor.daily_energy') | float / 1000 | round(1) }}"
        unit_of_measurement: "kWh"
        state_class: measurement
        device_class: energy
        attributes:         
          last_reset: '1970-01-01T00:00:00+00:00'

in the energy configuration I have add tje EDF_daily_conso

but when I display the energy tab, I got this graph :

I don’t understand the data at 00:00 ?? it should be zero, this is the starting of the day ?

the rest of the graph is correct

this is the data of EDF_daily_conso :

but the value is wrong, it says 22,27 Kwh, in fact the real conso is around 7 Kwh

there is something wrong, but I cannot find it

thanks for any help

Upgrade to 2021.9.6. There is a fix included for this.

Also for your energy sensors the state classes should be:

state_class: total_increasing

And this is no longer valid, remove it:

        attributes:         
          last_reset: '1970-01-01T00:00:00+00:00'

I have the same issue… Im running the following versions:
Core-2021.12.6
supervisor-2021.12.2
Home Assistant OS 7.0

My graph looks like this: (i first thought this might be a timezone issue… So i changed my timezone from UTC to UTC+1 but the graph still looks the same).