Since installing 2024.8.0 I have been getting 2 repairs re: mqtt.publish using topic_template and payload_template.
The error tells me to use topic and payload instead.
However, when I do this, Z2M complains of a badly formed message and ignores it. Mean while both topic_template and payload_template work fine (albeit with the 2 repair notices).
The docs still say to use topic_template and payload_template and I am not sure what to do here.
He is the yaml for my script that sends the message:
FWIW, topic and topic_template are equivalent; both support templates. Long ago, there was a difference (the first didnât support templates, the second did).
Use MQTT Explorer to check the value of payload published to topic.
Maybe something is amiss in the latest version because I have always used templates with the payload option.
As an experiment, change the name of the Jinja2 variable to something other than âpayloadâ (so itâs not the same as the payload option for mqtt.publish). For example, use msg.
That did it! - both payload and payload_template work now.
Thanks so much! Iâm kicking myself because I should have spotted that myself, but this highlights what makes this community so great - the friendly extra pairs of eyes (and brain!).
Also got stuck and sorry to say the message I get from the warning is simply not explaining at all about where to locate the issue.
I get 10 warnings coming from
homeassistant/electric/power/⌠or homeassistant/electric/energy/âŚ
all pointing to some payload_template(xx,y) where xx and y are sort of randomn numbers which give me no idea.
Not to mention that Iâ, 100% sure that none of my photovoltaic items, let it be sensors, scripts, automations got any linkage to mqtt at all.
Ok it says itâll work till before 2025.2.0 which is some time till something will fail, but I donât understand why itâs that compilcated to provide a warning message with a more precise hint about where in hell the problem might be located.
Perhaps someone with deeper knowledge could explain about to read the warning and give some guidance about which direction one should dig into the configurations to get it solved in time.