Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for deerma.humidifier.mjjsq #40

Closed
tehnoinstyle opened this issue Nov 29, 2019 · 130 comments
Closed

Add support for deerma.humidifier.mjjsq #40

tehnoinstyle opened this issue Nov 29, 2019 · 130 comments

Comments

@tehnoinstyle
Copy link

tehnoinstyle commented Nov 29, 2019

Hello. Please, add support for deerma.humidifier.mjjsq

I have such a humidifier (deerma.humidifier.mjjsq). https://ru.aliexpress.com/item/4000056420604.html?spm=a2g0s.9042311.0.0.71e033ed6TUs5o

But I could not add it to the hass.io.

I get the following error:

2019-11-28 22:19:43 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for xiaomi_miio which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant. 2019-11-28 22:19:43 ERROR (MainThread) [custom_components.fan.fan] Unsupported device found! Please create an issue at https://github.com/syssi/xiaomi_airpurifier/issues and provide the following data: **deerma.humidifier.mjjsq**

How do I add it to hass.io? Thanks.

@syssi
Copy link
Owner

syssi commented Nov 30, 2019

The device isn't supported right now.

@tehnoinstyle
Copy link
Author

Hello.

Do you have the opportunity to add support for this model of device? I really need this.
Thanks.

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Nov 30, 2019

maybe this will help add support deerma.humidifier.mjjsq in HA: rytilahti/python-miio#533

and: https://www.bountysource.com/issues/77742487-support-for-mi-smart-humidifier-deerma-humidifier-mjjsq

@syssi
Copy link
Owner

syssi commented Nov 30, 2019

If you provide extensive testing we could give it a try! Do you own a linux host with pip3 installed?

@tehnoinstyle
Copy link
Author

I have very little knowledge of Linux (and in Pyton, etc.).

I have a linux host (Synology NAS). But I do not know what it is pip3 and how to install it. What is it needed pip3 ?

@syssi
Copy link
Owner

syssi commented Nov 30, 2019

You must be able to install python packages. The package manager is called "pip". On some distributions the python3 version is valled pip3. Please install python-miio by:

pip install python-miio

The package provides a command line tool called miiocli. Please make sure you can executre the command line tool and query your device:

$ sudo pip3 install python-miio
Collecting python-miio
  Downloading https://files.pythonhosted.org/packages/ce/d5/03b41ac79cb325f34a5b84875894fd3d1de18628fbb2d915fdb8ee2d6bd8/python_miio-0.4.7-py3-none-any.whl (160kB)
    100% |████████████████████████████████| 163kB 1.8MB/s 
Requirement already satisfied: pytz in /usr/lib/python3/dist-packages (from python-miio) (2019.1)
Collecting construct (from python-miio)
  Using cached https://files.pythonhosted.org/packages/19/c0/f054941fa33d14378de66d2c0477d31f7ad97aa2e298a5771a7b20bc2039/construct-2.9.45.tar.gz
Requirement already satisfied: attrs in /usr/lib/python3/dist-packages (from python-miio) (18.2.0)
Requirement already satisfied: cryptography in /usr/lib/python3/dist-packages (from python-miio) (2.6.1)
Collecting click>=7 (from python-miio)
  Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl
Collecting netifaces (from python-miio)
  Downloading https://files.pythonhosted.org/packages/0d/18/fd6e9c71a35b67a73160ec80a49da63d1eed2d2055054cc2995714949132/netifaces-0.10.9.tar.gz
Collecting tqdm (from python-miio)
  Downloading https://files.pythonhosted.org/packages/bb/62/6f823501b3bf2bac242bd3c320b592ad1516b3081d82c77c1d813f076856/tqdm-4.39.0-py2.py3-none-any.whl (53kB)
    100% |████████████████████████████████| 61kB 5.9MB/s 
Collecting zeroconf (from python-miio)
  Downloading https://files.pythonhosted.org/packages/43/25/b6746049834c7ede865c3a3079d7bdb6f0a3cebdd6997eb916be3a647440/zeroconf-0.24.0-py3-none-any.whl (54kB)
    100% |████████████████████████████████| 61kB 5.5MB/s 
