Afterburner forums
HA Automation to update the AB temp sensor via MQTT - Printable Version

+- Afterburner forums (https://mrjones.id.au/afterburner/mybb)
+-- Forum: Afterburner (https://mrjones.id.au/afterburner/mybb/forumdisplay.php?fid=1)
+--- Forum: Home Assistant (https://mrjones.id.au/afterburner/mybb/forumdisplay.php?fid=6)
+--- Thread: HA Automation to update the AB temp sensor via MQTT (/showthread.php?tid=10)



HA Automation to update the AB temp sensor via MQTT - snoOZer - 11-09-2024

After Ray was so kind to help me with the MQTT topic to use to update the temperature from an external sensor I use this automation with HA to update every 20sec from an external sensor I have already in HA.

Code:
alias: "AB Remote Temp"
description: ""
triggers:
  - trigger: time_pattern
    seconds: /20
actions:
  - action: mqtt.publish
    metadata: {}
    data:
      evaluate_payload: false
      qos: 0
      retain: false
      topic: AfterburnerXXXXXX/cmd/TempRemote
      payload: "{{ states('sensor.livingroom_temperature') }}"

sensor.livingroom_temperature is the sensor already in HA which I have chosen to use for the AB. If no update is provided within 30 seconds the AB will use the internal sensor again.