In developers tools I would like to call mqtt.publish but I cannot find the way how:
{%
if int(states('sensor.pzem_a_power_watts')) < int(states('sensor.pzem_b_power_watts'))
and
(float(states('sensor.a_voltage'))
- float(states('sensor.b_voltage'))) > 1
%}
#this is the pseudo code I need to use
{
- service: mqtt.publish
data:
topic: topic/1
payload: '{"payload_a": 1}'
}
{% else %}
#this is the pseudo code I need to use
- service: mqtt.publish
data:
topic: topic/1
payload: '{"payload_b": 2}'
{% endif %}