Collecting appdirs (from python-miio)
  Downloading https://files.pythonhosted.org/packages/56/eb/810e700ed1349edde4cbdc1b2a21e28cdf115f9faf263f6bbf8447c1abf3/appdirs-1.4.3-py2.py3-none-any.whl
Collecting ifaddr (from zeroconf->python-miio)
  Downloading https://files.pythonhosted.org/packages/9f/54/d92bda685093ebc70e2057abfa83ef1b3fb0ae2b6357262a3e19dfe96bb8/ifaddr-0.1.6.tar.gz
Building wheels for collected packages: construct, netifaces, ifaddr
  Running setup.py bdist_wheel for construct ... done
  Stored in directory: /root/.cache/pip/wheels/22/73/01/9e7468947349b14ce8f07c3fc7b430b3a4ddad0837cda6ea73
  Running setup.py bdist_wheel for netifaces ... done
  Stored in directory: /root/.cache/pip/wheels/23/8f/f3/7054578f04c904f70757c5c85a6e2823baa69d42365526e93d
  Running setup.py bdist_wheel for ifaddr ... done
  Stored in directory: /root/.cache/pip/wheels/1a/78/2c/a5bbe977f6d91039ddc1d657e780cb55a493aa5d2c0b64637a
Successfully built construct netifaces ifaddr
Installing collected packages: construct, click, netifaces, tqdm, ifaddr, zeroconf, appdirs, python-miio
Successfully installed appdirs-1.4.3 click-7.0 construct-2.9.45 ifaddr-0.1.6 netifaces-0.10.9 python-miio-0.4.7 tqdm-4.39.0 zeroconf-0.24.0

$ miiocli device
Usage: miiocli device [OPTIONS] COMMAND [ARGS]...

Options:
  --ip TEXT     [required]
  --token TEXT  [required]
  --help        Show this message and exit.

Commands:
  info         Get miIO protocol information from the device.
  raw_command  Send a raw command to the device.

$ miiocli device --ip 192.168.130.57 --token b051cd86f85996283d82ccf9d27bd2db info
Model: chuangmi.plug.m1
Hardware version: MW300
Firmware version: 1.2.4_17
Network: {'localIp': '192.168.130.57', 'mask': '255.255.255.0', 'gw': '192.168.130.1'}
AP: {'rssi': -59, 'ssid': 'XXX', 'bssid': 'XXX'}

@syssi
Copy link
Owner

syssi commented Nov 30, 2019

As soon as you are able to talk to your device I will provide some commands / miIO requests. I'm interested in the responses of these requests provided by your device.

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Nov 30, 2019

I have a screenshot from the MiHome application with information about the device (model, token, software version, etc.)

First I have to install the Python3 package on my Synology server. Yes?
Which version?

@syssi
Copy link
Owner

syssi commented Nov 30, 2019

Sorry. I cannot help here. Please make sure you've access to the mentioned command line tool. It could work on windows, too. Python >=3.6 is required. You could use a ubuntu VM, too. On ubuntu you've to install python + pip by:

$ sudo apt-get install python3-pip
$ sudo pip3 install python-miio
$ miiocli device

@tehnoinstyle
Copy link
Author

I'm now reading about installing Python On Windows 10, and if I can install pip3, I will write to you later.
Which version of Python to install: x32 or x64 (laptop with OS Win10Pro x64)
Thanks.

@syssi
Copy link
Owner

syssi commented Nov 30, 2019

It doesn't matter. Take x64.

@tehnoinstyle
Copy link
Author

I was able to install Python 3.8 on a laptop.

But when installing the python-miio, I get the following error:

