As part of an auomtation for a Xiaomi Wireless Switch I’d like to raise the temperature by one degree in my Sensibo Climate controller, I’d be glad to receive some directions on how can I set the temperature to (+1) from the current one
@francesco.fabbro.89 I’m sure you’ve figured this out by now, but for the others who are looking in the forums for the answer, your example needs to use ‘data_template’, and your template must be in quotation marks:
I also don’t see the need to round the temperature to the nearest integer. My thermostat can do 1/2 degrees, so I’d use this similar template instead. If yours only does whole degrees, then stick with what you have.
I’m not sure what causes this sometimes, but I’m betting it’s the lovelace thermostat card. Sometimes I’ll get the MQTT temperature command but with 22.000000003 in the payload instead of just 22.0. My thermostat is not that precise
@anon15118449
Not sure if you are interested but for completeness : -
I say there is an issue with the round function but both Phil and petro say it’s an epislon numerical error not strictly limited to round() but that round() just makes it more apparent.
Instead use a text formatting function to nail this little bugger into place
some but not all values in the same group of inclusion ‘temperature’@ data[]
Any advice? I’m wondering if I can save the template and call that value in the automation? Would helpers work here? I have also tried setting up this as a script that’s called, but the script errors in the same way.
Then switch to edit in yaml, and replace the temperature with this code (from the advice above), I didn’t need to create a script, it works directly in the automation.
Thanks to all the great input in this post, I have my automation working to increase / decrease the temp by voice command. However I’d like to take this one step further.
I currently have the conversation response set to state “lowered (or raised) target temperature by 1 degree”. Does anybody know a way to customize the conversation response to reply with the resulting temperature setting? For example, if I tell HA to increase the temperature by one degree, I want it to tell me that the thermostat is now set to 68 degrees.
Should have waited another 15 minutes before posting. I got it working!!!
- set_conversation_response: >-
target temperature has been set to
{{(state_attr('climate.upstairs_thermostat' ,
'temperature')|round(0))}}
enabled: true
Error loading /config/configuration.yaml: while parsing a flow mapping
at column 21
expected ‘,’ or ‘}’, but got ‘scalar’
at column 80
My thermostat can do 1/2 degrees.