I did update my previous answer. I made a mistake with your example (wrong entity_index). I posted the defininition I have used now including screenshots. I can switch my light and it updates immediately.
Question 1:
Does the state displayed change from on to off? As this reacts to the same update as the icon shouldâŚ
Question 2:
Is you icon the same as the primary text color (probably white or black)? Or does it display the expected color, but not real-time, but only after hitting F5?
What browser are you using?
Question 3:
Do you have any error in the hass log? Or if you are using Chrome and check the inspector (right mouse button, â Inspector, or ctrl-shift-I), do you see errors?
Yes the state is changing when the icon is clicked. I confirmed with Developer/States
Yes the icon displays correctly when using F5. Yes the icon is black and white. Since I am not using a theme, these should be my primary text colors.
I am using Chrome but also have the same issue on the IOS app
I do not see any errors in the logs or inspector.
Not sure it is matters but the switch is a value template created switch. I donât have any lights defined.
Template sensors have a history of not updating, itâs even a breaking change.
And the breaking architectural change:
I have no idea of course if your template falls into this category, but I wonder if you manually call the homeassistant.update_entity_service if the icon does change!
I think it has to do with how the animation and entity state are compared in the card.
In the set hass(hass) function, you will find the following line of code:
// if animation state not equals sensor state, return... Nothing to animate for this state...
if (!(this.entities[entityIndex].state === item.state)) return;
Can you replace the triple â===â with â==â ??
so:
if (!(this.entities[entityIndex].state == item.state)) return;
Then save, and ctrl-F5 in the browser to force reloading the card.
Can you give me the switch template? I have no templates in my configuration, so canât test with templates. If I can adapt your template for my config, I might be able to reproduce the problem
Ok new question for a great new card.
I have been playing with it and have tried to make a few things.
Here is what I want to do.
I have 15 XIOAMI (temp/humidity/pressure) sensors in my house.
Question 1, If using the card 4 example how would I display all the cards on a single page. Do I need to replicate the entire code for all 15 sensors?
Question 2, where I live up until a few days ago the temps were averaging 105 to 110 F for the last 3 months. I would like the display to show a blue color from 45 to 68, green from 69 to 82, and red from 83 to 95. Is this possible. If it is I can not seem to make it work.
Just released 0.8.2. Mainly a maintenance release with some small changes.
@daphatty, this version has an extra show option. Requirements havenât changed for the card
@daconrad0, if added some case insensitive compares. No idea if that fixes your icon, but you can give it a try of course. I still canât replicate what youâre seeing with the icon animation.
That is where Iâm using card 4 for: the xiaomi sensors in the rooms!
Yes, you need a card per sensor. Normally, that would be done using a decluttering template. In that template you use card 4 for layout and colors, and in the view you only pass the entities and attributes to the template. This keeps you view very compact.
Iâm using zigbee2mqtt for my Xiaomi sensors. This gives me these three sensors:
Thank you for the response.
Lets start with what I understand what you said. I am good with the colorstop information.
I understand the concept of what you said but do not understand how to implement it.
For example if my lovelace for this is called house_temps.yaml what do I enter?
Then do I need another yaml file to contain what you call view.yaml.
If an example can be posted that would be good for me.
thanks
carltonb
Were you referring to scale_tickmarks:? If so, that option doesnât seem to remove the horseshoe. In fact, scale_tickmarks: doesnât seem to do anything at all in my test card.
Edit: I should clarify, using scale_tickmarks: with any value (true or false) would display the tickmarks in my test card. Removing scale_tickmarks: from the YAML subsequently hid the tickmarks from my test card.