I have configure my sonoff bridge with tasmota firmware and am using a sonoff PIR to trigger when there is motion by the Gate. the problem am experiencing is any PIR or door contact triggered the automation. see the conf below.
This is because you use the mqtt topic as a trigger, so any time something is published on this topic, the automation gets triggered.
You already created a binary sensor for the motion at the gate, so use this as your trigger.
Something like this:
- id: '1573536619878'
alias: Send notification when motion detected by the Gate
description: ''
trigger:
- platform: state
entity_id: binary_sensor.gate_pir
from: "off"
to: "on"
condition: []
action:
- data:
message: Motion has been detect by the gate!
service: telegram_bot.send_message
- alias: ''
data:
data:
type: tts
message: Motion has been detect by the gate!
target:
- group.alexa
- Living Room
- media_player.alexa
- G090U34584470SD8
service: notify.alexa_media_alexa
When i remove mqtt and add binary sensor nothing happen
- id: '1573536619878'
alias: Send notification when motion detected by the Gate
description: ''
trigger:
- entity_id: binary_sensor.gate_pir
platform: state
to: 'on'
condition: []
action:
- data:
message: Motion has been detect by the gate!
service: telegram_bot.send_message
- alias: ''
data:
data:
type: tts
message: Motion has been detect by the gate!
target:
- group.alexa
- Living Room
- media_player.alexa
- G090U34584470SD8
service: notify.alexa_media_alexa