rkowalik
(Rafal)
September 8, 2022, 10:30am
1
I want to set device_class: door in mqtt / binary_sensor but it doesn’t recognize device_class and I don’t have the door icon:
My connfig:
mqtt:
binary_sensor:
- unique_id: toilet_door
friendly_name: "Toilet door"
state_topic: "bridge / tele / RESULT"
value_template: "{{value_json.RfReceived.Data}}"
payload_off: "70CC67"
payload_on: "70CC6E"
device_class: door
qos: 1
Troon
(Troon)
September 8, 2022, 10:48am
2
Docs say it should work. Your indentation is out, though: binary_sensor:
should be two spaces right. Does the sensor work, just without the icon?
I have MQTT binary sensors with working device classes (plug
, motion
and battery_charging
).
rkowalik
(Rafal)
September 8, 2022, 10:52am
3
Sesor works, but icon don’t.
Troon
(Troon)
September 8, 2022, 10:55am
4
Have you restarted, or at least reloaded MQTT entities?
rkowalik
(Rafal)
September 8, 2022, 10:55am
5
Could you show yours configuration of mqtt / binary sensor?
Troon
(Troon)
September 8, 2022, 10:58am
7
configuration.yaml
:
mqtt:
sensor: !include_dir_merge_list mqtt/sensors
binary_sensor: !include_dir_merge_list mqtt/binary_sensors
switch: !include_dir_merge_list mqtt/switches
mqtt/binary_sensors/misc.yaml
:
- name: kitchen_motion
state_topic: "fully/event/onMotion/REDACTED"
payload_on: '{"type":"visual","deviceId":"REDACTED","event":"onMotion"}'
off_delay: 5
device_class: motion
1 Like
Troon
(Troon)
September 8, 2022, 11:00am
8
Does the device_class
show on the states screen? For the above sensor:
rkowalik
(Rafal)
September 8, 2022, 11:04am
9
configuration.yaml
:
mqtt: !include_dir_merge_list includes/mqtt/
mqtt/kerui.yaml:
binary_sensor:
- unique_id: toilet_door
friendly_name: "Toilet door"
state_topic: "bridge/tele/RESULT"
value_template: "{{ value_json.RfReceived.Data }}"
payload_off: "70CC67"
payload_on: "70CC6E"
device_class: door
qos: 1
- unique_id: front_door
friendly_name: "Front door test"
state_topic: "bridge/tele/RESULT"
value_template: "{{ value_json.RfReceived.Data }}"
payload_off: "49A067"
payload_on: "49A06E"
device_class: window
qos: 1
- unique_id: bathroom_door
friendly_name: "Bathroom door"
state_topic: "bridge/tele/RESULT"
value_template: "{{ value_json.RfReceived.Data }}"
payload_off: "C85467"
payload_on: "C8546E"
device_class: door
qos: 1
Troon
(Troon)
September 8, 2022, 11:32am
11
Hmmm, running out of ideas here. Are you running a recent version of HA? Anything in the logs? Are you sure your unique_id
s aren’t replicated elsewhere?
Your configuration.yaml
refers to the folder includes/mqtt
but you didn’t include includes/
in your kerui.yaml
reference above. Was that just an omission, or is it possible you’re editing a file that HA isn’t reading?