Comments (6)
If you check the message
property of the error what does it say? I The code -5001 is invalid argument.
If the humidifier is similar to the air purifiers the led brightness is actually a number. The air purifiers use 0 = bright, 1 = dim, 2 = off.
from miio.
You are correct the current LED status on my unit is: 2
I still receive the error message when attempting to send the command through miio.
The only commands I can't send are to those with the additional _ in the name.
set_led_b
return device.call('set_power', ['on']) works fine
from miio.
The humidifier might do something special here. Could you run your code while setting the environment flag DEBUG
to miio*
? Something like this: DEBUG=miio* node pathtoscript.js
You should get lots of debug information about data sent and received, the bit from where you can see some JSON with your call until you get some other JSON as a reply can help with figuring out what's going wrong.
from miio.
This is interesting, 2 is the current known state of the LED from the device status, yet it rejected it:
miio.device.[192.168.0.95] -> (2) {"id":1,"method":"set_led_b","params":["2"]}
miio.device.[192.168.0.95] <- Message: `{"error":{"code":-5001,"message":"invaild_arg"},"id":1}
from miio.
BINGO, got it working :)
return device.call('set_led_b', [JSON.parse('2')])
I'll update the humidifier doc once I've tested the remaining options.
from miio.
Alright! Looks like you were sending a string when the device wants a number. Most of the Mi devices are picky about that.
In the current master
there is some new documentation and a device implementation to make interacting with the humidifier easier. Such as being able to call device.setLedBrightness('off')
instead of using call
directly.
When you know what the other options do you can open an issue and describe what you found or try to add it to the implementation in lib/devices/humidifier.js
.
from miio.
Related Issues (20)
- Not enough non-option arguments: got 0, need at least 1 error Command failed with exit code 1.
- Xiaomi Air Monitor cgllc.airm.cgdn1
- yeelight strip plus is supported?
- Canβt find Hub / Temperature-Sensors
- yeelink.light.color5 HOT 1
- Mi Smart LED Bulb (B22) - Support
- yeelink.light.mono6 HOT 1
- [add device request] yeelink.light.ceilb
- [add device request] yeelink.light.colorb
- -Bash: miio: command not found HOT 1
- doesn't work on Firmware version: 3.2.10
- Cannot connect to light after configuring wireless network HOT 1
- yeelink.light.bslamp2 HOT 2
- Create device with lib version >= 0.15.0
- Which devices can get tokens by "miio discover" or "mirobo discover --handshake 1"?
- Does this packge still getting maintained?
- Roborock S6 - 3.5.8._2902 - unsupported device
- colorTemperature2rgbUsingTH is not defined
- Device support [Vacum mop 2 ultra]
- Error connecting to device: Error: Call to device timed out
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 miio.