401unauthorized / locam Goto Github PK
View Code? Open in Web Editor NEWA library for local control of Kasa Smart cameras
License: MIT License
A library for local control of Kasa Smart cameras
License: MIT License
If anyone is interested in the following, please leave a comment or a reaction to this post.
Some functionality is missing from the current implementation:
stream(type, view)
streamToFile(type, seconds)
streamToStream(type, format)
vodStream(type, view)
speak(type, audioStream)
snapshotImage(type, link)
In order to provide more advanced integrations into other platforms such as @SmartThingsCommunity, @homebridge & @home-assistant, this functionality should become available.
It can be broken down into multiple milestones as follows:
snapshotImage
)stream
, vodStream
, streamToFile
)streamToStream
)speak
)Loaded your code and then created the below test script. I validated the username and password by logging out and back into the Kasa App. I did not change any of the source modules. Node JS Version: 16.14.2.
TEST CODE:
const Camera = require('locam');
const c = new Camera({
auth: {
username: '[email protected]',
password: 'xxxxxxx'
},
camera: {
ip: '0.0.50.43',
port: 10443,
name: 'camera'
},
logging: true
});
// Get Night Vision Setting
c.send(c.Settings.nightVision('get')).then(d => {
console.log(d);
}).catch(err => {
console.error(error);
});
Results:
Configuration: {
ip: 'xxxxxxx',
port: 10443,
name: 'camera',
source: '8a2d067d-07fa-49b9-9289-d9f694f709b4',
token: 'yyyyyyyyyyyyy',
package: 'locam',
version: '1.0.3'
}
{
context: { source: { err_code: -10007, err_msg: 'Unauthorized Error' } },
'smartlife.cam.ipcamera.dayNight': { get_mode: { err_code: -10007, err_msg: 'Unauthorized Error' } }
}
The basic code; especially the credentials/login work with the KD110 Doorbell. Of course, the PTZ commands do not work, but other commands do. Recommending updating readme to so indicate.
Dave
PS: Just tested KC115 again. Still can not get this to work with my HW Ver 2 KC115, I think the key is the Ver 2 HW.
It was erroneously determined that this library is supported on v12 when it requires at least v14.
The short term solution will be to update the documentation and package.json to denote this.
The better long term solution would be to use a compiling tool like babel in order to allow backwards compatibility of this library with older versions of node.
There appears to not be a way go get a motion detection alert into the application. True?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.