-
My configuration YAML is this relevant section:
However, when i call the Can you tell me how this is supposed to work? I'm working on another automation and trying to figure out how to use |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
In this example, you don't need to send the action at all - simply updating the state of If you want to force an update, you could use an action to update the sensor value, If you want to expose an action to HA for manual updating (like, from something other than a sensor), then the older-fashioned way to do this would be to put this api section back in. It has a similar convert lambda in it. I used this method along with an automation for over a year, but recently moved to the newer example, with no automation, and it works much better, honestly, with fewer moving parts to maintain. # Enable Home Assistant API
api:
encryption:
key: !secret api_key
services:
- service: set_remote_temperature
variables:
temperature: float
then:
# Select between the C version and the F version
# - lambda: 'id(hp).set_remote_temperature(temperature);'
- lambda: 'id(hp).set_remote_temperature((temperature - 32.0) * (5.0 / 9.0));'
- service: use_internal_temperature
then:
- lambda: 'id(hp).set_remote_temperature(0);' |
Beta Was this translation helpful? Give feedback.
-
Oh, that's right, didn't recognize the same name. ;) On that topic I think there is something else going on with the underlying hardware or settings, I don't think a workaround like the automation firing manually every 20 minutes should really be needed, though as a short-term workaround I suppose it is fine. In that case then the api section is what you'd need. For a year and a half or so I had an automation that would trigger on a change in numeric state of the temp sensor OR every 5 minutes. The condition was that the state of the sensor was numeric (not unknown or unavailable). The action was the set_remote_temp action. It worked fine, but required me to maintain 5 automations. The sensor method ends up being cleaner. |
Beta Was this translation helpful? Give feedback.
-
The answer was address by @jontires in his reply here: What I needed to do what add F to C conversion in the |
Beta Was this translation helpful? Give feedback.
The answer was address by @jontires in his reply here:
#176 (reply in thread)
What I needed to do what add F to C conversion in the
api
section. The automation works and now am gettign the temperature keep alive always sending and keeping the things working