r/GoogleAssistantDev • • Feb 16 '20

Get Ambient Temperature

Hello everyone!

Do you know if it's possible to get the ambient temperature in a Smart Home Action?

I don't need the thermostat device type because my device is a humidifier, but I want to get the ambient temperature of it.

Actually, there are two traits for the temperature:

TemperatureSetting: this allows us to get the temperature setpoint and ambient, but my device doesn't allow me to change temperature, so I only want to retrieve the ambient temperature. This is not possible if I don't report the thermostatTemperatureSetpoint attribute. And I can't report it, because I can't set any temperature to be reached. My device will not modify the temperature ambient by itself. It only has a sensor.

Temperature Control: is more or less the same as the above trait, but the temperatureSetpointCelsius is required. This trait was thought for devices that can control temperature and mine, can't.

I only want to ask: what is the temperature of the humidifier? or what is the temperature of the bedroom? And get the ambient temperature

Does anybody know how to do it or if it is possible?

Thanks

3 Upvotes

3 comments sorted by

2

u/puuut Feb 16 '20

Your device type should be action.devices.types.HUMIDIFIER, which has the recommended traits:

  • action.devices.traits.FanSpeed

  • action.devices.traits.HumiditySetting

  • action.devices.traits.Modes

  • action.devices.traits.OnOff

  • action.devices.traits.StartStop

  • action.devices.traits.Toggles

Of course, that doesn't stop you from adding another one. In your case you want to report temperature, not set it. Unfortunately, there is no trait that supports this case. There is action.devices.traits.TemperatureControl, but that is intended for devices that:

support controlling temperature, either within or around the device.

Like you say, the trait marks the STATE temperatureSetpointCelsius as required, but your device does not have such a state property. Besides, adding this trait would also enable user to use the COMMAND action.devices.commands.SetTemperature, which your device does not have.

So, it seems there is no support for your use case. You could either decide to drop it, or to open a support ticket with Google.

I'd wager this is properly designed, by the way, since I would not expect users to use their humidifier to report on room temperatures. That's what a thermostat is for.

1

u/paquiro23 Feb 17 '20

Thanks for your reply, that's what I thought. I hope they implement this functionality

2

u/fleker2 Googler Feb 18 '20

TemperatureSetting is meant for thermostat devices. You probably want to use the TemperatureControl trait with the attribute `queryOnlyTemperatureControl`. That will signal that you cannot control the temperature but only read it.