lpgera / dirigera Goto Github PK
View Code? Open in Web Editor NEWAn unofficial TypeScript client library for IKEA's DIRIGERA smart home hub
Home Page: https://www.npmjs.com/package/dirigera
License: MIT License
An unofficial TypeScript client library for IKEA's DIRIGERA smart home hub
Home Page: https://www.npmjs.com/package/dirigera
License: MIT License
Heyo! Back again lol
I just bought an air purifier that should be controllable with dirigera, i have gotten it to turn on and off its statusLight using the setStatusLight function but the setMotorState function as shown in the example code in github is throwing the following error
HTTPError [DirigeraError]: {"error":"Error","message":"\"attributes\" does not match any of the allowed types"}
at Request.<anonymous> (file:///C:/Users/kiter/Desktop/ikea/node_modules/got/dist/source/as-promise/index.js:86:42)
at Object.onceWrapper (node:events:633:26)
at Request.emit (node:events:530:35)
at Request._onResponseBase (file:///C:/Users/kiter/Desktop/ikea/node_modules/got/dist/source/core/index.js:603:22)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Request._onResponse (file:///C:/Users/kiter/Desktop/ikea/node_modules/got/dist/source/core/index.js:645:13) {
input: undefined,
code: 'ERR_NON_2XX_3XX_RESPONSE',
This also gets thrown when i try to use the following code
await ikeaClient.devices.setAttributes({
id: `5dba0600-d190-4d28-868d-fb70837b4973_1`,
attributes: {
motorState: 100
},
})
But im willing to accept that last part as incompetence on my end xd
Wouldnt be the first time. Im hoping you have some insight as to why this wouldnt work, or maybe i can be your test by proxy if you need :))
Heyo, is there no way to query the on/off state of a device?
As of right now im querying all devices from my client and filtering for the ones that are part of the deviceSet that carries the same id as the deviceSet im looking for, then testing their states but this seems awfully janky.
Hello again, figured i would split the issues ive been facing as they seem to be unrelated.
When using the code below (example code from the documentation) i get the error shown below the code.
client.lights.setLightLevel({
id: 'deviceid',
lightLevel: 10,
transitionTime: 5000,
})
Error:
node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^
HTTPError [DirigeraError]: {"error":"Error","message":"\"attributes\" does not match any of the allowed types"}
at Request.<anonymous> (file:///C:/Users/kiter/Desktop/ikea/node_modules/got/dist/source/as-promise/index.js:86:42)
at Object.onceWrapper (node:events:627:26)
at Request.emit (node:events:524:35)
at Request._onResponseBase (file:///C:/Users/kiter/Desktop/ikea/node_modules/got/dist/source/core/index.js:603:22)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Request._onResponse (file:///C:/Users/kiter/Desktop/ikea/node_modules/got/dist/source/core/index.js:645:13) {
input: undefined,
code: 'ERR_NON_2XX_3XX_RESPONSE',
Ill be happy to share more data where needed, but im not sure what you could need. I could of course set this functionality up using my own timer and setting the lightlevel lower every x seconds, but figured this ought to be fixed for other people using the lib.
Experiencing the below error with the following code where the id is taken from the output of client.outlets.list()
await client.outlets.get("b1b61fce-0a25-47f4-8bd2-f604d8a65586_1")
node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^
HTTPError [DirigeraError]: {"error":"Error","message":"invalid device id: undefined"}
at Request.<anonymous> (file:///C:/Users/kiter/Desktop/ikea/node_modules/got/dist/source/as-promise/index.js:86:42)
at Object.onceWrapper (node:events:627:26)
at Request.emit (node:events:524:35)
at Request._onResponseBase (file:///C:/Users/kiter/Desktop/ikea/node_modules/got/dist/source/core/index.js:603:22)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Request._onResponse (file:///C:/Users/kiter/Desktop/ikea/node_modules/got/dist/source/core/index.js:645:13) {
input: undefined,
code: 'ERR_NON_2XX_3XX_RESPONSE',
Hey there
for my final school project I'm making a webpage from where I can control Iot devices but I barely found any documentation on IKEA API. I read through your documentation but I had a hard time telling which parts I could use in my project.
it would really help if you could provide a simple example, including initial configuration and how to set up, e.g., environment variables to open/close the IKEA smart wall socket.
thanks in advance
Heyo!
Ive been messing around with the library and found out that client.devices.setAttributes never takes the transitionTime attribute into consideration. My code is as follows
await client.devices.setAttributes({
id: 'deviceid',
attributes: {"lightLevel": 9, transitionTime: 100000}
})
But the time taken is approximately 1 second regardless of the time provided in transitionTime. I cant seem to figure out any further way to log internal errors, so i hope you are able to point me in the right direction
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.