Page 1 of 1

Nest and Additional Temp Sensors

PostPosted: Tue Dec 06, 2016 8:50 pm
by Dlucas10
Hello!

I came across your plugin and it looks awesome!

One thing I'm wondering, seeing Nest doesn't support multiple temperature sensors (I think they need to fix this), is this something your plugin supports? I have a case, where i need to support multiple temperature sensors that feed into the decision of the temperature. If your plugin doesn't support it, I think it would be a great addition seeing Nest doesn't want to add them..

Dave

Re: Nest and Additional Temp Sensors

PostPosted: Wed Dec 07, 2016 6:13 am
by Colorado4Wheeler
If your temperature sensors are integrated into Indigo it would be a simple matter to create a trigger or action group for this. I use the Fibraro motion sensors that also report temperature to achieve this.

Re: Nest and Additional Temp Sensors

PostPosted: Wed Dec 07, 2016 6:51 am
by Dlucas10
Colorado4Wheeler wrote:
If your temperature sensors are integrated into Indigo it would be a simple matter to create a trigger or action group for this. I use the Fibraro motion sensors that also report temperature to achieve this.


Yes, they are. I was using smart devices to help with this, but it seems to not support air conditioning mode so this summer I had to disable them.

What I'm looking to accomplish is if I have temperature sensors in 3 rooms on my first floor to average those and report to Nest to help make decision to turn on Heat/AC in my house. Where the thermostats are, make it so it's possible to not get an accurate temperature to it. Is this something you're doing in your setup? If so, I'd be interested in how you've accomplished it.

Thanks!

Dave


Sent from my iPhone using Tapatalk

Re: Nest and Additional Temp Sensors

PostPosted: Sat Dec 31, 2016 9:25 am
by Chameleon
Dave

That could be done but probably through a little python code in a schedule action that runs say every min. The main issue is that there isn't an AVERAGE function in the action conditions but it wouldn't be too hard to add a Server/Execute Action

The code would probably do something like this:

Read temperature from Device 1 into a python variable
Read temperature from Device 2 into a python variable
Read temperature from Device 3 into a python variable
Average the temperatures
Check if something needs to happen

In python it would look like:

Code: Select all
import indigo

# Get devices
t1 = indigo.devices[1632080987] # "Living Room Temperature"
t2 = indigo.devices[1167287922] # "Master Bedroom Temperature"
t3 = indigo.devices[476678264] # "Landing Temperature"

# Extract information on Temperatures
Temp1 = t1.displayStateValRaw
Temp2 = t2.displayStateValRaw
Temp3 = t3.displayStateValRaw

# Calculate average
tempAverage = round((Temp1+Temp2+Temp3)/3.0,1)

# Show the results in the indigo log as an example
indigo.server.log('Temperatures:'+str(Temp1)+' '+str(Temp2)+' '+str(Temp3))
indigo.server.log('Average:'+str(tempAverage))

# Now act
if tempAverage>18.0:
   indigo.server.log('Temperature too high - switching on cooling')
elif tempAverage<15.0:
   indigo.server.log('Temperature too low - switching off cooling')


Here's an example of the code in place in a New Schedule Page...

Screen Shot 2016-12-31 at 15.21.58.png
Create New Schedule Dialog
Screen Shot 2016-12-31 at 15.21.58.png (98.97 KiB) Viewed 2187 times


I'm not sure exactly what you want to do but if you let me know I'll try to come up with an action that changes your NEST when needed (and will probably be more elegant than this solution)

Regards

Mike

Re: Nest and Additional Temp Sensors

PostPosted: Sat Aug 25, 2018 8:11 am
by farberm
Dave:

Did you ever get the three temperature sensors script to work. I am getting the following error:

Schedule Average Upstairs Temperature Trigger NEST
Script Error embedded script: unsupported operand type(s) for +: 'float' and 'unicode'
Script Error Exception Traceback (most recent call shown last):

embedded script, line 14, at top level
TypeError: unsupported operand type(s) for +: 'float' and 'unicode'

I had to change the script as follows to get it to work....
# Extract information on Temperatures
Temp1 =int( t1.displayStateValRaw)
Temp2 = int(t2.displayStateValRaw)
Temp3 =int( t3.displayStateValRaw)

What did command did you use to turn on cooling or turn off cooling?