C:\Users\albina>pip3 install python-miio Collecting python-miio Downloading https://files.pythonhosted.org/packages/ce/d5/03b41ac79cb325f34a5b84875894fd3d1de18628fbb2d915fdb8ee2d6bd8/python_miio-0.4.7-py3-none-any.whl (160kB) |████████████████████████████████| 163kB 726kB/s Collecting cryptography (from python-miio) Downloading https://files.pythonhosted.org/packages/74/e1/6e360b4dbd2a63c1f506402bfa6fa56aa5826337830d8ee86e5e2ec9457b/cryptography-2.8-cp38-cp38-win32.whl (1.3MB) |████████████████████████████████| 1.3MB 939kB/s Collecting attrs (from python-miio) Downloading https://files.pythonhosted.org/packages/a2/db/4313ab3be961f7a763066401fb77f7748373b6094076ae2bda2806988af6/attrs-19.3.0-py2.py3-none-any.whl Collecting appdirs (from python-miio) Downloading https://files.pythonhosted.org/packages/56/eb/810e700ed1349edde4cbdc1b2a21e28cdf115f9faf263f6bbf8447c1abf3/appdirs-1.4.3-py2.py3-none-any.whl Collecting pytz (from python-miio) Downloading https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl (509kB) |████████████████████████████████| 512kB 1.1MB/s Collecting zeroconf (from python-miio) Downloading https://files.pythonhosted.org/packages/43/25/b6746049834c7ede865c3a3079d7bdb6f0a3cebdd6997eb916be3a647440/zeroconf-0.24.0-py3-none-any.whl (54kB) |████████████████████████████████| 61kB 3.8MB/s Collecting tqdm (from python-miio) Downloading https://files.pythonhosted.org/packages/bb/62/6f823501b3bf2bac242bd3c320b592ad1516b3081d82c77c1d813f076856/tqdm-4.39.0-py2.py3-none-any.whl (53kB) |████████████████████████████████| 61kB 3.8MB/s Collecting construct (from python-miio) Downloading https://files.pythonhosted.org/packages/19/c0/f054941fa33d14378de66d2c0477d31f7ad97aa2e298a5771a7b20bc2039/construct-2.9.45.tar.gz (56kB) |████████████████████████████████| 61kB 3.8MB/s Collecting click>=7 (from python-miio) Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB) |████████████████████████████████| 81kB 2.6MB/s Collecting netifaces (from python-miio) Downloading https://files.pythonhosted.org/packages/0d/18/fd6e9c71a35b67a73160ec80a49da63d1eed2d2055054cc2995714949132/netifaces-0.10.9.tar.gz Collecting six>=1.4.1 (from cryptography->python-miio) Downloading https://files.pythonhosted.org/packages/65/26/32b8464df2a97e6dd1b656ed26b2c194606c16fe163c695a992b36c11cdf/six-1.13.0-py2.py3-none-any.whl Collecting cffi!=1.11.3,>=1.8 (from cryptography->python-miio) Downloading https://files.pythonhosted.org/packages/f8/26/5da5cafef77586e4f7a136b8a24bc81fd2cf1ecb71b6ec3998ffe78ea2cf/cffi-1.13.2-cp38-cp38-win32.whl (163kB) |████████████████████████████████| 163kB 1.1MB/s Collecting ifaddr (from zeroconf->python-miio) Downloading https://files.pythonhosted.org/packages/9f/54/d92bda685093ebc70e2057abfa83ef1b3fb0ae2b6357262a3e19dfe96bb8/ifaddr-0.1.6.tar.gz Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography->python-miio) Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB) |████████████████████████████████| 163kB 1.7MB/s Installing collected packages: six, pycparser, cffi, cryptography, attrs, appdirs, pytz, ifaddr, zeroconf, tqdm, construct, click, netifaces, python-miio Running setup.py install for pycparser ... done Running setup.py install for ifaddr ... done Running setup.py install for construct ... done Running setup.py install for netifaces ... error ERROR: Command errored out with exit status 1: command: 'c:\users\albina\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\albina\\AppData\\Local\\Temp\\pip-install-9_4jfu6k\\netifaces\\setup.py'"'"'; __file__='"'"'C:\\Users\\albina\\AppData\\Local\\Temp\\pip-install-9_4jfu6k\\netifaces\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\albina\AppData\Local\Temp\pip-record-dkn_m0k9\install-record.txt' --single-version-externally-managed --compile cwd: C:\Users\albina\AppData\Local\Temp\pip-install-9_4jfu6k\netifaces\ Complete output (5 lines): running install running build running build_ext building 'netifaces' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/ ---------------------------------------- ERROR: Command errored out with exit status 1: 'c:\users\albina\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\albina\\AppData\\Local\\Temp\\pip-install-9_4jfu6k\\netifaces\\setup.py'"'"'; __file__='"'"'C:\\Users\\albina\\AppData\\Local\\Temp\\pip-install-9_4jfu6k\\netifaces\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\albina\AppData\Local\Temp\pip-record-dkn_m0k9\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output. WARNING: You are using pip version 19.2.3, however version 19.3.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.

