I ended up calling mine smoke alarm 1 & smoke alarm 2 since when I paired them I wasn’t sure where I was putting them.
Since then I put one in my livinroom and one in my basement.
Here is the code for displaying the status of the detectors in the UI and for sending me notifications on an alarm if I’m not home.
sensor:
platform: template
sensors:
basement_smoke_alarm_status:
friendly_name: 'Basement Smoke Alarm Status'
value_template: >-
{% if is_state("sensor.smoke_co_alarm_1_alarm_level", "255") and is_state("sensor.smoke_co_alarm_1_alarm_type", "1")%}
Smoke!
{% elif is_state("sensor.smoke_co_alarm_1_alarm_level", "255") and is_state("sensor.smoke_co_alarm_1_alarm_type", "2")%}
CO!
{% elif is_state("sensor.smoke_co_alarm_1_alarm_level", "0") and is_state("sensor.smoke_co_alarm_1_alarm_type", "12")%}
Testing
{% else %}
OK
{% endif %}
icon_template: >-
{% if is_state("sensor.smoke_co_alarm_1_alarm_level", "255") and is_state("sensor.smoke_co_alarm_1_alarm_type", "1")%}
mdi:fire
{% elif is_state("sensor.smoke_co_alarm_1_alarm_level", "255") and is_state("sensor.smoke_co_alarm_1_alarm_type", "2")%}
mdi:cloud-outline
{% else %}
mdi:smoke-detector
{% endif %}
livingroom_smoke_alarm_status:
friendly_name: 'Livingroom Smoke Alarm Status'
value_template: >-
{% if is_state("sensor.smoke_co_alarm_2_alarm_level", "255") and is_state("sensor.smoke_co_alarm_2_alarm_type", "1")%}
Smoke!
{% elif is_state("sensor.smoke_co_alarm_2_alarm_level", "255") and is_state("sensor.smoke_co_alarm_2_alarm_type", "2")%}
CO!
{% elif is_state("sensor.smoke_co_alarm_2_alarm_level", "0") and is_state("sensor.smoke_co_alarm_2_alarm_type", "12")%}
Testing
{% else %}
OK
{% endif %}
icon_template: >-
{% if is_state("sensor.smoke_co_alarm_2_alarm_level", "255") and is_state("sensor.smoke_co_alarm_2_alarm_type", "1")%}
mdi:fire
{% elif is_state("sensor.smoke_co_alarm_2_alarm_level", "255") and is_state("sensor.smoke_co_alarm_2_alarm_type", "2")%}
mdi:cloud-outline
{% else %}
mdi:smoke-detector
{% endif %}
automation:
- alias: Notification Smoke Alarm Basement
initial_state: 'off'
trigger:
platform: template
value_template: >
{% if (is_state("sensor.smoke_co_alarm_1_alarm_level", "255") and is_state("sensor.smoke_co_alarm_1_alarm_type", "1"))
or (is_state("sensor.smoke_co_alarm_1_alarm_level", "255") and is_state("sensor.smoke_co_alarm_1_alarm_type", "2"))%}
true
{% else %}
false
{% endif %}
action:
- service: notify.pushbullet_notify
data_template:
message: >
{% if (is_state("sensor.smoke_co_alarm_1_alarm_level", "255") and is_state("sensor.smoke_co_alarm_1_alarm_type", "1")) %}
'Smoke Alarm 1 is Going Off For Smoke!'
{% elif (is_state("sensor.smoke_co_alarm_1_alarm_level", "255") and is_state("sensor.smoke_co_alarm_1_alarm_type", "2")) %}
'Smoke Alarm 1 is Going Off For CO!'
{% endif %}
- alias: Notification Smoke Alarm Livingroom
initial_state: 'off'
trigger:
platform: template
value_template: >
{% if (is_state("sensor.smoke_co_alarm_2_alarm_level", "255") and is_state("sensor.smoke_co_alarm_2_alarm_type", "1"))
or (is_state("sensor.smoke_co_alarm_2_alarm_level", "255") and is_state("sensor.smoke_co_alarm_2_alarm_type", "2"))%}
true
{% else %}
false
{% endif %}
action:
- service: notify.pushbullet_notify
data_template:
message: >
{% if (is_state("sensor.smoke_co_alarm_2_alarm_level", "255") and is_state("sensor.smoke_co_alarm_2_alarm_type", "1")) %}
'Smoke Alarm 2 is Going Off For Smoke!'
{% elif (is_state("sensor.smoke_co_alarm_2_alarm_level", "255") and is_state("sensor.smoke_co_alarm_2_alarm_type", "2")) %}
'Smoke Alarm 2 is Going Off For CO!'
{% endif %}
- alias: Notification Smoke Alarm Testing
initial_state: 'off'
trigger:
- platform: state
entity_id: sensor.basement_smoke_alarm_status
to: 'Testing'
- platform: state
entity_id: sensor.livingroom_smoke_alarm_status
to: 'Testing'
action:
- service: notify.pushbullet_notify
data_template:
message: >
{% if trigger.to_state.entity_id == 'sensor.basement_smoke_alarm_status' %}
'Testing the Basement Smoke Alarm'
{% elif trigger.to_state.entity_id == 'sensor.livingroom_smoke_alarm_status' %}
'Testing the Livingroom Smoke Alarm'
{% endif %}
- alias: Delay Smoke Alarm Notify After Homeassistant Startup
initial_state: 'on'
trigger:
platform: event
event_type: zwave.network_ready
action:
- service: automation.turn_on
entity_id:
- automation.notification_smoke_alarm_basement
- automation.notification_smoke_alarm_livingroom
- automation.notification_smoke_alarm_testing
- alias: Delay Smoke Alarm Notify After Automation Reload
initial_state: 'on'
trigger:
platform: event
event_type: call_service
event_data:
domain: automation
service: reload
action:
- delay: '00:00:10'
- service: automation.trigger
entity_id: automation.delay_smoke_alarm_notify_after_homeassistant_startup
I needed to put the notification delay in after restart or automation reload because I was getting spurious notifications at those times.
I’m not sure if this is what you were asking but it should hopefully help.