Author Topic: Possible to use a Nestcam (Dropcam) with Weather Underground?  (Read 2896 times)

0 Members and 1 Guest are viewing this topic.

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
I'm trying to add a Nestcam to our Weather Underground page. The Nestcam is uploading a video feed, but Weather Underground wants static images.  When I try to add the URL of our Nestcam to Weather Underground, it rejects it.

Is there some workaround to capture frames from a Nestcam stream?

Here's our current Weather Underground page:

https://www.wunderground.com/personal-weather-station/dashboard?ID=KCAPETAL93#history

And the live view from our Nestcam mounted next to the weather station. Beautiful day at the beach as I type this!

http://sinkingsensation.com/cam

« Last Edit: March 11, 2017, 03:07:37 AM by wrybread »

Offline Bushman

  • Forecaster
  • *****
  • Posts: 7549
    • Eagle Bay Weather
Need low cost IP monitoring?  http://wirelesstag.net/wta.aspx?link=NisJxz6FhUa4V67/cwCRWA or PM me for 50% off Wirelesstags!!

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: Possible to use a Nestcam (Dropcam) with Weather Underground?
« Reply #2 on: March 11, 2017, 02:54:26 AM »
Thank you sir! Working great. For the Python fans, I made a quick script adapts the same method (saving a grab to a static image), but without using Google Drive.

http://sinkingsensation.com/cam/saved.jpg


Code: [Select]
#!/usr/bin/python




'''

Python script to save a static image from a Nest Cam video stream.

Useful because Weather Underground requires a static image.

To use, figure out your Nest Cam's uuid. See here for details:

https://ithoughthecamewithyou.com/post/capture-dropcam-frames-to-google-drive

Then set it to run in crontab every minute. Each time the script is run it saves the images once a second for a minute.

'''


import os, urllib, time, shutil




# uuid of your camera
uuid = "d62aa97fdae445af8ebea9328d5fcb06"

# width of the image
image_width = 1000

# filename (path) to save the image
saved_image_path = os.path.expanduser("~") + "/sinkingsensation.com/cam/saved.jpg"


# create the target directory if it doesn't exist
try: os.makedirs( os.path.dirname(saved_image_path) )
except: pass

url = "https://nexusapi.dropcam.com/get_image?uuid=%s&width=%s" % (uuid, image_width)



# since the max frequency for crontab is to run a job once a minute,
# download the image once a second for a minute.
for i in range(60):

    # download the image to a temp file so people aren't trying to load an incomplete image
    urllib.urlretrieve(url, "temp.jpg")

    # copy it to our final path after downloaded
    shutil.copyfile("temp.jpg", saved_image_path)

    time.sleep(1)

« Last Edit: March 11, 2017, 03:18:35 AM by wrybread »

Offline wrybread

  • Senior Member
  • **
  • Posts: 94
Re: Possible to use a Nestcam (Dropcam) with Weather Underground?
« Reply #3 on: March 11, 2017, 03:20:58 AM »
And oof, I see I posted this in the wrong forum. Sorry about that, if it was possible for me to change the forum I would.

Offline Bushman

  • Forecaster
  • *****
  • Posts: 7549
    • Eagle Bay Weather
Re: Possible to use a Nestcam (Dropcam) with Weather Underground?
« Reply #4 on: March 11, 2017, 03:56:57 PM »
Nice job converting to Python!  :)  I am gonna snag it.  :)
Need low cost IP monitoring?  http://wirelesstag.net/wta.aspx?link=NisJxz6FhUa4V67/cwCRWA or PM me for 50% off Wirelesstags!!

 

anything