I’m trying to do an automation to receive a value in HA via MQTT and then send it to my car.
I can do a set value but not the actual value in the message.
You will need to use a template that gets the value from the trigger variable. The precise template needed depends on the how the MQTT payload is structured. If you can share that, we can tell you what the template should be.
You can find the complete trigger variable object in the automation’s debug Trace, in the “Changed variables” tab near the bottom.
- id: '1775574983400'
alias: New automation
description: ''
triggers:
- trigger: mqtt
options:
topic: skoda/chargeLimit
conditions: []
actions:
- device_id: xxxxxxxxxxxxxxxxx
domain: number
entity_id: xxxxxxxxxxxxxxxxxxxxxxx
type: set_value
value: "{{ trigger.payload | int }}"
mode: single
FWIW, unless you need the ability to change the value from the frontend, it would likely be better to set this up as a standard MQTT sensor or a trigger-based template sensor.
You’ll need to check the “Changed variables” tab toward the bottom of the automation Trace to see the actual structure of the payload being received, then we can help you figure out what changes need to be made.