If I load up the Template Editor in the UI, both templates render just fine.
Guess it would help if I described whatās broken hu?! (thanks @petro)!
When the script gets run, all service entries run, like they should, except the one containing the template, the script literally skips it.
Hmm, it looks good. Turn on logging and watch the home assistant logs and verify that itās not getting called. Check for errors too. When I say watch the logging, iām refering to the home-assistant.log file inside the config directory. Donāt bother looking at the logs in the UI.
Thanks guys, Iāll give both of those a try. Hereās what the templates render to, in the template editor:
ā{{ states(āsensor.thermostat_modeā) }}ā
ā{{ states(āinput_number.sleep_tempā ) |int }}ā
This Works
climate.set_operation_mode
{
āentity_idā: āclimate.bedroomā,
āoperation_modeā: āheatā
}
This Does Not
climate.set_operation_mode
{
āentity_idā: āclimate.bedroomā,
āoperation_modeā: āHeatā
}
As listed above, the template returns āHeatā, not āheatā!
Anyone know the Jinja2 for converting case from upper to lower?
Then again, this also Works! (WTF)
climate.set_temperature
{
āentity_idā: āclimate.bedroomā,
ātemperatureā: ā65ā,
āoperation_modeā: āHeatā
}
Iām convinced there is something wrong with the component, or my specific fan (even though it works fine via the app).
The fan seems to do the specified action in the script, but is randomly and instantly reverted. For instance, I set it to cool, auto, and oscillate (which it did), then via a script I set it to a speed of 2 (and left everything else the same), It switched to 2, then immediately switched back to Auto.
Iām noticing the same behavior with every other version of the scripts Iām throwing at it.
Iāve also tried breaking out climate.set_temperature & climate.set_operation_mode, but the script still skips them, and continues on to dyson.set_night_mode.
If I open the actual component, and set the temp & mode, it works just fine.
Also, if I try and fire the climate.set_temperature & climate.set_operation_mode from Dev/Services, it fails as well (literally nothing happens, no logs, nothing).
Thank you, that was it actually! Thought I was going nuts.
It seems this fan makes 2 different devices. fan.bedroom and climate.bedroom
fan.bedroom controls the fan, and climate.bedroom controls the heating, cooling, temp & operation modes. Wish that was better documented (Maybe Iāll go fix the docs so others donāt get stuck).
My script for turning on the fan works, which is great. But Iāve run into an odd delema.
If you pass a temperature value to climate.set_temperature it automatically sets the operation_mode to heat, no matter if you manually set it to cool or not.
Currently Iām passing the temperature value to the fan as a template from my thermostat sleep temperature. As well as the operation_mode from my thermostat. This way thru out the year, when the script fires the temperature and operation_mode match that of my thermostat.
Works great in the winter, because it turns on the heat. But in the summer it also turns on the heat (even though cool is passed).
Iām wondering if I could use an if statement.
So IF the thermostat_mode is set to heat, call the service climate.set_temperature, with the temperature matching my thermostat temperature, and mode.
Else IF thermostat_mode is set to cool, call climate.set_operation_mode with a mode of cool, and speed of auto.