Awtrix mqtt custom app update sensor value

Hi all,
I can publish my own app to the display. I wonder what would be the right way to udpate sensor data. Sould it be possible that the awtrix firmware subscribes to a data stream and updates the value?

In this example co2 sensor value is pushed one but never updated. The display cyles through my old data every so often.

service: mqtt.publish
data:
  topic: awtrix_05161c/custom/co2
  retain: false
  payload:
    '{"text": "{{states.sensor.indoor_co2.state}} ppm","icon": "co2"}'

You should use “payload_template” instead of “payload”.

thanks but this also only sends the initial value… so maybe the client can not even listen to a topic and I have to push all changes?

You could try and create an automation which triggers every time the sensor changes value. Something like:

mode: single
trigger:
  - platform: state
    entity_id:
      - sensor.indoor_co2
condition: []
action:
  - service: mqtt.publish
etc.
1 Like

Im starting to use awtrix and sending sensor values throw MQTT but facing the same problem as you when creating a custom app, values not updating at all.
Using payload template is not working for me also.
Did you found a solution for that?

1 Like