I had some kind of a warning appear the other day saying something about templates changing or something?
It suggested I change my garage door cover template in the configuration.yaml with a pre suggested option and now my garage door state shows as unknown and will not operate via the Shelly switch I use. I’ve tried playing around with it for an hour or so with no luck. Just wondering if anyone could help me out please? Also, sorry if I am posting in the wrong section of the forum, I just signed up to the forums to ask for help, it tells me there is 4 errors with the template
Below is my old template configuration, will post the new one below that:
I’ve just started playing around with templates in HA, so this doesn’t affect me…and I can’t answer any template questions. I’ve been following this thread and just wanted to share the link in case you haven’t seen it:
The all caps “GARAGE” caught my attention! But, being new to templates, I wasn’t sure that it was an issue…so I didn’t feel “qualified” to point it out. Still learning
Edited: I think I remember reading about ‘device_class’ all caps in the 800+ posts Deprecation thread…
I have the exact same situation, as I use the Shelly’s for my garage doors and created the cover exactly like you did. Have you found any resolution? for the depreciated cover?
No, I haven’t. I gave up and I have purchased an athom esp 32 based controller for my garage door which doesn’t require manually making the template (it needs to be flashed with esphome). I don’t have the time to stuff around withe the template anymore and I need something to work for my wife when she takes our daughter for a walk so she doesn’t have to take her keys.
The shelly will not work without the cover being exactly right so it is useless to me now
I was playing around this week trying to figure out a way to bypass the cover. I’ve come to find that really the only thing I absolutely need it for is to pass it through to HomeKit so I can open and close the garage on my phone. I did find a way to create another button in Lovelace that doesn’t use the cover.
I can make another button that doesn’t use the cover but I like to have the cover as a quick identifier to know if it is opened or closed without having to check my security cameras plus it is easier for my wife to also see if it is opened or closed with the cover. I found I had to use the actual switch input of the shelly without the cover to toggle it but it will just show an on or off state, off for when the dry contact is idle and on for a split second when triggered which isn’t ideal for the setup I’m going for
So I went through and edited the template to resolve in my instance. My template was the same as the OP. Below is what I did in configuration.yaml. I hop this helps others who may be in the same boat as the OP and I.
- sensor:
- name: "Single Garage"
state: >
{% if is_state('binary_sensor.single_sensor', 'on') and is_state('switch.single_garage', 'on') %}
opening
{% elif is_state('binary_sensor.single_sensor', 'off') and is_state('switch.single_garage', 'on') %}
closing
{% elif is_state('binary_sensor.single_sensor', 'off') %}
open
{% else %}
closed
{% endif %}
- cover:
- device_class: garage
open_cover:
- condition: state
entity_id:
- sensor.single_garage
state: closed
match: all
- target:
entity_id:
- switch.single_garage
action: switch.toggle
close_cover:
- condition: state
entity_id:
- sensor.single_garage
state: open
match: all
- target:
entity_id:
- switch.single_garage
action: switch.toggle
stop_cover:
- target:
entity_id:
- switch.single_garage
action: switch.toggle
default_entity_id: cover.single_garage
icon: "{% if is_state('cover.single_garage', 'opening') or is_state('cover.single_garage', 'closing') %}\n
mdi:garage-alert\n
{% elif is_state('cover.single_garage', 'open')%}\n
mdi:garage-open\n
{% else %}\n
mdi:garage\n
{% endif %}"
name: Single Garage Door
state: '{{ states(''sensor.single_garage'') }}'