-
-
Save cablesky/50f14a940b925c99e802492ab252fac5 to your computer and use it in GitHub Desktop.
clear-mqtt-from-HA
This file contains hidden or 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
automation: | |
- alias: clear_mqtt_topic | |
initial_state: 'on' | |
trigger: | |
- platform: state | |
entity_id: | |
- input_text.clear_mqtt_topic | |
condition: | |
- condition: template | |
value_template: "{{ 'homeassistant/sensor/' in states.input_text.clear_mqtt_topic.state }}" | |
action: | |
- service: mqtt.publish | |
data_template: | |
topic: "{{ states.input_text.clear_mqtt_topic.state }}" | |
retain: true | |
input_text: | |
clear_mqtt_topic: | |
name: MQTT Topic to Clear | |
mode: text | |
initial: '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment