I have set up an input_boolean using the Helper, and have an Automation based on it & it works fine. But within the Lovelace Entity Card I want to change the state from showing Off / On to Yes / No - how might I acheive this?
Also, how would I get the mdi: icon to change colour (blue > yellow > blue) to reflect the change of state? Currently it is always blue.
The input_select.postbox_state_2 that I created (see below) doesn’t work within Lovelace, although my input_boolean.postbox_state does work, albeit with Off/On and not Yes/No, and no icon colour change despite using hass:mailbox instead of mdi:mailbox. Where might I have gone wrong here? Do I need to somehow associate Off with Yes and On with No? That would seem logical to me, but can’t see where I would do so.
If I point a Lovelace Entity Card to binary_sensor.mailbox_pir_motion the colour of the icon changes from blue to yellow for ~10 seconds when I trigger the sensor, then goes back to blue. This is correct & what I would expect. The card is set up to be just a name & an icon, with no “state” showing. See below.
If I point another Lovelace Entity card to input_select.postbox_state_2, before I activate the Hue sensor it says No, with a blue icon. If I then activate the sensor (as confirmed by the first Entity card above), nothing happens with this input_select.postbox_state_2 Card. See below.
I know the Entities Card supports it but I am not so sure about the Entity Card (it’s not mentioned in its documentation). Someone with more Lovelace experience will need to help you with that.
In the second automation you posted, it uses the input_select.select_option service call which specifies the correct target but overlooks to specify the desired state value (Yes or No). You need to add more information:
Many thanks again. I tried loads of combinations, and still couldn’t get it to quite work (but I did discover that an Entities Card does do state_color whereas an Entity Card doesn’t seem to). So I tried using a Condition Card instead, and that does do what I wanted (display when mailbox needs emptying) and it also gets around the problem of changing off/on to yes/no at the same time.
I now have it so that
the top left “button” (see below) turns yellow every movement for ~10 seconds (driven by the Hue integration)
the middle Entities Card changes colour very time movement is detected and stays changed until the next event (but waits 20 seconds each time to prevent multiple actions).
the lower Condition Card only shows when the state is on. I will now change the text to be more useful
I will move the Entities Card to an Admin tab, so that I can change the state manually if I ever need to.
So, via a slightly roundabout way I have got it to do what I wanted - but couldn’t have without the help from here. Thank You again!
Did the example I posted, showing how to set the input_select to either Yes or No, fail to work? This topic’s original question is how to change an input_boolean’s state to Yes/No but that’s not possible whereas it is for an input_select.