Openhab2 Nest binding - 2.2.0.SNAPSHOT An Updated 2.0 Binding that works!

Not to be a pain, I’m on 2.2 stable and just installed the most recent .jar from the post a few days ago. Everything works great except, I’m pulling Current Outside Temp from the Nest and it’s still showing in Celsius. Of course, it’s pretty likely it’s just something I did wrong and I just can’t figure out what, but wanted to give you a heads up, just in case it wasn’t me.

I’d just like to add that I’ve been using this binding for a couple of months now, getting the current temperature/humidity, Away state, heating state, and setting the target temperature on the Nest to either 13 or 24 (as an “on/off” switch for my heating in general), it is working great.

Although I do still have an additional rule running every 30 minutes to send my target temperature (13 or 24) just in case, I don’t think it’s actually been needed for a long while (I’ve just not got round to removing it, and as openHAB is in charge of my heating, rather than the Nest, it’s a sensible fail-safe)

I have a nest smoke alarm, have installed binding and configured it up, it mostly works - however the “last_connection” date/time does not.

/* NEST Smoke Alarm */ 
Switch   		hallway_Nest_battery            "Low Battery"                        <battery>                                                    { channel="nest:smoke_detector:halway:low_battery" }
String          hallway_Nest_smoke              "Smoke Status [%s]"                  <smoke>                                                      { channel="nest:smoke_detector:halway:smoke_alarm_state" }
String          hallway_Nest_co                 "CO Status [%s]"                     <carbondioxide>                                              { channel="nest:smoke_detector:halway:co_alarm_state" }
DateTime        hallway_Nest_lastconnect        "Last Connect [%s]"                  <time>                                                       { channel="nest:smoke_detector:halway:last_connection" }

Sitemap

	Frame label="Nest Protect" {
		Text item=hallway_Nest_battery
		Text item=hallway_Nest_smoke		
        Text item=hallway_Nest_co 
		Text item=hallway_Nest_lastconnect
	}

In PaperUI, under config of the nest smoke alarm thing, it only shows battery, smoke and co as options to link to items. I tried manually just entering the channel in the items file above anyway (eg: { channel=“nest:smoke_detector:halway:last_connection” } ) but this does not display any date / time.

Any ideas?

The last_connection channel is only available since OH 2.3.0-snapshot.

Also there is an issue in OH that new channels do not automatically get added to existing Things. A workaround is to delete and add the Thing again.

1 Like

Hey All,

I have my Nest account online but the thermostat offline. i read all the replies above where it’s mentioned that the read/write Thermostat permission v6 will solve the issue. but it’s not working. every time i changed the set temperature in /nest Thermostat i got a lot of error messages on OH logs.

Can please someone advise what i still missing? Noting that the Thermostat has been automatically discovered once i linked my Nest account in OH paper UI.

Thank you in advance,.

