Code Monkey home page Code Monkey logo

arlo-ruby's Introduction

arlo-ruby

A client library written in Ruby to interact with the Netgear Arlo camera system.

Why?

Netgear notoriously keeps a closed system around the Arlo API. They do not publish the API specifications publicly, and if it was up to them you would never be able to access your devices directly. This is because they rely on the revenue from cloud-based subscriptions to store and manage your equipment and it is not in their interests to open it up to you.

For those of us who want to backup our videos to our own NAS for backup, sync to a different cloud provider, or otherwise integrate the system into our existing home automation platforms, this library was written.

While this is functional, it is still incomplete. Contributions of any kind at this time are welcome and encouraged!

Installation

Add this line to your application's Gemfile:

gem 'arlo-ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install arlo-ruby

Usage

Initialize the client

client = Arlo::Client.new

Login

response = client.login(email: 'YOUR EMAIL', password: 'YOUR PASSWORD')

Get Devices

Retrieves all of the devices associated with your account.

devices = client.devices
+---------------+----------------------+
|                Login                 |
+---------------+----------------------+
| Variable      | Value                |
+---------------+----------------------+
| User ID       | NZ69AUK-336-51372586 |
| Email         | [email protected]  |
| Valid Email   | true                 |
| Token         | xxxxxxxxxxxxxx       |
| Authenticated | 1566062204           |
| Created       | 1565912809854        |
+---------------+----------------------+

+---------------+---------------+----------------------------------+-------------+---------------+-----------+---------------------+-------------+----------------------+
|                                                                                Devices                                                                                |
+---------------+---------------+----------------------------------+-------------+---------------+-----------+---------------------+-------------+----------------------+
| ID            | Parent ID     | Unique ID                        | Type        | Model         | HW        | Name                | State       | Connectivity         |
+---------------+---------------+----------------------------------+-------------+---------------+-----------+---------------------+-------------+----------------------+
| 4R036C71A22F2 |               | Z92W-336-6644878_4R036C71A22F2   | basestation | VMB4000       | VMB4000r3 | Beatty Base Station | provisioned | ethernet / connected |
| 4XH16C71A8A5C | 4R036C71A22F2 | Z92W-336-6644878_4XH16C71A8A5C   | camera      | VMC4030       | H8        | Office              | provisioned |                      |
| 4XH16C7EAA32C | 4R036C71A22F2 | Z92W-336-6644878_4XH16C7EAA32C   | camera      | VMC4030       | H8        | Family Room         | provisioned |                      |
| 4R036C71A22F2 | 4R036C71A22F2 | Z92W-336-6644878_4R036C71A22F2#1 | siren       | VMB4000-siren |           | Beatty Base Station | provisioned |                      |
+---------------+---------------+----------------------------------+-------------+---------------+-----------+---------------------+-------------+----------------------+

Setup a Basestation Object

This allows you to operate directly on a basestation.

basestation = Arlo::Basestation.new(devices.detect { |device| device.deviceType == 'basestation' }, client)

Set Mode

basestation.system_mode(:disarm)
basestation.system_mode(:arm)

Valid modes: :disarm, :arm

Get Video Library

Returns an array of OpenStruct that contain details about the captured videos associated with your basestation.

videos = basestation.library(2.weeks.ago, Time.current)

Download Video Library

This is useful in order to backup your captured videos to local storage, or perhaps a NAS on your network.

basestation.library_download('arlo_videos')
Downloading 1566061318696 to arlo_videos/1566061318696.mp4...

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kevinelliott/arlo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

arlo-ruby's People

Contributors

dependabot-support avatar kevinelliott avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

fossabot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.