Looking for Nest Cam testers

Continuing the discussion from Any Nest Cam users using openHAB?:

I just submitted new code that should implement API support for the Nest Cam in the Nest binding. If you do decide to get a Nest Cam, please try this code and let me know if it works as intended. I won’t merge it into openHAB until I’m certain that it works!

Please replace the JAR file in your addons directory with this one and try the new binding config strings listed here.

To understand the full meaning of the information returned for Nest Cam, please read Nest’s Camera Guide and the API documentation.

How well does it integrate with openhab?

I have been hesitant to purchase these because of the quality/work required to set these up.

Assuming this change works as intended, you will be able to see if the Nest Cam is currently online, turn streaming off and on, access the URLs to live streams, and if you have a Nest Aware with Video History subscription, access to details about the last motion/sound event. More can be found in the Camera Guide.

I don’t have a Nest Cam, but I get the sense that it is a “deluxe” indoor home monitoring camera that does a good job at properly detecting motion and sound events. I don’t think the camera appeals to frugal DIY kinds of people, but more to less technical, just-want-it-work-without-hassle kinds of people. It comes with a free 30 days of cloud storage/event recording service, so it’s probably almost risk-free to try it out.

What are the frugal diys using for video with openhab. I wasnt too pleased with foscam when i tried it a few months back.

I don’t know, but I know a new thread on the subject would be interesting!

Hi @watou, thank you so much for putting this together. I just added the binding and configured it, but I’m getting error messages. Up until this point, my nest thermostat has functioned fine and I’ve had the cameras for a couple years. The thermostat continues to function, but the camera info is not populating. It fails across the board. Here are a couple chunks from the log:

2015-10-11 10:13:13.911 [ERROR] [.o.b.nest.internal.NestBinding] - Unable to get state from data model
org.apache.commons.beanutils.NestedNullException: Null property value for ‘cameras(Living Room).last_event.web_url’ on bean class ‘class org.openhab.binding.nest.internal.messages.DataModelResponse’
at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:755) ~[commons-beanutils-1.8.3.jar:1.8.3]
at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:846) ~[commons-beanutils-1.8.3.jar:1.8.3]
at org.openhab.binding.nest.internal.messages.DataModel.getProperty(DataModel.java:339) ~[bundlefile:na]
at org.openhab.binding.nest.internal.NestBinding.getState(NestBinding.java:234) [bundlefile:na]
at org.openhab.binding.nest.internal.NestBinding.readNest(NestBinding.java:202) [bundlefile:na]
at org.openhab.binding.nest.internal.NestBinding.execute(NestBinding.java:166) [bundlefile:na]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156) [org.openhab.core_1.8.0.201507290114.jar:na]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173) [org.openhab.core_1.8.0.201507290114.jar:na]

And:

2015-10-11 10:10:12.749 [ERROR] [.o.b.nest.internal.NestBinding] - Unable to update data model
java.lang.NullPointerException: null
at org.openhab.binding.nest.internal.NestBinding.updateNest(NestBinding.java:355) [bundlefile:na]
at org.openhab.binding.nest.internal.NestBinding.internalReceiveUpdate(NestBinding.java:293) [bundlefile:na]
at org.openhab.core.binding.AbstractBinding.receiveUpdate(AbstractBinding.java:117) [org.openhab.core_1.8.0.201507290114.jar:na]
at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:38) [org.openhab.core_1.8.0.201507290114.jar:na]
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197) [org.eclipse.equinox.event_1.2.200.v20120522-2049.jar:na]
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197) [org.eclipse.equinox.event_1.2.200.v20120522-2049.jar:na]
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1) [org.eclipse.equinox.event_1.2.200.v20120522-2049.jar:na]
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [org.eclipse.osgi_3.8.2.v20130124-134944.jar:na]

Thanks very much for trying the binding and sending the stack dumps.

I am confused because the line numbers in the stack trace that refer to NestBinding.java don’t seem to agree with my nest-cam-support branch which is the basis for pull request #3232, so that makes me think you might be trying a different JAR than the one that contains the camera support. I’ve just now built the jar again, just to make sure we’re talking about the same code. Other things to check:

  • If you’ve been using the Nest binding for some time, you have to change your client’s permissions to include permissions for camera access. Then you have to create a new PIN based on this edited client and change the PIN in openhab.cfg.
  • In order to access the properties under last_update, you must have a subscription to Nest Aware with Video History.

