0

I have zigbee2mqtt and home assistant in use. I have paired multiple door sensor via zigbee, some of them are used on windows, some of them on doors.

Now I am trying to override in configuration.yaml file the device_class from door to window but it is not working as expected.

I found this documentation for exposing a switch as a light, and this works:

devices:
 '0x12345678':
 friendly_name: my_switch
 homeassistant:
 switch:
 type: light
 object_id: light
 light:
 name: null
 value_template: null
 state_value_template: '{{ value_json.state }}'

I tried an analogue approach to change door to window, but it has no effect. Is that even possible? If so, what would be the yaml config for it?

asked Jun 13, 2025 at 23:52

1 Answer 1

1

I found a workaround solution, not exactly what I wanted, but it does the trick.

Instead of changing the device type in z2m, you can change it in home assistant by involving the customize.yaml file in configuration.yaml like this:

# configuration.yaml
homeassistant:
 customize: !include customize.yaml
# customize.yaml
binary_sensor.window_basement_sensor:
 device_class: window

It would be nicer from the arc. point of view to keep the hardware configuration in z2m and the functionality in home assistant. Anyway, my top most goal was to have a sustainable yaml configuration, so at least this is met.

answered Jun 14, 2025 at 6:44
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.