However, when i try to set_value of a text entity, the template gets sent literally, instead of being evaluated. My template gets evaluated just fine, if I were to send a notification with the current temperature.
Please find below my minimal (non-)working example:
In above code I use “42/2” instead of my actual sensor to simplify further.
The code produces a correct value for the notification of ‘21’, but pushes literally ‘{{ 42/2 }}’ to the heater, instead of evaluating it as a template.
What am I doing wrong? If templates are not supported on text.set_value, then how to achive the above (otherwise very simple) functionality?
Thanks a lot for your help, sorry for the presumably noob question. Read all the docs I found, i am at the end of my rope.
Possible with an entity action (other actions / perform action), not with a device action. It’s the action that’s not supporting it, not the service. Avoid using device stuff as much as possible.
Here’s the entity equivalent — substitute in your real entity id, which will look like text.something not that hex string nonsense.
Yes. The heater needs a temperature set at least every 15 mins, or it reverts back to estimating room temperature. I have no guarentee that the sensor will update so often.
Thanks for going the extra mile!
I do need to add a condition though, to check for a validity of the sensor temperature, since sending ‘unknown’ to the heater gets translated as 0.0 °C. Sending nothing if the sensor is offline will have the heater estimate the temperature - which is the desired behavior, and imo justifies the need to use time pattern. Will do that next.