Shelly change button type

I would like to create a switch in Home Assistant which would in turn change the button type string value of a Shelly 1 device.

I really have no clue how to proceed, some pointers would be great.

The Shelly 1 is tied to the door bell and this would turn on or off the door bell button.

If the switch on the dashboard is set to off, I would like that HA sets shelly.Relay0.ButtonType = “detached”
If the dashboard switch is turned on, shelly.Relay0.ButtonType = “toggle”


See the code in the first post.

1 Like