Fibaro smoke sensor notification

Tags: #<Tag:0x00007fc3fff6b600> #<Tag:0x00007fc3fff6b538>

Hi,

I present to you my smoke alarm blueprint. It is made for Fibaro smoke sensors in zwaveJS but could work for others. It also is based on my notification script. This script just needs these parameters: who, title, message and url for action.

(You can find my notifications script here: GitLab)

Hope it is useful to someone :slight_smile:

(You can find my french article about it here)

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Blueprint

blueprint:
  name: Fibaro Smoke alarm
  description: Sends a notification via the notification engine if there is an alarm
  domain: automation
  
  input:
    smoke_sensor:
      name: Fire sensor
      description: The smoke sensor that will be used to detect fire
      selector:
        entity:
          device_class: smoke

    smoke_sensor_tamper:
      name: Tamper sensor
      description: Select a tamper sensor to be alerted when the sensor is removed from it's place
      selector:
        entity:
          device_class: safety

    smoke_sensor_test:
      name: Capteur de test
      description: Select a test sensor to be alerted when the sensor is tested
      selector:
        entity:
          device_class: problem

    notif_engine_script:
      name: Notification engine script
      selector:
        entity:
          domain: script

    critical_notif_engine_script:
      name: Critical notification engine script
      selector:
        entity:
          domain: script
    
    script_if_fire: 
      name: Script to execute when an alarm is sent
      selector:
        entity:
          domain: script

    message_content:
      name: Notification message
      description: Message to send when there is fire
      default: "Un incendie est détecté: Vérifiez les informations et appelez le 144"

    message_content_tamper:
      name: Notification message
      description: Message to send when a sensor is removed
      default: "Un capteur incendie à été enlevé"

    message_content_test:
      name: Notification message
      description: Message to send when a sensor is tested
      default: "Le capteur incendie à été testé"

    message_content_default:
      name: Notification message
      description: Default message if something triggers but we don't know what for a reason
      default: "Il s'est passé quelques chose, vérifiez!"

    sensor_page_url:
      name: Lovelace sensor page
      description: Lovelace page to link to
      default: "/lovelace/main"
  
trigger:
- platform: state
  entity_id: !input smoke_sensor
  to: 'on'
- platform: state
  entity_id: !input smoke_sensor_tamper
  to: 'on'
- platform: state
  entity_id: !input smoke_sensor_test
  to: 'on'
condition: []
action:
  - choose:
    - conditions:
        - condition: state
          entity_id: !input smoke_sensor
          state: 'on'
      sequence:
        - service: !input script_if_fire
        - service: script.notification_engine_critical
          data:
            who: family_app
            title: Smoke alarm!
            message: !input message_content
            url: !input sensor_page_url
    - conditions:
        - condition: state
          entity_id: !input smoke_sensor_tamper
          state: 'on'
      sequence:
        - service: script.notification_engine
          data:
            who: family_app
            title: Smoke sensor removed!
            message: !input message_content_tamper
            url: !input sensor_page_url
    - conditions:
        - condition: state
          entity_id: !input smoke_sensor_test
          state: 'on'
      sequence:
        - service: script.notification_engine
          data:
            who: family_app
            title: Smoke sensor tested!
            message: !input message_content_test
            url: !input sensor_page_url
    default: 
      - service: !input script_if_fire
      - service: script.notification_engine_critical
        data:
          who: family_app
          title: Smoke alarm (undefined)!
          message: !input message_content_default
          url: !input sensor_page_url
4 Likes

Hi @irgusite
Nice Blueprint!

How do I expand this blueprint to include several sensors?
I have 5 smoke detectors in total and would like the notification to be send if ANY of the smoke sensors fire.

  • Thomas

Hi

I personally use 1 blueprint per sensor to have a notification with the sensor location/informations that I think useful for the sensor.

Nevertheless, I know you can use the device class to select multiple sensors to track, but as I have never used it, I don’t know how to modify it to suit that. If anyone has an idea I’m open to modify the blueprint to accommodate for that :slight_smile:

1 Like

Thanks for the automation blueprint.

Is it possible to create an automation without running scripts? Seems like you’d want either actions in the automation or a script, not both.

Thanks :slight_smile:

edit; my bad, should’ve read the first post properly :laughing:

New issue;

I can’t seem to get HA to accept the scripts in YAML. I just get Message malformed: extra keys not allowed @ data['notification_engine_critical']

Seems the same for notification engine too. I’ve tried formatting myself, and it passes in a YAML checker, but no joy in HA :frowning:

@rickydg show me your yaml, without it I cannot know what you did ^^ the blueprint should work as it is on my instance ^^.