I am using self made ESP sensors with MQTT discovery to easily assign them as a device. Everything works flawlessly except one thing - when I want to make discovery script (in HASS), just to have some backup in case of MQTT broker failure, I use following part to change readout of my ESP:
When you remove curly braces the mqtt discovery payload is not treated as value to use afterwards.
I really don’t understand what you are trying to do here.
I just want to create HA script to send MQTT discovery payload AND use value_template to change ESP readout value. (Sometimes you want to adjust some values, especially when testing. It’s handy to have premade MQTT message in HA instead of Python).
And as I said, sending whole payload with MQTT explorer or Python with all curly braces, float(value), and stuff works without problem - the problem is that HA wants to treat plain text as value template, which does not make any sense. There should be just option to use plain text.
Anyway, I’m going to stick with python script then.