lovelace-mushroom icon indicating copy to clipboard operation
lovelace-mushroom copied to clipboard

[Bug]: Mushroom entities disappear

Open iendicott opened this issue 9 months ago • 0 comments

Requirements

  • [X] I checked the troubleshooting section in the README to verify that I have the latest Mushroom version.
  • [X] I did a search to see if there is a similar issue or if a pull request is open.
  • [X] I have read the state of card mod support (in pin issues) and understand card mod support is not provided in this repository.

Current Behavior

I have a default dashboard that has a mixture of Button Cards and Mushroom Cards. Lateley I've noticed that the Mushroom Cards are randomly not displaying. When I click on a different dashboard (I have 3) the Mushroom Cards return.

Issue screenshot problem

Normal screenshot normal

Expected Behavior

No response

Steps To Reproduce

Create a dashboard with a mixture of various Button Cards and Mushroom Cards.

Context

YAML state

type: custom:stack-in-card
card_mod:
  style: |
    ha-card {
      background: none;
      border: none;
    }
mode: vertical
cards:
  - type: custom:stack-in-card
    card_mod:
      style: |
        ha-card {
          background: none;
          border: none;
        }
    mode: horizontal
    cards:
      - type: custom:mushroom-template-card
        card_mod:
          style: |
            ha-card {
              background: none;
              border: none;
            }
        entity: sensor.sunsynk_logger_daily_pv_power_kwh
        primary: Day Total / Est. Total
        icon: >-
          {% if states('sensor.sunsynk_logger_daily_pv_power_kwh')|round(1) == 0
          %}
            mdi:cancel
          {% elif states('sensor.sunsynk_logger_daily_pv_power_kwh')|round(1) >
          0 %}
            mdi:sun-wireless
          {% endif %}
        icon_color: |-
          {% if states(entity)|int == 0 %}
            #ff0000
          {% elif states(entity)|int <= 2 %}
            #fb5600
          {% elif states(entity)|int <= 4 %}
            #ee8200
          {% elif states(entity)|int <= 6 %}
            #d7a700
          {% elif states(entity)|int <= 8 %}
            #b6c700
          {% elif states(entity)|int <= 10 %}
            #86e400
          {% elif states(entity)|int > 10 %}
            #00ff00
          {% endif %}
        secondary: >-
          {{ '%.2f' | 
          format((states('sensor.sunsynk_logger_daily_pv_power_kwh')) |
          round(2)) }} kWh / {{ '%.2f' | 
          format((states('sensor.solcast_pv_forecast_forecast_today')) |
          round(2)) }} kWh
        tap_action:
          action: none
      - type: custom:mushroom-template-card
        card_mod:
          style: |
            ha-card {
              background: none;
              border: none;
            }
        entity: sensor.sunsynk_logger_battery_output_power
        primary: Solar Battery Status
        secondary: >-
          {% if states('sensor.sunsynk_logger_battery_output_power')|int <=
          -1000 %} 
            {{ '%.2f' | format (( states(entity)| int(0) | abs /1000 ))}} kW Charging
          {% elif states('sensor.sunsynk_logger_battery_output_power')|int < 0
          %}
            {{ states(entity)| int(0) | abs }} W Charging
          {% elif states('sensor.sunsynk_logger_battery_output_power')|int == 0
          %}
            {{ states(entity)| int(0) | abs }} Battery Holding 
          {% elif states('sensor.sunsynk_logger_battery_output_power')|int >=
          1000 %}
            {{ '%.2f' | format (( states(entity)| int(0) | abs /1000 ))}} kW Discharging 
          {% elif states(entity)|int >0 %}
            {{ states(entity)| int(0) | abs }} W Discharging 
          {% endif %}
        icon: mdi:lightning-bolt
        icon_color: |-
          {% if states(entity)|int < 0 %}
            #4CAF50
          {% elif states(entity)|int == 0 %}
            blue
          {% elif states(entity)|int > 0 %}
            #ff0000
          {% endif %}
        badge_icon: >-
          {% if states('sensor.sunsynk_logger_battery_output_power')|int <=
          -1000 %}
            mdi:arrow-down-bold
          {% elif states('sensor.sunsynk_logger_battery_output_power')|int < 0
          %}
            mdi:arrow-down-bold
          {% elif states('sensor.sunsynk_logger_battery_output_power')|int == 0
          %}
            mdi:equal
          {% elif states('sensor.sunsynk_logger_battery_output_power')|int >=
          1000 %}
            mdi:arrow-up-bold
          {% elif states(entity)|int >0 %}
            mdi:arrow-up-bold
          {% endif %}
        badge_color: >-
          {% if states('sensor.sunsynk_logger_battery_output_power')|int <=
          -1000 %}
            green
          {% elif states('sensor.sunsynk_logger_battery_output_power')|int < 0
          %}
            green
          {% elif states('sensor.sunsynk_logger_battery_output_power')|int == 0
          %}
            green
          {% elif states('sensor.sunsynk_logger_battery_output_power')|int >=
          1000 %}
            #ff0000
          {% elif states(entity)|int >0 %}
            #ff0000
          {% endif %}
        tap_action:
          action: none
  - type: custom:stack-in-card
    card_mod:
      style: |
        ha-card {
          background: none;
          border: none;
        }
    mode: horizontal
    cards:
      - type: custom:mushroom-template-card
        card_mod:
          style: |
            ha-card {
              background: none;
              border: none;
            }
        entity: sensor.electricity_power
        primary: Live Export / Total Export
        icon: |-
          {% if states(entity)|int >= 0 %}
            mdi:cancel
          {% elif states(entity)|int < 0 %}
            mdi:transmission-tower-export
          {% endif %}
        icon_color: |-
          {% if states(entity)|int >= 0 %}
            #808080
          {% elif states(entity)|int >= -6000 %}
            #4CAF50
          {% endif %}
        secondary: |-
          {% if states(entity)| int < -999 %}
            {{ '%.2f' | format((states(entity))|int | abs /1000 )}} kW / {{'%.2f' | format((states('sensor.myenergi_chez_endicott_grid_export_today'))|float )}} kWh
          {% elif states(entity)|int < 0 %}
            {{ states(entity)| int | abs }} W / {{'%.2f' | format((states('sensor.myenergi_chez_endicott_grid_export_today')) |float )}} kWh
          {% elif states(entity)|int >= 0 %}
            0 W / {{'%.2f' | format((states('sensor.myenergi_chez_endicott_grid_export_today'))|float )}} kWh
          {% endif %}
        tap_action:
          action: none
      - type: custom:mushroom-template-card
        card_mod:
          style: |
            ha-card {
              background: none;
              border: none;
            }
        entity: sensor.solcast_pv_forecast_forecast_tomorrow
        primary: Est. Solar Tomorrow
        secondary: >
          {{ states('sensor.solcast_pv_forecast_forecast_tomorrow') |round(2)}}
          kWh
        tap_action:
          action: navigate
          navigation_path: /chez-endicott/solar-battery
        icon: mdi:sun-wireless
        icon_color: |-
          {% if states(entity)|int <= 1 %}
            #ff0000
          {% elif states(entity)|int <= 2 %}
            #fe4000
          {% elif states(entity)|int <= 3 %}
            #fa6000
          {% elif states(entity)|int <= 4 %}
            #f27a00
          {% elif states(entity)|int <= 5 %}
            #e79100
          {% elif states(entity)|int <= 6 %}
            #d9a600
          {% elif states(entity)|int <= 7 %}
            #c8ba00
          {% elif states(entity)|int <= 8 %}
            #b3cd00
          {% elif states(entity)|int <= 9 %}
            #98de00
          {% elif states(entity)|int <= 10 %}
            #75ef00
          {% elif states(entity)|int > 10 %}
            #37ff00           
          {% endif %}
  - type: custom:stack-in-card
    card_mod:
      style: |
        ha-card {
          background: none;
          border: none;
        }
    mode: horizontal
    cards:
      - type: custom:mushroom-template-card
        card_mod:
          style: |
            ha-card {
              background: none;
              border: none;
            }
        entity: sensor.sunsynk_logger_essential_power
        primary: Home Demand
        icon: mdi:flash
        icon_color: |-
          {% if states(entity)|int <= 500 %}
            #4CAF50 
          {% elif states(entity)|int <= 2000 %}
            #FF5E00
          {% else %}
            #F44336
          {% endif %}
        badge_icon: |-
          {% if states(entity)|int < 4500 %}
            mdi:check
          {% elif states(entity)|int >= 4500 %}
            mdi:alert
          {% endif %}
        badge_color: |-
          {% if states(entity)|int < 4500  %}
            green
          {% elif states(entity)|int >= 4500 %}
            #ff0000
          {% endif %}
        secondary: |-
          {% if states(entity)|int < 1000 %}
            {{ states(entity)|int }} W
          {% elif states(entity)|int >= 1000 %}
            {{ '%.2f' | format((states('sensor.sunsynk_logger_essential_power'))|int /1000 | round()) }} kW
          {% endif %}
        tap_action:
          action: none
      - type: custom:mushroom-template-card
        card_mod:
          style: |
            ha-card {
              background: none;
              border: none;
            }
        entity: sensor.electricity_power
        primary: Live Grid Feed / Cost
        icon: mdi:flash
        icon_color: |-
          {% if states(entity)|int < 500 %}
            #4CAF50
          {% else %}
            #ff0000
          {% endif %}
        secondary: |-
          {% if states(entity)|int < 0 %}
            0 W / £0.00
          {% elif states(entity)|int < 1000 %}
            {{ states(entity)|int }} W / £{{ '%.2f'| format((states('sensor.current_grid_cost'))|round(2))}}
          {% elif states(entity)|int >= 1000 %}
            {{ '%.2f' | format((states(entity))|int /1000 | round()) }} kWh / £{{ '%.2f'| format((states('sensor.current_grid_cost'))|round(2))}}
          {% endif %}
        tap_action:
          action: none
  - type: custom:stack-in-card
    card_mod:
      style: |
        ha-card {
          background: none ;
          border: none;
        }
    mode: horizontal
    cards:
      - type: custom:stack-in-card
        card_mod:
          style: |
            ha-card {
              background: none ;
              border: none;
            }
        mode: horizontal
        cards:
          - type: custom:mushroom-template-card
            card_mod:
              style: |
                ha-card {
                  background: none ;
                  border: none;
                }
            entity: sensor.downstairs_hive_hvac
            primary: Downstairs heating
            secondary: |-
              {% if states(entity) == 'idle' %}
                Idle / Currently {{ states('sensor.downstairs_current_temp')}} °C
              {% elif states(entity) == 'heating' %}
                Heating / Currently {{ states('sensor.downstairs_current_temp')}} °C
              {% endif %}
            tap_action:
              action: null
            icon: |-
              {% set value = states(entity) %} 
              {% if value == 'heating' %}
                mdi:hvac
              {% elif value == 'idle' %}
                mdi:hvac-off
              {% endif %}
            icon_color: |-
              {% set value = states(entity) %} 
              {% if value == 'heating' %}
                #EC4163
              {% elif value == 'idle' %}
                #808080
              {% endif %}
          - type: custom:mushroom-template-card
            card_mod:
              style: |
                ha-card {
                  background: none ;
                  border: none;
                }
            entity: sensor.upstairs_hive_hvac
            primary: Upstairs heating
            secondary: |-
              {% if states(entity) == 'idle' %}
                Idle / Currently {{ states('sensor.upstairs_current_temp')}} °C
              {% elif states(entity) == 'heating' %}
                Heating / Currently {{ states('sensor.upstairs_current_temp')}} °C
              {% endif %}
            tap_action:
              action: null
            icon: |-
              {% set value = states(entity) %}
              {% if value == 'heating' %}
                mdi:hvac
              {% elif value == 'idle' %}
                mdi:hvac-off
              {% endif %}
            icon_color: |-
              {% set value = states(entity) %}
              {% if value == 'heating' %}
                #EC4163
              {% elif value == 'idle' %}
                #808080
              {% endif %}
  - type: custom:stack-in-card
    card_mod:
      style: |
        ha-card {
          background: none;
          border: none;
        }
    mode: horizontal
    cards:
      - type: custom:mushroom-template-card
        card_mod:
          style: |
            ha-card {
              background: none;
              border: none;
            }
        entity: binary_sensor.esphome_web_15d1d0_garage_entry_door
        icon: |-
          {% set value = states(entity) %}
          {% if value != 'off' %}
            mdi:garage-open-variant
          {% elif value == 'off' %}
            mdi:garage-variant
          {% endif %}
        icon_color: |-
          {% set value = states(entity) %}
          {% if value != 'off' %}
            red
          {% elif value == 'off' %}
            green
          {% endif %}
        primary: Garage Door
        secondary: |-
          {% if states(entity) == "off" %}
            Closed
          {% elif states(entity) != "off" %}
            Open
          {% endif %}
        tap_action:
          action: more-info
      - type: custom:mushroom-template-card
        card_mod:
          style: |
            ha-card {
              background: none ;
              border: none;
            }
        entity: sensor.garage_sensor_temperature
        primary: Garage Stats
        secondary: >-
          Temp {{ states('sensor.garage_sensor_temperature') }} °C  / RH {{
          states("sensor.garage_sensor_humidity")}} %   
        tap_action:
          action: null
        icon: mdi:temperature-celsius
        icon_color: |-
          {% set value = states(entity) %}
          {% if value| int >= 25 %}
            #ff0000
          {% elif value| int >= 20 %}
            #bf0040
          {% elif value| int >= 15 %}
            #800080
           {% elif value| int >= 5 %}
            #4000bf
           {% elif value| int < 5 %}
            #0000ff
          {% endif %}
        badge_icon: |-
          {% if states(entity)|int >= 25 %}
            mdi:alert
          {% elif states(entity)|int >= 5 %}
            mdi:check
          {% elif states(entity)|int < 5 %}
            mdi:alert
          {% endif %}
        badge_color: |-
          {% if states(entity)|int >= 25 %}
            #ff0000
          {% elif states(entity)|int >= 5 %}
            green
          {% elif states(entity)|int < 5 %}
            #ff0000
          {% endif %}
  - type: custom:stack-in-card
    card_mod:
      style: |
        ha-card {
          background: none;
          border: none;
        }
    mode: horizontal
    cards:
      - type: custom:mushroom-template-card
        card_mod:
          style: |
            ha-card {
              background: none;
              border: none;
            }
        entity: sensor.myenergi_zappi_power_ct_internal_load
        primary: Zappi Output / Total
        icon: mdi:car-electric
        icon_color: |-
          {% if states(entity)|int >= 1 %}
            red
          {% elif states(entity)|int == 0 %}
            green
          {% endif %}
        secondary: |-
          {% if states(entity) >= '1' %}
             {{ '%.2f' | format((states(entity))|int /1000 | round()) }} kW / {{ '%.2f' | format((states('sensor.myenergi_zappi_energy_used_today'))|float ) }} kWh
          {% elif states(entity) == '0' %}
            Idle {{ '%.2f' | format((states(entity))|int /1000 | round()) }} kW / {{ '%.2f' | format((states('sensor.myenergi_zappi_energy_used_today'))|float ) }} kWh
          {% endif %}
        badge_icon: |-
          {% if states(entity) >= '1' %}
            mdi:arrow-down-bold
          {% endif %}
        badge_color: |-
          {% if states(entity) == '0' %}
            green
          {% elif states(entity) >= '1' %}
            red
          {% endif %}
        tap_action:
          action: none

Environment

- Browser: Chrome \ Home Assistant App
- HA Version: 2024.5.2
- Mushroom: V3.5.4

Anything else?

No response

iendicott avatar May 10 '24 08:05 iendicott