The recent openHAB 2.3.0-SNAPSHOT builds (#1230 or newer) now support units (see announcement). So it now possible to use the updated Nest Binding (PR #3150) that natively supports Fahrenheit temperature values.

Here is a org.openhab.binding.nest-2.3.0-SNAPSHOT.jar for people who want to help testing this PR.

You’ll also need to update your Nest temperature item definitions. See the updated README for some examples.

What kind of error messages do your logs show? I’ve made a fix in the updated Nest Binding (see text above) so it can handle missing values due to missing permissions or older API versions. Any missing values will now be updated to null instead of throwing exceptions.

How would one send a new temperature to using the UoM? I’ve tried several things, but none work. Sending an plain integer does not work. According to the blog post, the following should work:

sendCommand(Nest_target_temperature_f, (nest_temp_cool_setpoint.state) [°F]  )

But I get this error:

2018-04-02 14:52:27.765 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'climate.rules' has errors, therefore ignoring it: [166,78]: missing ')' at '['
[166,79]: no viable alternative at input '?'
[166,82]: mismatched input ']' expecting '}'
[166,85]: extraneous input ')' expecting '}'
[185,6]: mismatched input '}' expecting 'end'

I’ve also tried

Nest_target_temperature_f.sendCommand( (nest_temp_cool_setpoint.state as QuantityType).intValue   )

But the following occurs:

Caused by: org.eclipse.smarthome.model.script.engine.ScriptExecutionException: Could not cast 68 to org.eclipse.smarthome.core.library.types.QuantityType; line 153, column 47, length 45

None of the following karaf commands generate any output in the DEBUG log:

openhab> smarthome:send Nest_target_temperature_f 60                                                                                                                                                         
Command has been sent successfully.
openhab> smarthome:send Nest_target_temperature_f 60 [°F]
Command has been sent successfully.
openhab> smarthome:send Nest_target_temperature_f 60 °F
Command has been sent successfully.

My item definition

Number:Temperature   Nest_target_temperature_f "Target Temperature [%d °F]"       (Nest_Therm,Weather)    { channel="nest:thermostat:mynestaccount:house_thermostat:set_point" }

Binding: 250 | Active | 80 | 2.3.0.201803171325 | Nest Binding.
Snapshot: 2.3.0-SNAPSHOT Build #1246

What version of OH are you running? I’m not entirely certain that feature has even made it into OH 2.3 snapshots yet but I’m pretty certain it was not available in version 2.2 release.

I’m on openHAB 2.3.0-SNAPSHOT Build #1246. My setup is retrieving the correct values, and I had to change my rules from DecimalType to QuantityType which seems to be working well. I’m just having trouble sending a new value to the binding.

When nest_temp_cool_setpoint is also an item of Number:Temperature this works for me:

sendCommand(Nest_target_temperature_f, nest_temp_cool_setpoint.state.toString())

I’ve got it working. The command must be sent with an integer followed by a string with the unit without a space.

The karaf command that works:

smarthome:send Nest_target_temperature_f 68°F

Rule command:

Nest_target_temperature_f.sendCommand( (nest_temp_heat_setpoint.state) + “°F” )

which would be if nest_temp_heat_setpoint was a number, not QuantityType.

or

Nest_target_temperature_f.sendCommand(68 + “°F”)

I’ll also add that I had rules comparing the thermostat setpoint value to integers that were broken because the new QuantityType can’t be cast as DecimalType. Ultimately, I suppose it would be best to change all my values to QuantityType, but the fix to get things working again was to convert to integers:

((Nest_target_temperature_f.state as QuantityType).intValue != nest_temp_heat_setpoint.state)   )

Today the pull request for adding Fahrenheit support got merged.
It’s part of the latest openHAB 2.3.0-SNAPSHOT build (#1253).
So it will also be part of the final 2.3.0 release! :tada:

1 Like

Will this binding support the new Nest temperature sensor? Is the temperature sensor data even available through rhe API?

Which temperature sensor are you referring to? The one that’s been out for a few years or did a miss a new product ?

There was no remote temperature sensor for Nest available until just recently. It is a new product:

However, I googled a bit and it looks like the sensor is not yet available in the API, but Nest may add it. Link below. Once that’s available, it would be great to be able to set the currently active temperature sensor via OH since you could link it to weather and motion events.

How does such a sensor work with a central heating system? I can’t open and close valves per room. So they would just be dumb sensors… Philips hue already has that in their motion sensors.

Check out the product link. You set different sensors to be active at different times of day. Nothing to do with opening or closing vents per room, it’s about which room you want to prioritize at a current time, e.g. living room during the day and bedroom at night. Currently with the Nest app you can only schedule which sensor is active at 4 pre-set times of day (morning, afternoon, evening, night) or manually so an eventual OH integration would be much more powerful.

My heating system is either on or off… I cannot differentiate per room. I can measure the temperature, but if I turn on the heating it will heat all rooms where the valves are open.

Where is your thermostat mounted? What if it was in a different room? Your system would still work, right? This is the same concept, it allows you to “move” the position of the thermostat during the day.

Not every room gets exactly same amount of heat/AC. Sometimes rooms are hotter or colder than others. Think about a bedroom that has several windows and gets a lot of sun versus a well-insulated basement living room. During the summer, the bedroom should be warmer than the basement. But you’re not in the bedroom during the day, so why make your system work extra hard to cool the bedroom? Just have the system use the temperature in the basement instead to determine when it shuts off.

At any rate, remote temperature sensors are available on several major smart thermostats and it’s a proven concept. Take a look at the Ecobee binding as well. It would be great to have the same functionality for Nest, once it’s in their API. Ecobee remote temperature sensors in fact have motion sensors built-in to automatically prioritize rooms based on occupancy, but Nest sensors do not. OH integration would allow this though by using any linked motion sensor.

My nest is in my living room, which is just fine. I was just trying to point out that I don’t have smart valves which would make much more sense. If I move my thermostat around it would just give me a very hot living room.

This is what would help, but what I don’t have: