I’ve got a Xiaomi Honeywell Smoke Detector added to my home assistant.
I’ve made an automation from the UI which looks like this:
- id: '1635939813744'
alias: Fire Detected
description: Send alarm to phone when Fire is detected
trigger:
- platform: state
entity_id: binary_sensor.smoke_detector_1_smoke
from: 'false'
to: 'true'
action:
- event: Smoke detected notify phone
event_data:
service: notify.mobile_app_sm_g988b
data:
message: Fire detected
title: Fire Alarm
data:
ttl: 0
priority: high
channel: alarm_stream_max
mode: single
And it works.
But… On the zigbee2mqtt home page it recommends using the MQTT device trigger. Is there any benefits of using the MQTT device trigger? If so, what would an automation for this smoke detector look like?
I tested with actual smoke I made this automation from the UI, where it gave me the choice of true or false, if I remember correctly.
Anyway, my actual question is if I should make a new automation based on the MQTT device trigger? And if so, why should I use that instead of the one I have? Any benefits?
No it didn’t work… But I can see that for the Smoke state it seems to be true or false. And I guess that is the state which is triggering my automation?
I installed the MQTT explorer and set the smoke value to true, and the automation did not work. The state went from off to on, so I think you are right. I need to change my automation Thank you again for your support Taras.
Being alerted due to the presence of smoke is important and I wanted you to be certain that the automation’s trigger worked properly.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions. For more information, refer to guideline 21 in the FAQ.