I'm trying to set up automation via the script editor, a new Google feature. My goal is for the script to turn off the AC when the temperature, as detected by a sensor on my balcony, exceeds a certain value and the balcony door is open.
Here's the condition I wrote for the temperature sensor:
condition:
type: device.state.TemperatureControl
state: temperatureAmbientCelsius
greaterThan: 24
device: WiFi Temperature & Humidity Sensor - Balcony
However, when I validate, I get the following error:
[device.state.TemperatureControl] is an unknown type name. Expected types: [and, or, not, time.between, device.state... (truncated for brevity)].
Interestingly, a similar condition works for humidity using HumiditySetting
:
condition:
type: device.state.HumiditySetting
state: humidityAmbientPercent
greaterThan: 55
device: WiFi Temperature & Humidity Sensor - Balcony
It seems TemperatureSetting
is reserved exclusively for thermostats. However, there's a note in the documentation:
Sensors that report data covered by another trait should use that trait with the queryOnly* attribute for that trait set to true. For example, temperature sensors should use the TemperatureControl trait with the queryOnlyTemperatureControl attribute set to true.
I'm unsure how to set this attribute in the script editor. Any guidance would be appreciated.