Comments (11)
Tried it this way:
var device = self.config.arlo.devices[n.device]
device.subscribe(function(error, response) {
if (error) {
console.log(error)
}
response.on('statusUpdate', function(msg) {
console.log(msg)
})
}
from node-arlo.
@HendrikRoth any luck?
from node-arlo.
No :(
I am able to enable/disable the cameras, but still have no idea how to listen to motion events.
https://github.com/HendrikRoth/node-red-contrib-arlo
from node-arlo.
I found a way to figure out when motion is detected. In the found
event (callback), there's something like device._____lastImage
or device.device.______lastImage
(per camera). Request that S3 image URL and save the last-modified
header from the response. Every N seconds, request it again and if the last-modified
has changed, that camera has detected motion.
from node-arlo.
Sorry, I haven't had the bandwidth to look at this issue until now.
I've just pushed version 0.0.4
which adds support for motion events.
var device = self.config.arlo.devices[n.device];
device.on('motionDetected', function(state) {
//state is true for motion detected, false for no motion
});
from node-arlo.
Thank you, will look at it at the weekend!
For listening on state changes (arm/disarm), we have to listen on the basestation, or? i did not see any committed event for this.
from node-arlo.
You should be able to listen for those events like this...
basestation.on(Arlo.ARMED, function() {
//todo
});
basestation.on(Arlo.DISARMED, function() {
//todo
});
from node-arlo.
I should also note that Arlo.DISARMED
and Arlo.ARMED
listen for mode0
and mode1
respectively. The default modes that are created when you register your Arlo basestation.
If you create additional custom modes, they take the names mode2
, mode3
, etc. You can subscribe to these custom modes using...
basestation.on('mode2', function() {
//todo
});
from node-arlo.
perfect, thank you for the hint. i have now the listening and the triggering part finished for arlo states. just need to look for the motion events at the weekend. thanks!
from node-arlo.
Sorry for jumping on this thread but having trouble getting events from working in my script. Here's the code;
arlo.login(ARLO_USERNAME, ARLO_PASSWORD, function () {
arlo.getDevices(function () {
for (let device in arlo.devices) {
if (arlo.devices[device].device.deviceType == "basestation") {
var basestation = arlo.devices[device];
basestation.on(Arlo.ARMED, function () {
console.log("armed");
});
basestation.on(Arlo.DISARMED, function () {
console.log("disarmed");
});
}
if (arlo.devices[device].device.deviceType == "camera") {
var camera = arlo.devices[device];
camera.on('motionDetected', function (state) {
//state is true for motion detected, false for no motion
console.log("motion");
});
}
}
})
})
It's logging in, finding the devices (I've tested outputting the ID's) but none of the events are triggering.
For reference, node -v is showing v8.11.1.
Any pointers would be appreciated.
from node-arlo.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from node-arlo.
Related Issues (20)
- Siren? HOT 3
- Add support for 2FA HOT 3
- License HOT 1
- Serialise Devices HOT 5
- Expose constant EVENT_GOT_DEVICES HOT 4
- Beta Branch of basestation.ts S/B SET not GET HOT 1
- Beta Branch type-rest-client default PersonalAccessTokenCredentialHandler not compatible with Arlo API HOT 1
- Beta Branch getDevices fails authorization HOT 2
- Beta branch error replace is not a function HOT 1
- Working Example Receiving Motion and Media Upload Events HOT 1
- Beta Branch resources notify.ts miss-spelled subscriptions HOT 1
- General mode change notification HOT 3
- Possibility to query basestation and camera properties HOT 1
- Transfer Ownership Back HOT 2
- Documentation HOT 3
- Add documentation HOT 1
- Sources the wrong parameter when emitting mode change events HOT 1
- move back over also HOT 3
- Missing support for non-mfa enabled accounts HOT 4
- Add support for Arlo Q HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-arlo.