I have now updated Visual Studio. How do I update the pip? What command is for Windows?
python -m pip install --upgrade pip

@tehnoinstyle
Copy link
Author

now:

`C:\Users\albina>python -m pip install --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl (1.4MB)
|████████████████████████████████| 1.4MB 384kB/s
Installing collected packages: pip
Found existing installation: pip 19.2.3
Uninstalling pip-19.2.3:
Successfully uninstalled pip-19.2.3
Successfully installed pip-19.3.1

C:\Users\albina>pip3 install python-miio
Collecting python-miio
Using cached https://files.pythonhosted.org/packages/ce/d5/03b41ac79cb325f34a5b84875894fd3d1de18628fbb2d915fdb8ee2d6bd8/python_miio-0.4.7-py3-none-any.whl
Collecting netifaces
Using cached https://files.pythonhosted.org/packages/0d/18/fd6e9c71a35b67a73160ec80a49da63d1eed2d2055054cc2995714949132/netifaces-0.10.9.tar.gz
Requirement already satisfied: click>=7 in c:\users\albina\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (7.0)
Requirement already satisfied: zeroconf in c:\users\albina\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (0.24.0)
Requirement already satisfied: attrs in c:\users\albina\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (19.3.0)
Requirement already satisfied: pytz in c:\users\albina\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (2019.3)
Requirement already satisfied: tqdm in c:\users\albina\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (4.39.0)
Requirement already satisfied: construct in c:\users\albina\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (2.9.45)
Requirement already satisfied: cryptography in c:\users\albina\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (2.8)
Requirement already satisfied: appdirs in c:\users\albina\appdata\local\programs\python\python38-32\lib\site-packages (from python-miio) (1.4.3)
Requirement already satisfied: ifaddr in c:\users\albina\appdata\local\programs\python\python38-32\lib\site-packages (from zeroconf->python-miio) (0.1.6)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in c:\users\albina\appdata\local\programs\python\python38-32\lib\site-packages (from cryptography->python-miio) (1.13.2)
Requirement already satisfied: six>=1.4.1 in c:\users\albina\appdata\local\programs\python\python38-32\lib\site-packages (from cryptography->python-miio) (1.13.0)
Requirement already satisfied: pycparser in c:\users\albina\appdata\local\programs\python\python38-32\lib\site-packages (from cffi!=1.11.3,>=1.8->cryptography->python-miio) (2.19)
Installing collected packages: netifaces, python-miio
Running setup.py install for netifaces ... done
Successfully installed netifaces-0.10.9 python-miio-0.4.7`

@syssi
Copy link
Owner

syssi commented Nov 30, 2019

Looks good to me.

@tehnoinstyle
Copy link
Author

now - device OFF state:
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d info ERROR:miio.device:Unable to discover a device at address 192.168.1.204 Error: Unable to discover the device 192.168.1.204

device ON state:
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d info ERROR:miio.device:Unable to discover a device at address 192.168.1.204 Error: Unable to discover the device 192.168.1.204

What's my error?

