I managed to switch the siren on or off via my dashboard using an input boolean helper called input_boolean.rookalarm_schakelaar, an automation and a custom:button-card. See below for details.
The automation: when the input boolean is turned on, the siren turns on.
alias: X - Hal schakelaar rookalarm
description: ""
trigger:
- platform: state
entity_id:
- input_boolean.rookalarm_schakelaar
from: "off"
to: "on"
condition: []
action:
- service: siren.turn_on
data: {}
target:
entity_id: siren.0_hal_rookalarm_siren
mode: single
The (mushroom) button card:
type: custom:button-card
entity: input_boolean.rookalarm_schakelaar
name: Rookalarm hal
icon: mdi:smoke-detector-variant
state_color: true
size: 35px
show_state: true
show_name: false
tap_action:
action: call-service
service: |
[[[
if (entity.state == 'off')
return 'input_boolean.turn_on';
else
return 'input_boolean.turn_off';
]]]
service_data:
entity_id: input_boolean.rookalarm_schakelaar