Hi, I want to have a device that I can use in my Sharptools dashboard that displays the state of the garage door e.g. open closing closed opening etc as well as being able to click it as a button.
I was thinking that a sensor would be the right option as I can set the states accordingly but I don’t think that is a device and it isn’t clickable (as far as I know). I also looked in the helpers for something to use but couldn’t see anything appropriate. It feels like I want a momentary switch that has a state attribute as well. Is there a way to create custom devices like this?
The end result would be a “thing” that could be added to my Sharptools dashboard that when clicked would show a status of opening until the garage opened and then show a status of open etc.
thanks in advance
The aqara vibration sensor can probably be used as the sensor. But it won’t be able to open the door.
The sensor has (as far as I know) a vibration sensor that could indicate movement perhaps and a tilt sensor that can be used to see if it’s open or closed I guess.
Sorry I wasn’t looking for hardware. I have a Sonoff relay switch that controls the garage. I just want to get a virtual or custom switch in HA that I can export to Sharptools that allows me to both switch it on and off (open/close the garage) and view state data about the open/close/opening/closing state.
Do you have a physical sensor for the garage as well?
It sounds like you’re looking for a virtual garage door device to map your relay (and potentially sensor) to so it looks and acts like a garage door.
Have you tried the Cover Template?
I created a switch template for mine. Not 100% it’s what you’re after, but it works for me:
garage_door_main:
friendly_name: "Main Garage Door Switch"
value_template: "{{ is_state('binary_sensor.garage_door_main','on') }}"
turn_on:
service: cover.open_cover
data:
entity_id: cover.garage_door_main
turn_off:
service: cover.close_cover
data:
entity_id: cover.garage_door_main
icon_template: >-
{% if is_state('cover.garage_door_main', 'open') %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
The above is in my switches.yaml file which is reference from configuration.yaml as so:
switch: !include switches.yaml
Can you make an existing garage door opener smart?
Is it possible to make an older model garage door opener smart? Absolutely! Most older model garage door openers have an option to add a wall control panel / push button which you can use to open or close the garage door. Smart garage door openers can be wired to these push button terminals.
Hi Josh. I have a relay switch that does the actual garage door opening and a door and window sensor that tells me if its actually opened or closed. So yeah I guess I want to combine the 2 hardware devices into one virtual device. Not that familiar with the cover template other than from using it for my blinds. Are you saying that I can create a cover template as a virtual device somehow in HA?
thanks
Yes. There’s a basic example in the main docs, but you might find some of the examples in the community helpful as well:
You would probably want to use the value_template
instead of position_template
if you’re using a binary sensor (open/closed or on/off) and I don’t think you even have to include the icon_template
if you’re using the value_template
.
There’s details about the fields and what’s needed toward the top of that linked page.
Looks good thanks!