Last active
June 9, 2023 20:53
-
-
Save seamus65/f239a7c981ab346e73a031be5c487d2c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
blueprint: | |
name: FITHomes State change to MQTT | |
description: "FITHomes state change to MQTT. | |
Multiple sensor selection possible" | |
domain: automation | |
input: | |
sensors: | |
name: Sensors | |
description: Sensors | |
selector: | |
entity: | |
multiple: true | |
source_url: https://gist.github.com/seamus65/f239a7c981ab346e73a031be5c487d2c | |
mode: parallel | |
max: 10 | |
trigger: | |
- platform: state | |
entity_id: !input "sensors" | |
condition: [] | |
action: | |
- variables: | |
entity_id: "{{ trigger.entity_id }}" | |
area_id: "{{ area_id(trigger.entity_id) }}" | |
area_name: "{{ area_name(trigger.entity_id) }}" | |
state: "{{ trigger.to_state.state }}" | |
event_type: "{{ trigger.to_state.attributes.device_class }}" | |
timestamp: "{{ trigger.to_state.last_changed }}" | |
- service: mqtt.publish | |
data: | |
qos: "0" | |
retain: true | |
topic: homeassistant/state_changed | |
payload: > | |
{ | |
"entity_id": "{{ entity_id }}", | |
"area_id": "{{ area_id }}", | |
"area_name": "{{ area_name }}", | |
"state": "{{ state }}", | |
"event_type": "{{ event_type }}", | |
"timestamp": "{{ timestamp }}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment