I am a zero new guy to YAML
I would like to change the Button Icon (3 possibilities) based on Binary Sensor Inputs:
Can you please help me put these two pieces of code together
You have a button with an associated switch which has TWO states.
And you need to show THREE icons dependingly on 2 binary sensors.
Is there any connection between these switch & sensors?
THANK YOU FOR HELPING OUT!Its the old garage door thing. The button is auto-shutoff in the shelly hardware (so i don’t treat it as a momentary in HA). The momentary switch cycles through 3 states (open->stop->close). The Door can be closed, in-between or open; hence the 3 icons. One binary sensor shows full closed or other, the second binary shows full open or other. Too add a bit more: say the door is stopped at 1/2 open, i want my alert icon to show. Now I hit the button again, door starts moving (could be up or down {simply the opposite direction before it stopped [either by hitting a limit switch (which will trip a binary) or hitting the HA button]}. Anyway we left off in the example door was stopped 1/2 open, icon shows alert anytime its not fully open or fully closed, hit the HA button, door starts moving. HA will still show alert until the door stops fully open or fully closed.
This logic also allows HA to track the door when someone uses the hardwired buttons.
I have not seen this integration for garage doors and it makes sense to me. I use binary inputs tied to my physical limit switches (3 states; but you don’t actually know for several seconds if the door is moving or stopped;; which I can live with).
Sorry for long explanation.
I have 8 doors, so keeping track of all of them would be great!
Thank you! BTW, I was just reading about templates when you answered me.
From my code above:
The button is ‘switch.shellyplus1_441793a3c398_switch_0’ it uses the auto-turnoff feature in shelly after 30s
The door closed sensor is ‘binary_sensor.shellyplusi4_d4d4da7e242c_input_0_input’
The door open sensor is ‘binary_sensor.shellyplusi4_d4d4da7e242c_input_1_input’
The 3 possibility would be not open and not closed.
I got a mushroom-template version working (below) but would still like to learn how to do it without mushroom.