@syssi
Copy link
Owner

syssi commented Nov 30, 2019

Are you sure your token is still valid? Did you reset the device in the meantime? The "info" command should respond everytime if the device is available (pingable).

@syssi
Copy link
Owner

syssi commented Nov 30, 2019

You should disable your firewall. May be the UDP traffic is blocked?

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Nov 30, 2019

Yes, token is still valid. But:

`C:\Users\albina>ping 192.168.1.204

Packet exchange from 192.168.1.204 to with 32 bytes of data:
Reply from 192.168.1.200: The specified node is unavailable.
Reply from 192.168.1.200: The specified node is unavailable.
Reply from 192.168.1.200: The specified node is unavailable.
Reply from 192.168.1.200: The specified node is unavailable.

Ping statistics for 192.168.1.204:
     Packets: sent = 4, received = 4, lost = 0
     (0% loss)`

Both device (laptpop and deerma) connect to router Mikrotik (WiFi).

@tehnoinstyle
Copy link
Author

ip 192.168.1.200 - laptpop.

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Nov 30, 2019

Yes, now I disable my firewall:

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d info
Model: deerma.humidifier.mjjsq
Hardware version: ESP8266
Firmware version: 1.4.0
Network: {'localIp': '192.168.1.204', 'mask': '255.255.255.0', 'gw': '192.168.1.1'}
AP: {'rssi': -57, 'ssid': 'Temponary', 'bssid': 'B8:69:F4:C7:12:CD'}

@syssi
Copy link
Owner

syssi commented Nov 30, 2019

Perfect!

@tehnoinstyle
Copy link
Author

Now what? Is it possible to add this humidifier to HA?
That would be very good !!!

@syssi
Copy link
Owner

syssi commented Nov 30, 2019

I need the output/responses of the follow commands. I need this informations to extend python-miio and to extend this HA component.

# Query all status properties
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

### Set_OnOff

# Turn the device on
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_OnOff "[1]"

# Query all status properties again
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Turn the device off
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_OnOff "[0]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Turn the device on
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_OnOff "[1]"

### SetLedState

# Turn the status LED on
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d SetLedState "[1]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Turn the status LED off
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d SetLedState "[0]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

### SetTipSound_Status

# Turn beep on key press on
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d SetTipSound_Status "[1]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Turn beep on key press off
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d SetTipSound_Status "[0]"

### Set_HumidifierGears

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set speed: Low
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumidifierGears "[1]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set speed: Medium
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumidifierGears "[2]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set speed: High
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumidifierGears "[3]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set speed: Humidity (what does this mean??)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumidifierGears "[4]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Try to set invalid speed value 5
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumidifierGears "[5]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Try to set invalid speed value 0
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumidifierGears "[0]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set speed: Low
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumidifierGears "[1]"


### Set_HumiValue

# Set target humidity to 0%
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumiValue "[0]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set target humidity to 25%
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumiValue "[25]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set target humidity to 50%
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumiValue "[50]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set target humidity to 75%
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumiValue "[75]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set target humidity to 100%
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumiValue "[100]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set invalid target humidity 110%
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d Set_HumiValue "[110]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Nov 30, 2019

error:
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"
`Usage: miiocli device [OPTIONS] COMMAND [ARGS]...
Try "miiocli device --help" for help.

Error: Unknown command (get_prop)`

@syssi
Copy link
Owner

syssi commented Nov 30, 2019

Ups. I missed a parameter. Please try the updated commands:

I need the output/responses of the follow commands. I need this informations to extend python-miio and to extend this HA component.

# Query all status properties
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

### Set_OnOff

# Turn the device on
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_OnOff "[1]"

# Query all status properties again
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Turn the device off
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_OnOff "[0]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Turn the device on
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_OnOff "[1]"

### SetLedState

# Turn the status LED on
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command SetLedState "[1]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Turn the status LED off
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command SetLedState "[0]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

### SetTipSound_Status