I’m very eager to work this through until we have it working for you, because then I can merge it for the openHAB 1.8 release.

Thanks, John

Great! I’m with you until we get it working.

You were right about the permissions. I updated all of the permissions to include camera+images and got a new pin. I already do subscribed to nest aware with video history on all my cams.

I downloaded the newest jar above. But no luck. Here is a snippet from the logs. The therm continues to work.

2015-10-11 19:14:34.527 [ERROR] [.o.b.nest.internal.NestBinding] - Unable to get state from data model
java.lang.NoSuchMethodException: Unknown property ‘cameras’+ on bean class ‘class org.openhab.binding.nest.internal.messages.DataModelResponse’
at org.apache.commons.beanutils.PropertyUtilsBean.getMappedProperty(PropertyUtilsBean.java:632) ~[commons-beanutils-1.8.3.jar:1.8.3]
at org.apache.commons.beanutils.PropertyUtilsBean.getMappedProperty(PropertyUtilsBean.java:578) ~[commons-beanutils-1.8.3.jar:1.8.3]
at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:748) ~[commons-beanutils-1.8.3.jar:1.8.3]
at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:846) ~[commons-beanutils-1.8.3.jar:1.8.3]
at org.openhab.binding.nest.internal.messages.DataModel.getProperty(DataModel.java:302) ~[bundlefile:na]
at org.openhab.binding.nest.internal.NestBinding.getState(NestBinding.java:234) [bundlefile:na]
at org.openhab.binding.nest.internal.NestBinding.readNest(NestBinding.java:202) [bundlefile:na]
at org.openhab.binding.nest.internal.NestBinding.execute(NestBinding.java:166) [bundlefile:na]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156) [org.openhab.core_1.8.0.201507290114.jar:na]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173) [org.openhab.core_1.8.0.201507290114.jar:na]

It’s essentially the same block over and over.

Thanks, Joseph. Could you paste the camera-related lines in your .items file so I can verify that the binding config strings should be working? The + in the log line seems strange, so I want to make sure.

Of course! Here you go.

String CamDeviceId “CamDeviceId [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).device_id]” }
String CamSWVersion “CamSWVersion [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).software_version]” }
String CamName “CamName [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).name]” }
String CamNameLong “CamNameLong [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).name_long]” }
Switch CamIsOnline “CamIsOnline [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).is_online]” }
Switch CamIsStreaming “CamIsStreaming [%s]” (Nest_Cam) { nest=“=[cameras(Living Room).is_streaming]” }
Switch CamIsAudioInputEnabled “CamIsAudioInputEnabled [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).is_audio_input_enabled]” }
DateTime CamLastIsOnlineChange “CamLastIsOnlineChange [%1$tm/%1$td %1$tH:%1$tM]” (Nest_Cam) { nest=“<[cameras(Living Room).last_is_online_change]” }
Switch CamIsVideoHistoryEnabled “CamIsVideoHistoryEnable [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).is_video_history_enabled]” }
String CamWebUrl “CamWebUrl [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).web_url]” }
String CamAppUrl “CamAppUrl [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).app_url]” }
Switch CamLastEventHasSound “CamLastEventHasSound [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).last_event.has_sound]” }
Switch CamLastEventHasMotion “CamLastEventHasMotion [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).last_event.has_motion]” }
DateTime CamLastEventStartTime “CamLastEventStartTime [%1$tm/%1$td %1$tH:%1$tM]” (Nest_Cam) { nest=“<[cameras(Living Room).last_event.start_time]” }
DateTime CamLastEventEndTime “CamLastEventEndTime [%1$tm/%1$td %1$tH:%1$tM]” (Nest_Cam) { nest=“<[cameras(Living Room).last_event.end_time]” }
DateTime CamLastEventUrlsExpireTime “CamLastEventUrlsExpireTime [%1$tm/%1$td %1$tH:%1$tM]” (Nest_Cam) { nest=“<[cameras(Living Room).last_event.urls_expire_time]” }
String CamLastEventWebUrl “CamLastEventWebUrl [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).last_event.web_url]” }
String CamLastEventAppUrl “CamLastEventAppUrl [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).last_event.app_url]” }
String CamLastEventImageUrl “CamLastEventImageUrl [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).last_event.image_url]” }
String CamLastEventAnimatedImageUrl “CamLastEventAnimatedImageUrl [%s]” (Nest_Cam) { nest=“<[cameras(Living Room).last_event.animated_image_url]” }

