Hi,
I’m totaly noobie with coding, so can someone help me with few things:
-
how can I give state for sensor like “armed” or “disarmed”
-
how to use boolean_senso as a variable? is there any easier way? I want to use it to show state in UI and also to control some stuff in yaml code
binary_sensor:
alarm_activated:
value_template: "{{states.input_boolean.alarm_activated.state == 'on'}}"
friendly_name: 'Alarm ACTIVATED'
input_boolean:
alarm_activated:
name: 'Alarm ACTIVATED'
automation:
- alias: 'Alarm ACTIVATION'
trigger:
- platform: state
entity_id: binary_sensor.sensor_1_0
state: 'on'
condition:
- condition: state
entity_id: alarm_control_panel.homealarm
state: armed_away
action:
- service: alarm_control_panel.alarm_trigger
entity_id: alarm_control_panel.homealarm
- service: input_boolean.turn_on
entity_id: input_boolean.alarm_activated