# Turn beep on key press on
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command SetTipSound_Status "[1]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Turn beep on key press off
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command SetTipSound_Status "[0]"

### Set_HumidifierGears

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set speed: Low
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[1]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set speed: Medium
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[2]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set speed: High
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[3]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set speed: Humidity (what does this mean??)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[4]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Try to set invalid speed value 5
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[5]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Try to set invalid speed value 0
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[0]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set speed: Low
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[1]"


### Set_HumiValue

# Set target humidity to 0%
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumiValue "[0]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set target humidity to 25%
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumiValue "[25]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set target humidity to 50%
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumiValue "[50]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set target humidity to 75%
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumiValue "[75]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set target humidity to 100%
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumiValue "[100]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# Set invalid target humidity 110%
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumiValue "[110]"

# Query all status properties again(!)
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Nov 30, 2019

Yes, I already understood. I got it:

# Query all status properties

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [4]

### Set_OnOff

# Turn the device on
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_OnOff "[1]" Running command raw_command ['ok']

# Query all status properties again
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [4]

# Turn the device off
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_OnOff "[0]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [4]

# Turn the device on
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_OnOff "[1]" Running command raw_command ['ok']

### SetLedState

# Turn the status LED on
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command SetLedState "[1]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [4]

# Turn the status LED off
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command SetLedState "[0]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [4]

### SetTipSound_Status

# Turn beep on key press on
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command SetTipSound_Status "[1]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [4]

# Turn beep on key press off
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command SetTipSound_Status "[0]" Running command raw_command ['ok']

### Set_HumidifierGears

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [4]

# Set speed: Low
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[1]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [1]

# Set speed: Medium
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[2]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [2]

# Set speed: High
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[3]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [3]

# Set speed: Humidity (what does this mean??)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[4]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [4]

# Try to set invalid speed value 5
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[5]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [5]

Device turn OFF

I turned it on again

# Try to set invalid speed value 0
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[0]" Running command raw_command ['ok']

not selecting HumidifierGears in MiHome app

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [0]

# Set speed: Low
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumidifierGears "[1]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [1]

### Set_HumiValue

# Set target humidity to 0%
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumiValue "[0]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [1]

# Set target humidity to 25%
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumiValue "[25]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [1]

# Set target humidity to 50%
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumiValue "[50]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [1]

# Set target humidity to 75%
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumiValue "[75]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [1]

# Set target humidity to 100%
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumiValue "[100]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [1]

# Set invalid target humidity 110%
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command Set_HumiValue "[110]" Running command raw_command ['ok']

# Query all status properties again(!)
C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [1]

It's all.

@syssi
Copy link
Owner

syssi commented Dec 1, 2019

It looks like it not possible to query all properties at once. Could you execute all commands again? Please replace this command

miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']"

# by

miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear']"
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidity_Value']"
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['HumiSet_Value']"
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Led_State']"
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['OnOff_State']"
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['TemperatureValue']"
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['TipSound_State']"
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['waterstatus']"
miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['watertankstatus']"

I want to make sure every command works fine and updates the internal state of the device.

@tehnoinstyle
Copy link
Author

Hello. Thank you for your help.

I will execute all the commands again, but a little later. I'm not near the laptop right now. I will let you know. Thanks.

@syssi
Copy link
Owner

syssi commented Dec 1, 2019

Take your time.

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Dec 1, 2019

Should I complete to run list all commands?

And after each command, check with this list of commands?

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d info Model: deerma.humidifier.mjjsq Hardware version: ESP8266 Firmware version: 1.4.0 Network: {'localIp': '192.168.1.204', 'mask': '255.255.255.0', 'gw': '192.168.1.1'} AP: {'rssi': -55, 'ssid': 'Temponary', 'bssid': 'B8:69:F4:C7:12:CD'}

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear','Humidity_Value','HumiSet_Value','Led_State','OnOff_State','TemperatureValue','TipSound_State','waterstatus','watertankstatus']" Running command raw_command [4]

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidifier_Gear']" Running command raw_command [4]

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Humidity_Value']" Running command raw_command [44]

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['HumiSet_Value']" Running command raw_command [54]

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['Led_State']" Running command raw_command [1]

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['OnOff_State']" Running command raw_command [0]

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['TemperatureValue']" Running command raw_command [21]

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['TipSound_State']" Running command raw_command [1]

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['waterstatus']" Running command raw_command [1]