Thanks! I’m still scratching my head though. Could you change every instance of “cameras(Living Room)” to “devices.cameras(Living Room)” in the binding strings, just to see if it makes any difference? If not, could you add this line to your logback.xml file:

	<logger name="org.openhab.binding.nest" level="TRACE"/>

below the line

	<logger name="org.openhab" level="INFO"/>

in hopes of seeing more of what is happening? Sorry to put this on you, but since I don’t have the Nest Cam, I am a bit blind here. :neutral_face:

Another possibility is something statically cached in memory from the old JAR, so a complete stop and restart of openHAB runtime might be needed (if you didn’t do so after applying the latest binding JAR).

I did stop and restart the service. I also completely removed the old jar from addons. So, only the new jar present. Adding device.cameras didn’t change anything.

Here is the trace:

Dropbox - Error - Simplify your life

Final thought for tonight (will continue looking tomorrow):

Any chance that you have more than one nest binding JAR in your addons directory?

No I just double checked, definitely only the new one.

Thanks for working on this!

When I run the same JAR here, I am getting past the NoSuchMethodError issue, as in, my runtime succeeds in accessing the cameras property, but since I have no cameras, I get the expected NestedNullException:

2015-10-12 09:37:20.437 [ERROR] [.o.b.nest.internal.NestBinding] - Unable to get state from data model
org.apache.commons.beanutils.NestedNullException: Null property value for 'cameras(Dining Room).last_event.has_sound' on bean class 'class org.openhab.binding.nest.internal.messages.DataModelResponse'
	at org.apache.commons.beanutils.PropertyUtilsBean.getNestedProperty(PropertyUtilsBean.java:755) ~[commons-beanutils-1.8.3.jar:1.8.3]
	at org.apache.commons.beanutils.PropertyUtilsBean.getProperty(PropertyUtilsBean.java:846) ~[commons-beanutils-1.8.3.jar:1.8.3]
	at org.openhab.binding.nest.internal.messages.DataModel.getProperty(DataModel.java:339) ~[bundlefile:na]
	at org.openhab.binding.nest.internal.NestBinding.getState(NestBinding.java:234) [bundlefile:na]
	at org.openhab.binding.nest.internal.NestBinding.readNest(NestBinding.java:202) [bundlefile:na]
	at org.openhab.binding.nest.internal.NestBinding.execute(NestBinding.java:166) [bundlefile:na]
	at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:156) [org.openhab.core_1.7.1.jar:na]
	at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:173) [org.openhab.core_1.7.1.jar:na]

This makes me think that, somehow, your server is not using the test JAR. You’ve checked to make sure that you only have that one JAR in your addons directory, but could you do another run-down on your installation to make sure that you are using the test JAR and nothing else? I could of course be wrong, but the only explanation I can see at this point is that BeanUtils introspection has no idea that either the DataModel or the Devices class has a cameras property, which it definitely does in the test JAR.

The + in the NoSuchMethodException that you see in your logs is just a typo in the BeanUtils 1.8.3 source code, so is unrelated.

Thanks for you help trying to run this down. If none of this bears fruit, I might ask to authorize my installation against your client app data to take a look at your installation (but if you don’t want me to see it, that’s OK).

John

I dug up an old pi, installed a fresh copy of the 1.8 runtime from cloudbees and added your jar. Got a new pin and started up. Same output as above.

OK. Please get a new JAR from this link and add this line to logback.xml:

        <logger name="org.openhab.binding.nest" level="TRACE"/>

Please let me know what version appears in the log:

Nest binding has been started. Version XXX

Also, please let me know what dump you see on the line:

