cancel
Showing results for 
Search instead for 
Did you mean: 

device.state.TemperatureControl not recognised

kus
Community Member

device.state.TemperatureControl says it isn't a recognised type error in script Google home automation.

 

https://developers.home.google.com/automations/schema/reference/entity/sht_device/temperature_contro...

1 Recommended Answer

NeutralContact
Community Member

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)

 

 

 

View Recommended Answer in original post

17 REPLIES 17

DWB1973
Community Member

Would you post the rest of your struct so we can see the script that you have written so far?

kus
Community Member

# ------------------------------------------------------------------------------------------ #
# 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

DWB1973
Community Member

I think the examples are wrong.  The only valid keys for TemperatureControl state are temperatureAmbientCelsius and temperatureSetpointCelsius.  Try temperatureAmbientCelsius instead of temperatureAmbient.

kus
Community Member

I did try with temperatureAmbientCelsius but the error is still there. The error only comes from the following line:

- type: device.state.TemperatureControl

DWB1973
Community Member

Process of elimination approach:

  1. Leave everything else and delete the device name, then click on the empty space after device to see what the autofill choices are. Is the device you want on the autofill list?
  2. Remove everything except the device name, then click on the empty space after type to make sure the device supports the function. Is device.state.temperatureControl on the autofill list?

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

kus
Community Member

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.

DWB1973
Community Member

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.

https://support.google.com/googlenest/gethelp?hl=en

EgyedG90
Community Member

Hi,

 

i have the same problem, if you have any news please update the channel 😉

Vasya-USA
Community Member
 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

kus
Community Member

Hi @Vasya-USA ,

Can you send me the link to that queryOnly* documentation please? 

Thank you

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.

kus
Community Member

Did contact support, the problem is being escalated. Will keep you updated. Feel free to also contact support 

kus
Community Member

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].

evai
Community Member

Same problem here, also contacted the Google support.

NeutralContact
Community Member

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)

 

 

 

Thank you for the update. I just tested and it is working!! I think they fixed the issue.