C:\Users\albina>miiocli device --ip 192.168.1.204 --token 1759ffeef59e788e2794e6d3632a554d raw_command get_prop "['watertankstatus']" Running command raw_command [1]

@tehnoinstyle
Copy link
Author

port 8124 closed. I can’t open the port remotely (router settings). Only from the local network. I can only check in the evening.

@tehnoinstyle
Copy link
Author

in UI, in dev-panel:

fan.xiaomi_air_humidifier

@syssi
Copy link
Owner

syssi commented Dec 13, 2019

Perfect. Please add

sensor:
  - platform: template
    sensors:
      airhumidifier_temperature:
        friendly_name: Air Humidifier Temperature
        value_template: '{{ states.fan.xiaomi_air_humidifier.attributes.temperature }}'
      airhumidifier_humidity:
        friendly_name: Air Humidifier Humidity
        value_template: '{{ states.fan.xiaomi_air_humidifier.attributes.humidity }}'

to your configuration.yaml. A sensor called "sensor.airhumidifier_temperature" and "sensor.airhumidifier_humidity" will be available after a restart.

@tehnoinstyle
Copy link
Author

Yes! Now there are two sensors: temperature and humidity.

@tehnoinstyle
Copy link
Author

Is it possible to add the target_humidity sensor in the same way?

sensor:
  - platform: template
    sensors:
      airhumidifier_temperature:
        friendly_name: Air Humidifier Temperature
        value_template: '{{ states.fan.xiaomi_air_humidifier.attributes.temperature }}'
      airhumidifier_humidity:
        friendly_name: Air Humidifier Humidity
        value_template: '{{ states.fan.xiaomi_air_humidifier.attributes.humidity }}'
      airhumidifier_target_humidity:
        friendly_name: Air Humidifier Target Humidity
        value_template: '{{ states.fan.xiaomi_air_humidifier.attributes.target_humidity }}'

Thanks.

@syssi
Copy link
Owner

syssi commented Dec 13, 2019

Yes. Please read the manual of the sensor template.

@tehnoinstyle
Copy link
Author

Yes, it's working.

@tehnoinstyle
Copy link
Author

Now:

sensor:
  - platform: template
    sensors:
      airhumidifier_temperature:
        friendly_name: Air Humidifier Temperature
        value_template: '{{ states.fan.xiaomi_air_humidifier.attributes.temperature }}'
        unit_of_measurement: "°C"
      airhumidifier_humidity:
        friendly_name: Air Humidifier Humidity
        value_template: '{{ states.fan.xiaomi_air_humidifier.attributes.humidity }}'
        unit_of_measurement: "%"
      airhumidifier_target_humidity:
        friendly_name: Air Humidifier Target Humidity
        value_template: '{{ states.fan.xiaomi_air_humidifier.attributes.target_humidity }}'
        unit_of_measurement: "%"

@anhnvme
Copy link
Contributor

anhnvme commented Dec 13, 2019

Please update the component again. I've removed the unavailable attributes:

trans level -
button pressed -
child lock -
led brightness -
use time -
hardware version -

awsome O_O, it's working perfectlyyyyy. thank you so much. wish you best <3

@tehnoinstyle
Copy link
Author

Fine. Please test the different services to make sure operation mode, buzzer, led and target humidity can be controlled.

I test buzzer, led - its work fine. How to test mode and target humidity?

@tehnoinstyle
Copy link
Author

How to test set_target_humidity ?
In Services:
fan.xiaomi_miio_set_target_humidity
And then?

@anhnvme
Copy link
Contributor

anhnvme commented Dec 14, 2019

