Add templates to MQTT climate#11623
Conversation
|
The reason we decided in #9872 to go with JSON instead of casting to string is that attributes can contain more complex data structures, e.g., lists (lights contain RGB tuples as lists, climate devices have mode lists, …) Sure, we could cast lists to string, but that solves this problem exactly for lists, and not arbitrary serializable data types. |
|
Anyway I think we should remove the |
|
Can templates be added/applied to temperature_command_topic as well? Setpoint needs to be multiplied by 100 for my MQTT HVAC. Then read temperature needs to be divided by 100 which the above template addition should take care of that. Thanks, |
Description:
This replaces #11347. The primary use case I have in mind is still the same as over there:
However, providing the possibility to parse payloads via a template is definitely less hacky. I added the possibility to apply one template to all state topics (via
value_template) as well as setting individual templates per state topic.Related issue (if applicable): fixes parts of #10209
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#4407
Example entry for
configuration.yaml(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code does not interact with devices:
toxrun successfully. Your PR cannot be merged unless tests pass