08-06-2023 01:33 PM
device.state.TemperatureControl says it isn't a recognised type error in script Google home automation.
Answered! Go to the Recommended Answer.
09-18-2023 01:22 AM
Hello team,
I had the same problem but it is working now.
What I use that pass validation and works with a Shelly H&T sensor:
condition:
type: device.state.TemperatureControl
state: temperatureAmbient
lessThanOrEqualTo: 20C
device: MyDeviceName
What was not working is when I entered the device first which gave me a different set of types and then a different set of states...by starting with type, then state then device...it worked (but maybe it just because they fixed it while I was trying different things)
08-06-2023 04:23 PM
Would you post the rest of your struct so we can see the script that you have written so far?
08-06-2023 06:35 PM
# ------------------------------------------------------------------------------------------ #
# Lines starting with “#” are comments and will be ignored by the automation.
# Indentation determines hierarchy within the script.
# Visit g.co/home/script-editor-docs for full documentation.
# ------------------------------------------------------------------------------------------ #
metadata:
name: AC control # Choose a short name that summarizes important starters and actions, like “Sunset lights”.
description: Scripted automation # Write a detailed description that includes everything the automation does, like “At sunset, on weekdays, close blinds, turn on lights to 50%, and play the sunset playlist on certain speakers.”
automations:
# “starters” and “actions” are required; “conditions” are optional.
# Use Ctrl + Space to see autocomplete suggestions.
# ---- STARTERS ---- #
# Starters describe events that will start the automation.
# To add more than one starter, duplicate the "- type" section under "starters".
# If you add multiple starter events, any one of them happening will start the automation.
- starters:
- type: device.state.TemperatureControl
device: Smart IR - Living Room
state: temperatureAmbient
greaterThan: 26C
# ---- CONDITIONS ---- #
# Conditions are optional. Delete this section if it’s empty.
# Conditions will prevent an automation from starting if the conditions aren’t met.
# See g.co/home/script-editor-docs for documentation about how to use logical operators like “and”, “or”, and “not”.
condition:
type: home.state.HomePresence
state: homePresenceMode
is: HOME
# ---- ACTIONS ---- #
# Actions will start when a starter event takes place and all conditions are met.
# Actions will start in the order they appear in the script and with any delay specified.
# To add more than one action, duplicate the "- type" section under "actions".
actions:
- type: device.command.OnOff # Turn the device on or off.
on: false
devices: Air On - Living Room
08-06-2023 07:01 PM
I think the examples are wrong. The only valid keys for TemperatureControl state are temperatureAmbientCelsius and temperatureSetpointCelsius. Try temperatureAmbientCelsius instead of temperatureAmbient.
08-06-2023 07:55 PM
I did try with temperatureAmbientCelsius but the error is still there. The error only comes from the following line:
- type: device.state.TemperatureControl
08-06-2023 08:34 PM
Process of elimination approach:
Or try TemperatureSetting instead.
- type: device.state.TemperatureSetting # Handles temperature points and modes of a thermostat device.
greaterThan: 26C
state: thermostatTemperatureAmbient
device: Smart IR - Living Room
08-06-2023 09:03 PM
Thank you for your help.
1. Yes, the device is on the auto fill list.
2. Yes, device.state.temperatureControl is on the auto fill list.
TemperatureSetting is not available for my device.
08-06-2023 09:37 PM
OK, unless I missed it, I didn't see any other temperature-related device state starters that you can try. Maybe someone at Google Nest support can explain what is causing the error while you wait for the right answer here.
08-12-2023 12:56 PM
Hi,
i have the same problem, if you have any news please update the channel 😉
08-14-2023 11:38 PM
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
08-15-2023 04:31 AM
08-15-2023 08:48 AM
08-15-2023 07:26 AM
It appears as if you're citing information from the cloud-to-cloud documentation that is meant for smart home device developers, and intended for the 'Works With Google' device compliance. It is my opinion that TemperatureControlState is a currently dysfunctional device struct. If the validation check refuses to accept the device state struct, then there's nothing that you can do until a Google dev fixes it - which was why I recommended that @kus contact support for a definitive answer.
08-21-2023 06:33 AM
Did contact support, the problem is being escalated. Will keep you updated. Feel free to also contact support
08-31-2023 03:59 AM
Here is the error:
[device.state.TemperatureControl] is an unknown type name. Expected types: [time.schedule, device.state, device.event, device.state.AppSelector, device.state.ArmDisarm, device.state.Brightness, device.state.Channel, device.state.ColorSetting, device.state.Cook, device.state.Dock, device.state.EnergyStorage, device.state.FanSpeed, device.state.Fill, device.state.HumiditySetting, device.state.InputSelector, device.state.LightEffects, device.state.LockUnlock, device.state.MediaState, device.state.MotionDetection, device.state.OccupancySensing, device.state.Online, device.state.OnOff, device.state.OpenClose, device.state.Record, device.state.Rotation, device.state.RunCycle, device.state.SensorState, device.state.StartStop, device.state.TemperatureSetting, device.state.Timer, device.state.Volume, device.event.DoorbellPress, assistant.event.OkGoogle, home.state.HomePresence, etc].
09-03-2023 04:54 AM
Same problem here, also contacted the Google support.
09-18-2023 01:22 AM
Hello team,
I had the same problem but it is working now.
What I use that pass validation and works with a Shelly H&T sensor:
condition:
type: device.state.TemperatureControl
state: temperatureAmbient
lessThanOrEqualTo: 20C
device: MyDeviceName
What was not working is when I entered the device first which gave me a different set of types and then a different set of states...by starting with type, then state then device...it worked (but maybe it just because they fixed it while I was trying different things)
09-18-2023 05:10 AM
Thank you for the update. I just tested and it is working!! I think they fixed the issue.