macxq / foxess-ha

Home Assistant & FoxESS integration. Monitor you photovoltaic installation directly from HA ☀️ ⚡️
104 stars 36 forks source link

Unexpected Device Class #238

Open Sivivatu opened 2 months ago

Sivivatu commented 2 months ago

Describe the bug In my Energy Dashboard configuration I am getting the error:

Unexpected device class
The following entities do not have the expected device class:
sensor.foxess_pv1_sum

This means my energy dashboard is not showing any solar production.

My yaml config for the integration is below and the devices used on the energy dashboard are the integration platform sensors:

  - platform: integration
    source: sensor.foxess_pv1_power
    name: foxess_pv1_sum
    unit_time: h
    round: 2
  - platform: integration
    source: sensor.foxess_pv2_power
    name: foxess_pv2_sum
    unit_time: h
    round: 2

# Setup Daily and Realtime solar trackers that resolve the negative solar tracking
utility_meter:
  daily_pv1_sum:
    source: sensor.foxess_pv1_sum
    cycle: daily
  daily_pv2_sum:
    source: sensor.foxess_pv2_sum
    cycle: daily

# Setup Daily and real-time solar trackers that resolve the negative solar tracking
template:
  - sensor:
      - name: "Solar Power Daily"
        unit_of_measurement: "kWh"
        state: "{{ states('sensor.daily_pv1_sum') | float }}"
        # device_class: power

      - name: "Solar Power Now"
        unit_of_measurement: "kW"
        state: "{{ states('sensor.foxess_pv1_power') | float }}"
        # device_class: power

Expected behavior The integrated sums should (and were previously) populate the solar production dashboards

Screenshots If applicable, add screenshots to help explain your problem. image

Debug logs:

HA version: Core 2024.4.3 Supervisor 2024.04.0 Operating System 12.2 Frontend 20240404.2

foxess-ha version: v0.39

FozzieUK commented 2 months ago

Your yaml code looks correct, and the pv1/2 sensors the integration is providing have their device_class set correctly to ‘power’.

I’m wondering if your home assistant storage has had a problem - you can check that in HA if you go to ‘Developer Tools’ and click the ‘STATISTICS’ tab, look for pv1_sum and pv2_sum in the list and is there a ‘FIX ISSUE’ highlighted, if so click it and can you post what it says.