So I’ve rigged up my driveway gate remote with a sonoff switch, which I can toggle through HA now, but obviously that doesn’t know the state of the door. I have a door sensor on the gate which shows if it’s open or closed.
Is there a way to create a Cover like card, the one with the up and down arrows to open or close, that uses the information from the door sensor, and activates the sonoff switch when the open or close button is pressed?
Essentially what I think it would have to do is have an open and close button that both just trigger the sonoff switch, but the open button is active(able to press) only when the gate status is closed and the close button is active only when the gate status is open.
Creating something like this is way beyond my knowledge, and I’m only a novice… so, maybe hoping there is a simple solution out there. Thanks!
Ah, yeah nice. Pretty simple! Just set that up, and the only thing I’m not sure about is the value template. In the example it’s using
“{{ states(‘sensor.garage_door’)|float > 0 }}”
I tried using that and just replacing with my door sensor, but my door sensor is a binary sensor(binary_sensor.driveway_gate) and it gives the values of on or off. The configuration variables says that valid values are open/true or closed/false. If I put in my binary sensor into the example line, it doesn’t change the buttons when the gate is opened or closed.
These value template things always confuse me. Any help appreciated!
No, that kicks back this error when I check config:
Invalid config for [cover.template]: invalid template (TemplateSyntaxError: unexpected char ‘‘’ at 11) for dictionary value @ data[‘covers’][‘driveway_gate’][‘value_template’]. Got ‘“{{ states(‘binary_sensor.driveway_gate’) }}”’. (See ?, line ?).