I'm unable to make device_class work in cover template.
First - i tried to create a cover with device class garage thru ESPHome => it is known in HA as a standard shutter
Then - I tried to create the same cover with device class directly thru HA in my cover.yaml ( where there is all my covers. It's not an ESPHome file) => same issue
so i think the problem is HA side ( or user side) but not specifically ESPHome side
Environment
I have never tried to do that before this 0.115.3 release
i also post the yaml of my ESPHome config... nevermind...
substitutions:
friendly_name: Porte Garage
esphome:
name: porte
platform: ESP8266
board: esp01_1m
wifi:
ssid: !secret ssid
password: !secret ssid_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "THE Fallback Hotspot"
password: "THE PASSWORD"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
password: !secret api_password
ota:
password: !secret api_password
id : my_ota
# Le 24 V n'est pas comme dans la notice de la porte. Il est sur le PP Gauche et le Stop Droit
# il est nécessaire d'uploader fichier .yaml (le firmware) quand on crée les switch et autres. Pour ca, passer par le addon ESPHOME
# The door contact sensor that is attached to SW on the
# Shelly 1. Not exposed to HA, instead used to set the
# state of the cover.
binary_sensor:
- platform: gpio
pin: GPIO5
name: "Garage Door Contact Sensor"
id: contact_sensor
filters:
- invert:
# The relay in the Shelly 1 that will deliver the pulse to
# the garage door opener (not exposed to HA)
switch:
- platform: gpio
pin: GPIO4
name: "Garage Door Relay"
id: relay
# This creates the actual garage door in HA. The state is based
# on the contact sensor. Opening/closing the garage door simply
# turns the relay on/off with a 0.5s delay in between.
cover:
- platform: template
device_class: garage
name: "Garage Door"
id: template_cov
lambda: |-
if (id(contact_sensor).state) {
return COVER_OPEN;
} else {
return COVER_CLOSED;
}
open_action:
- switch.turn_on: relay
- delay: 0.5s
- switch.turn_off: relay
close_action:
- switch.turn_on: relay
- delay: 0.5s
- switch.turn_off: relay
The problem
I'm unable to make device_class work in cover template. First - i tried to create a cover with device class garage thru ESPHome => it is known in HA as a standard shutter Then - I tried to create the same cover with device class directly thru HA in my cover.yaml ( where there is all my covers. It's not an ESPHome file) => same issue so i think the problem is HA side ( or user side) but not specifically ESPHome side
Environment
I have never tried to do that before this 0.115.3 release
Problem-relevant
configuration.yaml
i also post the yaml of my ESPHome config... nevermind...
Traceback/Error logs
return in lovelace :
Additional information