Hoping for some assistance in turning my Shelly Plus 1 into a “cover” template in HA.
All the current code I’ve seen for this are using the older shelly which must expose a binary sensor to read status or use custom firmware with ESPHome or MQTT. I’m thinking it should be possible with my current setup as I can already do all I need within HA.
So far I’ve got all the functionality I need within Home Assistant through the use of several automations and helpers, but I would really like to turn it into a complete cover template so I can excpose it to Google Home and use cover automations without a bunch of hacks.
My current setup is a Shelly Plus 1 using low voltage wiring to a dumb garage door. I use a reed switch to get the open / close status on the switch input wiring of the Shelly Plus 1.
Due to how the Shelly works natively, it doesn’t natively expose the reed switch as a binary sensor, but if I change the input type (on the Shelly) to button. It reads “long_push” when the door is open and “single_push” when the door is closed. The actual “switch” setup that toggles garage door opener is set as a momentary on (.5 seconds, then auto turn off) to trigger the garage door opening or closing.
Using this info I created an automation that changes the value of a helper entity “input_select.van_door” to “Open” or “Closed” depending on the push type.
I then created a Glance Item for “input_select.van_door” with a hold_action that toggles “switch.garage_door_van_switch_0” to open or close the door as appropriate.
Here’s my current code, hopefully someone can help me cludge together a proper cover template from this info. I thank you and my WIFE thanks you in advance if we can get this working
Automation to change Closed Garage Door Helper value
alias: Automation - Garage Door Closed Toggle
description: ""
triggers:
- device_id: 001125ba4488f280f9090c937f36da0c
domain: shelly
type: single_push
subtype: button1
trigger: device
conditions: []
actions:
- action: input_select.select_option
metadata: {}
data:
option: Closed
target:
entity_id: input_select.van_door
mode: single
Automation to change Open Garage Door Helper value
alias: Automation - Garage Door Open Toggle
description: ""
triggers:
- device_id: 001125ba4488f280f9090c937f36da0c
domain: shelly
type: long_push
subtype: button1
trigger: device
conditions: []
actions:
- action: input_select.select_option
metadata: {}
data:
option: Open
target:
entity_id: input_select.van_door
mode: single
My “fake” Glance code that (from an auto-entities card) that works as a garage door opener, with correct status
entity_id: input_select.van_door
options:
name: Van Cover
hold_action:
action: call-service
service: switch.toggle
service_data:
entity_id: switch.garage_door_van_switch_0
Probably not useful, but this is how I’m triggering door closure “scene” since it’s not a proper template at this time
alias: Helper - Van Garage Door Scene
description: ""
triggers:
- trigger: state
entity_id:
- scene.porch_lights_off
conditions:
- condition: state
entity_id: input_select.van_door
state: Open
actions:
- type: turn_on
device_id: 001125ba4488f280f9090c937f36da0c
entity_id: e5a7eb0bfd2b12a178829797a83295de
domain: switch
mode: single