Help with getting Temperature into a Dashboard

I’m following a Lewis video tutorial to add a light into the Dashboard and to have the tempurature unit it for that room, but nothing seems to come up or work.

I have got the correct entity from within HA and is working ok.

Even then Button is un responsive and no clues on doing a Dashboard at all this is my first attemt and failing badly :slight_smile:

{{state (`sensor.kitchen_tempurature_temperature`) }}

that is the code I have added into the Secondary information

Not sure if teh code is correct either would also be nice to know where I can get a better understanding of this code too.

Should this be:

{{ states('sensor.kitchen_tempurature_temperature') }}

In addition to an s on the end of states, you also need basic quote marks.

1 Like

Brilliant thank you ! Also when I posted it it formated it wrong too only thing I had missed was the S onto the States :slight_smile: Rest of my code was good to go but its easily done with code to miss it! Thanks!

Also why are the buttons not working yet or do I need to do more for them to start to work? Has in the video hes are working right away but mine are doing nothing!

Could you provide all the YAML for your card. (Click on SHOW CODE EDITOR at the bottom to show this.)

Its all in section so not sure how to get all of the code, bu tthis is the Dashboard and I have addedd code for one part of it

type: horizontal-stack
cards:
  - type: custom:mushroom-light-card
    entity: light.kitchen_light_bulbs
    name: Kitchen
    icon: mdi:knife
    tap_action:
      action: navigate
      navigation_path: kitchen
    hold_action:
      action: toggle
    show_color_control: false
    show_color_temp_control: false
    collapsible_controls: false
    use_light_color: true
  - type: custom:mushroom-template-card
    primary: Kitchen Leds
    secondary: '{{ states(''sensor.kitchen_tempurature_temperature'') }} °c'
    icon: mdi:chef-hat
    tap_action:
      action: navigate
      navigation_path: kitchenleds
    entity: light.kitchen_led_1
    icon_color: ''
    hold_action:
      action: toggle
    fill_container: false
    multiline_secondary: false

Sure that the id is spelled correctly?

Yes its correcly spelt in the section where to add it but on the code editor its changing the code differently not sure why? And should I correct its mistakes?

Do you mean the quotes? That’s ugly but normal in frontend.
What result do you get when copying


{{ states('sensor.kitchen_tempurature_temperature') }}

into Developer Tools —> Template?

yes, when I copy it to past to you it changes so the code is correct really :slight_smile:
But its also turning the other icons light on and not the one Im asking too! Not sure why Toggle needs to be on but if toggle is not on no press on the button works.

I’m new to this so I might need to do other things for it to all start working as it should but it does not seem correct already!

On the video I posted you will see when I long press on the first button the light comes on in hose but no light on the icon! Then when I do the middle one the light on the icon comes on on the first one which is totaly not right :slight_smile: :man_shrugging:

Dashboard Not correctly working

Ok, I didn’t notice that it’s no longer about the initial temperature issue, but about toggling the lights…

First: In the video one can see 3 horizontal cards, names are cut off. Your code above provides 2 cards. So I can only guess.
„Kitchen“ is a light group. If one of the group members is on the icon is colored. Normal behaviour. If you don’t want that configure the light group and set it to all.

Second: You have no color defined in the template card.

Sorry yes sorry had issues with this as well as I had with the Temp. which is now resolved for the Tempurture my apploigies!

The first icon is a Horizontal Stack - Mushroom Light Card card and no where to set the colour as I can see but Im no expert on this.

Second icon is a template card which Colour is set in it. third icon is anothe Light card and again colour set it it!

No glue as of yet what will do what!

No offense, but don’t post pictures of your code, always use the cog wheel icon in the editor window —> preformatted text. Otherwise it’s hard to help.

Your color template is missing a closing bracket. And - normally - the state is on, not ON.

Sorry no offence taken! :slight_smile: how I find it better for me to see the full code in a picture I’ve dyslexia why I make so many mistakes! :slight_smile: So I will try to post both preformatted text code and a pic in furture for my references too! :slight_smile:

Not toatly sure which braket you meen the () or the {} but on taking another guess I have done this code, which is still not doing it correctly.

So not sure if the spaces make a difference where the colour is? or sothing else causing all lthe icon lights to come on now.

I will add all code for each section and a video to show you how the icon lights are not working on there own!

light
There is no code added to it at all!

Kitch

{% if is_state('light.kitchen_light_bulbs','on')%}
 orange
{% endif %}

Livin

{% if is_state('light.kitchen_light_bulbs','on')%}
 blue
{% endif %}

My Not working Dashboard

I have now figured why the lights coming on the icon where wrong I had but the wrong entity in for living room and had added the one for the kitchen!

So All working now thanks!

Home Assistant - Dashboard Color Icon Lights on - Off

{% if is_state('light.living_room_leds','on')%}
 blue
{% endif %}

{% if is_state('light.kitchen_light_bulbs','on')%}
 orange
{% endif %}

Important information! Thank you.

That would be great!

For further reference: The functions of the individual cards are described in detail here: Mushroom Cards