Xiaomi smoke detector

Hi. i just xiaomi smoke detector and xiaomi hub. the thing is, it does not trigger an alarm sound in your phone when it detect smoke. is there a way to make HA execute some kind of alarm ? Thanks. Refael.

I changed my Xiaomi Smoke alarm to zigbee2mqtt. 2 more arrived today and I will add to the group :slight_smile:

I then made an automation when triggered

- alias: Fire alarm trigger on
  trigger:
    platform: state
    entity_id: binary_sensor.0x00158d000276fb05_smoke # down stairs
    to: 'on'
  action:
    - service: script.turn_on
      entity_id: script.fire_alarm
      
- alias: Fire alarm trigger off
  trigger:
    platform: state
    entity_id: binary_sensor.0x00158d000276fb05_smoke # down stairs
    to: 'off'
  action:
    - service: script.turn_off
      entity_id: script.fire_alarm, script.fire_alarm_loop 

with a script that broadcasts an alarm on Google Home

alias: Fire Alarm
    sequence:
      - service: media_player.volume_set
        data:
          entity_id: media_player.kitchen_speaker, media_player.googlehome1023
          volume_level: '0.90'
      - service: tts.google_say
        data:
          entity_id: media_player.kitchen_speaker, media_player.googlehome1023
          message: 'Fire Alarm, Evacuate'
      - delay:
          seconds: 2
      - service: media_player.play_media
        data:
          entity_id: media_player.kitchen_speaker, media_player.googlehome1023
          media_content_id: https://xxxxxxxxxxxx/local/submarine_diving_alarm.mp3
          media_content_type: 'audio/mp3'
      - delay:
          seconds: 1   
      - service: script.turn_on
        data:
          entity_id: script.fire_alarm_loop
    
   
    alias: Fire Alarm loop
    sequence:
      - delay:
          # time for flash light off
          seconds: 2
      - service: script.turn_on
        data:
          entity_id: script.fire_alarm
3 Likes

I like how you did the loop. Saving that one for later :grin:

Thanks a lot ColonelFlag.
Is there something you can go on your phone also?

Thanks
Refael

i also tried this
media_content_id: /local/sounds/submarine-diving-alarm-daniel_simon.mp3

hi, I have an automation with a call to my home alarm and notify to my ios device, works fine

I am using ColonelFlagg’s scripts but getting some errors.
See my script below:

tts_notification:
alias: Fire Alarm
sequence:
  - service: media_player.volume_set
    data:
      entity_id: media_player.office, media_player.living_room, media_player.kitchen, media_player.hallway
      volume_level: '0.90'
  - service: tts.google_say
    data:
      entity_id: media_player.office, media_player.living_room, media_player.kitchen, media_player.hallway
      message: 'Fire Alarm, Evacuate'
  - delay:
      seconds: 2
  - service: media_player.play_media
    data:
      entity_id: media_player.office, media_player.living_room, media_player.kitchen, media_player.hallway
      media_content_id: https://xxxxxxxx:8123/local/security_breach.mp3
      media_content_type: 'audio/mp3'
  - delay:
      seconds: 1   
  - service: script.turn_on
    data:
      entity_id: script.fire_alarm_loop

alias: Fire Alarm loop
sequence:
  - delay:
      # time for flash light off
      seconds: 2
  - service: script.turn_on
    data:
      entity_id: script.fire_alarm

The config validation passes but I see the following errors in the logs:

INFO:homeassistant.util.package:Attempting install of colorlog==4.0.2
Testing configuration at /config
ERROR:homeassistant.util.yaml:YAML file /config/scripts.yaml contains duplicate key "alias". Check lines 1 and 24.
ERROR:homeassistant.util.yaml:YAML file /config/scripts.yaml contains duplicate key "sequence". Check lines 2 and 25    

Please help!

The formatting is probably wrong, try this:

tts_notification:
  alias: Fire Alarm
  sequence:
    - service: media_player.volume_set
      data:
        entity_id: (i'd personally set up a group in groups e.g. group.mediaplayers)
        volume_level: '0.90'

and go on from here :stuck_out_tongue:. I am not entirely sure if your script will work though, but I haven’t played around much with it so I wouldn’t know. But this formatting works for me.

Is it possible to communicate with the smoke alarm via zigbee2mqtt to change the settings? Eg. Sensitivity. AFAIK it has 3 sensitivity settings.

Yes, you can.
You need to publish the sensitivity to the detector.

More info in zigbee2mqtt site.