Hi, I have a entity (sensor.t_h_sensor_temperatura) and want to send the data using mqtt to another mqtt (Venus OS). The payload must be like this:
{“grid”: { “power”: x.x } }
x.x is the value of temperature of the sensor (sensor.t_h_sensor_temperatura) as I’m really noob I don’t know how to extract the value of temperature from the entity to put it in the payload.
Thanks
i’d do an automation, triggered by a change in sensor status, calling the mqtt publish service and filling the payload with needed information
try and see
Thanks, I know the way to do (I can send a number) but missing the detail, the temperature is in sensor.t_h_sensor_temperatura and I don’t know how to extract the value.
First one delivers this {“grid”: { “power”: states(‘sensor.t_h_sensor_temperatura’) } } as a text not the value inside sensor.t_h_sensor_temperatura.
Second one a error:
Error: TemplateError: TemplateSyntaxError: Encountered unknown tag ‘endraw’. rendering template, template: ‘{%raw %}{“grid”: { “power”:{% endraw %} states(“sensor.t_h_sensor_temperatura”) {% endraw }} }’ and payload: None