DBuit / sidebar-card

406 stars 39 forks source link

Light state #81

Open Marc3l1988 opened 1 year ago

Marc3l1988 commented 1 year ago

When i use your template: sidebar: template: |

  • {% if now().hour < 5 %} Goede nacht {{'\U0001F634'}} {% elif now().hour < 12 %} Goedemorgen {{'\u2615\uFE0F'}} {% elif now().hour < 18 %} Goedenmiddag {{'\U0001F44B\U0001F3FB'}} {% else %} Goedenavond {{'\U0001F44B\U0001F3FB'}}{% endif %}
  • {% if states('sensor.current_lights_on') | float > 0 %} <li>{{states('sensor.current_lights_on')}} lampen aan</li> {% endif %}
    {% if states('sensor.current_media_players_on') | float > 0 %} <li>{{states('sensor.current_media_players_on')}} speakers aan</li> {% endif %}

    The sidebar is empty. When i remove this part: {% if states('sensor.current_lights_on') | float > 0 %}

  • {{states('sensor.current_lights_on')}} lampen aan
  • {% endif %} {% if states('sensor.current_media_players_on') | float > 0 %}
  • {{states('sensor.current_media_players_on')}} speakers aan
  • {% endif %}

    It is working, and it says goodmorning. It seems that the code for the count of the lightning is not correct. :)