Change Device Class from binary_sensor to switch

Hey
This is actually my first post here so I really appreciate the help from you.

I have bought this one
https://www.zigbee2mqtt.io/devices/SA100.html

And of course implemented into home assistant through zigbee2mqtt.

The siren appears as binary sensor.
How to change the device_class to a switch or a work-around?

Ludvig,
Based on that link my guess is that you are seeing the alarm indicator as the binary sensor. There is probably another way to set the mode. Have you checked to see if there are any other controls (that might be hidden) or configuration options in the device info page?
-David

1 Like

This is what it looks like of the device, there is nothing hidden that helps me :frowning:

Regarding the cofiguration it looks like this with some pages. Something interesting?


The implication from the link you posted is that z2m cannot set the alarm state, which is why it is configured as a binary sensor rather than a switch. What is it you’re wanting to achieve by converting it to a switch? If it’s to then turn it on/off from HA, that doesn’t (currently) look possible with this device and z2m.

I would like to use it as a siren, as an alarm in the integration Alarmo.

So if the door is opened when away-mode is activated the siren will scare them away :slight_smile:

You need to create an mqtt switch that publishes to this topic:

Warning (composite)

Can be set by publishing to zigbee2mqtt/FRIENDLY_NAME/set with payload {"warning": {"mode": VALUE, "level": VALUE, "strobe_level": VALUE, "strobe": VALUE, "strobe_duty_cycle": VALUE, "duration": VALUE}}

  • mode (enum): Mode of the warning (sound effect) allowed values: stop, burglar, fire, emergency, police_panic, fire_panic, emergency_panic
  • level (enum): Sound level allowed values: low, medium, high, very_high
  • strobe_level (enum): Intensity of the strobe allowed values: low, medium, high, very_high
  • strobe (binary): Turn on/off the strobe (light) during warning allowed values: true or false
  • strobe_duty_cycle (numeric): Length of the flash cycle max value is 10
  • duration (numeric): Duration in seconds of the alarm unit is s

https://www.zigbee2mqtt.io/devices/SA100.html#warning-composite

Hello Tom!

Thank you for you support, I’m a quite noob in Home Assistant.
Right now my config looks like below, and I got several av warning,
Could you write down the config? I see that I’m missing the actual entity: binary_sensor.siren_alarm

Skärmavbild 2023-02-20 kl. 10.14.23

This is what it looks like right now.
But still it doesn’t work. I see the switch but it’s unavailable.

Ideas?

Hi,
did you get it to work?
I tried similar as you did but the switch states unavailable.