flixlix / energy-flow-card-plus

An upgraded Energy Distribution Card for Home Assistant, with added features like Individual Devices and refined UI enhancements, while maintaining the Energy Dashboard's original design.
157 stars 8 forks source link

solar-entity shows no state after an mistake by myself #136

Open jove01 opened 3 months ago

jove01 commented 3 months ago

Describe the bug I had defined a template sensor and put it in solar-entity. There I saw, that I have done a mistake. So I deleted the sensor an defined a new one with the same name.

Than I deleted the old entry in solar-entity and saw there is no state. After that I saw the old and the new sensor in statistics. There I deleted als the old one and restarted HA.

But after that in solar-entity is no value. In all other cards after that created for testing with this sensor I see a value.

So I think somewhere ist the old UUID (o.ä) intern saved.

The errors occurs in different browsers an the android-version.

All Updates are the newest.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

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

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

Please make sure all of this applies and check the checkboxes, by writing "X" inside of them.

jove01 commented 3 months ago

Maybe I found the reason: It is not possible to use 2 solar-entity. So I defined 1 and added my to solar-entities

`    - name: "Daily PV-Ertrag"
      unique_id: daily_pv_ertrag
      device_class: energy
      state_class: measurement
      unit_of_measurement: kWh
      state: >-
        {% if states('sensor.daily_pv_generation') == 'unavailable' or
          states('sensor.tp_stecker_pv_heutiger_verbrauch') == 'unavailable'
          %}
          {{ states('sensor.daily_pv_ertrag') }}
        {% else %}
        {{ 
        states('sensor.daily_pv_generation')| float(0) + 
        states('sensor.tp_stecker_pv_heutiger_verbrauch')| float(0)
        }}
        {% endif %}`

I think the state_class "measurement" is not allowed!

But what is the way to define 1 solar-sensor as "sum" of 2?