How to test set_target_humidity ?
In Services:
fan.xiaomi_miio_set_target_humidity
And then?

call in service at hass

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Dec 14, 2019

Example:
In Services:

fan.xiaomi_miio_set_target_humidity
55

I got error.

Maybe I'm not doing the right command?

@syssi
Copy link
Owner

syssi commented Dec 14, 2019

The value should be "target_humidity: 55".

@tehnoinstyle
Copy link
Author

got error:

extra keys not allowed @ data['target_humidity']
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1213, in async_call
    processed_data = handler.schema(service_data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['target_humidity']

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Dec 14, 2019

may be needed
fan.xiaomi_miio_set_target_humidity
entity_id: fan.xiaomi_air_humidifier
target_humidity: 55

P.S. Not, the same error:

extra keys not allowed @ data['target_humidity']
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 133, in handle_call_service
    connection.context(msg),
  File "/usr/src/homeassistant/homeassistant/core.py", line 1213, in async_call
    processed_data = handler.schema(service_data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: extra keys not allowed @ data['target_humidity']

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Dec 17, 2019

Hello, Sebastian.

The value should be "target_humidity: 55".

Is the value as it should be, in double quotes?

"target_humidity: 55"

If not, then I get an error, as in my post above.

@syssi
Copy link
Owner

syssi commented Dec 17, 2019

How do you call the service?

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Dec 17, 2019

In Services I choose:
fan.xiaomi_miio_set_target_humidity
and lower I add value
target_humidity: 55
but got error.

may be value should be, in double quotes?
"target_humidity: 55"

@tehnoinstyle
Copy link
Author

not, I get an error.

maybe I'm doing something wrong?

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Dec 17, 2019

screenshot call the service:
https://photos.app.goo.gl/PEwNqV6GSMZeETd29

@syssi
Copy link
Owner

syssi commented Dec 18, 2019

@syssi
Copy link
Owner

syssi commented Dec 18, 2019

Please update the custom component. Humidity values between 0 and 99 are allowed now.

@tehnoinstyle
Copy link
Author

Ok. you updated it?

Target humidity. Allowed values are 30, 40, 50, 60, 70 and 80

@tehnoinstyle
Copy link
Author

tehnoinstyle commented Dec 18, 2019

Yes, now it works!

And service fan.set_speed work correct. Thank you very much.

@syssi
Copy link
Owner

syssi commented Dec 18, 2019

Yes. I've updated the README, too.

@tehnoinstyle
Copy link
Author

Ok. Thanks.

@tehnoinstyle
Copy link
Author

Hello, Sebastian. Happy New Year.
I have a question. I created Automation for the humidifier.

- id: '1577970260472'
  alias: Run Humidifier ON to AUTO 60%
  description: Включение увлажнителя в режим АВТО, заданная влажность 60%
  trigger:
  - below: '45'
    entity_id: sensor.airhumidifier_humidity
    for: 00:05:00
    platform: numeric_state
  condition:
  - condition: state
    entity_id: fan.xiaomi_air_humidifier
    state: 'off'
  action:
  - entity_id: fan.xiaomi_air_humidifier
    service: fan.turn_on
  - delay: 00:00:02
  - data:
      speed: humidity
    entity_id: fan.xiaomi_air_humidifier
    service: fan.set_speed
  - delay: 00:00:05
  - data:
      humidity: 60
    service: fan.xiaomi_miio_set_target_humidity

When Automation is triggered, the following error appears in the log:

Update of fan.xiaomi_air_humidifier is taking over 10 seconds
18:11 __main__.py (WARNING) - the first message was received on January 2, 2020, 15:46 and was repeated 4 times

Fri Jan 03 2020 18:11:32 GMT + 0200 (Eastern Europe, standard time)
Update of fan.xiaomi_air_humidifier is taking over 10 seconds

This message appears after the Automation has been starting.
What does it mean? Maybe you need to increase the Delay in Automation? For example, 11 or 12 seconds?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants