Sync Motion Sensor Temperature to Virtual Thermostat

I'm trying to get Google Assistant to be able to report the temperature of different rooms based on the temperature reported by the motion sensor in that room. I've created a virtual thermostat (since Google doesn't support temperature sensors) and Google will read me that temperature. Now I am trying to figure out how to sync the temperature of the motion sensor to the virtual thermostat. I tried to create a rule that when the motion sensor temperature changes to do the sync but I can't choose the value to send to the virtual thermostat to be based on another device. Same when I tried to create a local variable. Does anyone have any suggestions?

If you don’t mind using custom code then...
‘Average All’ will sync one or more temp sensors with a virtual thermostat as I know a couple of people do this.

You would just use a virtual thermostat instead of the averageall virtual device

http://hubitat.uk

Andy

I can confirm that Andy's average all works well, but if you don't want custom code and you only want to sent a single sensor's value to a virtual stat this works in RM4. Make sure you select string for parameter type.

1 Like

Thank you, that worked perfectly!

1 Like

I've been trying to do this same thing and having problems, I think I might be missing something. When I create this rule the same way as it appears in your screenshot, %value% gets changed to value() and it doesn't seem to actually use the value from the sensor in the trigger event as the parameter for setTemperature.

I have the same problem as @ardichoke
can someone help to understand this :slight_smile: ?

I misunderstood what I was seeing. If temperature change is the only trigger for your rule, it will populate value() properly the first time it is triggered by a temperature change.

What I ended up doing, because I have a more complex rule that is triggered by multiple things, is set a local variable to the sensor value and then set the virtual thermostat temperature to that variable. Kind of a roundabout way to deal with it, but it works.

1 Like