Greetings.
I have an existing automation, that works fine, but I want to add a condition based on an MQTT payload status.
I’ve read a number of similar posts, and appreciate MQTT payloads are not stored anywhere in HA, so checking the status on an MQTT payload is going to be a challenge.
So what am I trying to do… here’s the current automation:-
alias: Front Door Alert
description: Send alert to Telegram
trigger:
- type: motion
platform: device
device_id: b49dcf843f2922c02695757c28954dbe
entity_id: binary_sensor.frontdoorsensor_occupancy
domain: binary_sensor
condition: []
action:
- service: telegram_bot.send_message
data:
message: Front Door Activity
mode: single
The automation above is triggered from an Ikea Zigbee Tradfri sensor, and sends me a telegram message when movement is detected at the front door.
I want to insert a condition that messages are only sent when I am away from home. And I’d like the condition to be based upon my alarm system being armed i.e. when alarm is armed I am obviously away so send telegram messages when movement is detected.
Here’s the MQTT from my alarm system:-
alias: Honeywell MQTT
description: ""
trigger:
- platform: mqtt
topic: <the alarm topic is here>
payload: Full Set
condition: []
action:
- service: telegram_bot.send_message
data:
message: Alarm Activated
- wait_for_trigger:
- platform: mqtt
topic: <the alarm topic is here>
payload: Unset
- service: telegram_bot.send_message
data:
message: Alarm Deactivated
mode: single
I recall there was an option to set a variable in esphome, but I not sure if such a variable can be set in HA? For example, if I could set a status based upon the MQTT messages from the alarm system, I could have the front door sensor automation check that status before it sends a telegram message.
Clear as mud, right.
Open to suggestions or things I could try.