Retrieved data model: DataModelResponse[devices=Dat....

I’m sorry this is so much effort to track down. If I could access a nest:client_id, nest:client_secret and nest:pin_code that had cameras included, I could probably figure this out quicker. But I’m happy to keep trying to figure it out this way. Thanks for your perseverance.

Eureka!

Here is what you requested minus redactions:

2015-10-12 18:03:45.196 [DEBUG] [.b.nest.internal.NestActivator] - Nest binding has been started. Version 1.8.0.201510122126

2015-10-12 18:03:59.829 [TRACE] [.o.b.nest.internal.NestBinding] - Retrieved data model: DataModelResponse[devices=DataModel.Devices[thermostats={xxxxxxxxxxxxxxxxxxxxxxxxxxx=Thermostat[device_id=xxxxxxxxxxxxxxxxxxxxxxxxxxx,name=xxxxxx,locale=en-US,software_version=4.5.1,structure_id=xxxxxxxxxxxxxxxxxxxxxxxxxxx,name=xxxxxxxx,name_long=xxxxxxxxxxxxxxxx,last_connection=Mon Oct 12 17:53:03 EDT 2015,is_online=true,can_cool=true,can_heat=true,is_using_emergency_heat=false,has_fan=true,fan_timer_active=false,fan_timer_timeout=,has_leaf=false,temperature_scale=F,target_temperature_f=69,target_temperature_c=20.0,target_temperature_high_f=75,target_temperature_high_c=24.0,target_temperature_low_f=68,target_temperature_low_c=20.0,away_temperature_high_f=76,away_temperature_high_c=24.0,away_temperature_low_f=55,away_temperature_low_c=12.5,hvac_mode=heat,ambient_temperature_f=74,ambient_temperature_c=23.0,humidity=50,hvac_state=off]},smoke_co_alarms=,cameras={xxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx=Camera[device_id=xxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx,name=Room2,locale=,software_version=187-550036,structure_id=xxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxx,name=Room2,name_long=Room2 Camera,last_connection=,is_online=true,is_streaming=true,is_audio_input_enabled=true,last_is_online_change=Fri Oct 09 20:14:53 EDT 2015,is_video_history_enabled=true,web_url=Log into the Nest app], xxxxxxxxxxxxxxxxxxxx=Camera[device_id=xxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxx,name=Living Room (Living Room),locale=,software_version=187-550036,structure_id=xxxxxxxxxxxxxxxxxxxxxxxx,name=Living Room (Living Room),name_long=Living Room Camera (Living Room),last_connection=,is_online=true,is_streaming=true,is_audio_input_enabled=true,last_is_online_change=Sun Oct 11 15:55:15 EDT 2015,is_video_history_enabled=true,web_url=Log into the Nest app], xxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx=Camera[device_id=xxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx,name=Nursery (Nursery),locale=,software_version=187-550036,structure_id=xxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx,name=Nursery (Nursery),name_long=Nursery Camera (Nursery),last_connection=,is_online=true,is_streaming=true,is_audio_input_enabled=true,last_is_online_change=Mon Oct 12 13:58:09 EDT 2015,is_video_history_enabled=false,web_url=Log into the Nest app]}],structures={xxxxxxxxxxxxxxxxxxxxxxxxxxx=Structure[structure_id=xxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx,thermostats=[xxxxxxxxxxxxxxxxxxxxxxxxxxx],smoke_co_alarms=,cameras=[xxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx, xxxxxxxxxxxxxxxxxxxxxxxxxxx-x-xx-xxxxxxxxxxxxxxxxxxxxxxxx, xxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx],away=home,name=xxxxxxxxxxxxxx,country_code=US,postal_code=xxxxx,peak_period_start_time=,peak_period_end_time=,time_zone=America/xxxxx,eta=]}]

Have a look at how the camera names are presented. My “Living Room” Camera is displayed as “Living Room (Living Room)” because I had selected 1.Where = “Living Room” and 2. Label = “Living Room”. I removed the label so that it was only Living Room and everything immediately popped up.

I also tried changed the item to

{ nest=“<[cameras(Living Room (Living Room)).device_id]” }

but that did not work.

I’ll have a look at functionality now and get back to you.

Great news. The rules described here would apply if you wanted to use the name+label “Living Room (Living Room)”. Looking forward to your next report!