This is from this this issue on github. Right now, there are a lot fields you can put in the MQTT template light template values like brightness, red, green, blue, etc. But - those values might not actually set any value into the payload depending on what is going on. For example I tried to do this:
- platform: mqtt_template
command_topic: "test/light2/bright"
command_on_template: "{{ brightness|d }}"
command_off_template: "0"
brightness_command_topic: "test/light2/result/bright"
brightness_template: "{{ value }}"
Which I thought would send the brightness value as the on command. But, if you click the on button, an empty payload is sent because the brightness value is never set into the template parameters in the Python code. It’s only available when actually changing the brightness. I feel like if I say to put the brightness in the template, it should do that.
So this is a question for current users of the MQTT template light: if I file an issue on this and submit a fix, is that going to cause anyone any problems? Basically, the change is having the code make all the template values available in all the topics all the time. If you’re not using them, then nothing is different. The difference would appear if you’re currently relying on the behavior that the value is empty/not set at some times.