Question: How can I, instead of hello or bye give a sensor.xx_yy a string value? E.g. if condition is met, sensor.xx_yy receives value “Hello” and so on.
Sensor is not defined anywhere else, this is where i try to define it and use it then elsewhere.
Or if the approach is not right, how shoulkd it be done?
I basically know how to set up a template sensor, but I seem not to figure out how, in combination with the abovementiuoned if-clause, I could initialize a string (sensor) variable in template
Can you clarify what you are trying to do? Your original template is doing a string comparison, not a datetime object or timestamp comparison. Also, both possible return values are strings…