nt0xa / homebridge-mi-humidifier

A Xiaomi Mi humidifier plugin for Homebridge
MIT License
64 stars 24 forks source link

deerma.humidifier.mjjsq ZNJSQ01DEM EU global version #106

Closed michalidesko closed 2 years ago

michalidesko commented 2 years ago

Hi, i cant run my humidifier ZNJSQ01DEM EU (global version) can you please add support? I use Homebridge Raspberry Pi Image on Raspberry Pi zero WH. (all updated)

[12/3/2021, 9:29:13 AM] [homebridge-mi-humidifier] This plugin generated a warning from the characteristic 'Current Relative Humidity': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info. [12/3/2021, 9:29:13 AM] [homebridge-mi-humidifier] This plugin generated a warning from the characteristic 'Water Level': characteristic value expected valid finite number and received "NaN" (number). See https://git.io/JtMGR for more info. [12/3/2021, 9:29:13 AM] [homebridge-mi-humidifier] This plugin generated a warning from the characteristic 'Relative Humidity Humidifier Threshold': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info. [12/3/2021, 9:29:13 AM] [homebridge-mi-humidifier] This plugin generated a warning from the characteristic 'Current Relative Humidity': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info.

[12/3/2021, 9:35:27 AM] [MiHumidifier] [192.168.31.20] Fail to get device properties. SocketError: Timeout [12/3/2021, 9:35:57 AM] [MiHumidifier] [192.168.31.20] Fail to get device properties. SocketError: Timeout

or i am wrong? { "devices": [ { "disabled": false, "name": "Humidifier", "address": "192.168........", "token": "b9755balbalblalbalbabalblalbal4442423", "model": "deerma.humidifier.mjjsq", "updateInterval": 30, "autoSwitchToHumidityMode": false, "disableTargetHumidity": false, "temperatureSensor": { "enabled": false, "name": "Temperature" }, "humiditySensor": { "enabled": true, "name": "Humidity" }, "ledBulb": { "enabled": false, "name": "Led" }, "buzzerSwitch": { "enabled": false, "name": "Buzzer" }, "cleanModeSwitch": { "enabled": false, "name": "Clean Mode" } } ], "platform": "MiHumidifier" }

Thank you for help!

Charliecheung2 commented 2 years ago

When I checked is that deerma.humidifier.mjjsq is the basic model, I don't think it suits your humidifier. I will recommand you to check the model by checking their token. I am using this app image

Charliecheung2 commented 2 years ago

you should try using deerma.humidifier.mjjsq @michalidesko

101

michalidesko commented 2 years ago

Hi thanks for reply! I try all in "model": I know my device token. I have this https://github.com/russtone/homebridge-mi-humidifier#mijia-smart-sterilization-humidifier-s and my model is ZNJSQ01DEM on the bottom device ZNJSQ01DEM. (dont work with chinese mainland server in Mi Home app, it is EU (global version)) I get mi devices tokens by https://github.com/Maxmudjon/Get_MiHome_devices_token app show this model deerma.humidifier.jsq

Charliecheung2 commented 2 years ago

you should try using deerma.humidifier.mjjsq @michalidesko #101

Hi thanks for reply! I try all in "model": I know my device token. I have this https://github.com/russtone/homebridge-mi-humidifier#mijia-smart-sterilization-humidifier-s and my model is ZNJSQ01DEM on the bottom device ZNJSQ01DEM. (dont work with chinese mainland server in Mi Home app, it is EU (global version)) I get mi devices tokens by https://github.com/Maxmudjon/Get_MiHome_devices_token app show this model deerma.humidifier.jsq

sorry, typo, you should use deerma.humidifier.jsq5, see the link 101 I mentioned, exact model no, and it is supported

michalidesko commented 2 years ago

in homebridge-mi-humidifier v2.4.3 settings i dont see option ..jsq5 so i changed it in config.json, but same result.

Charliecheung2 commented 2 years ago

in homebridge-mi-humidifier v2.4.3 settings i dont see option ..jsq5 so i changed it in config.json, but same result.

It is not on the config web, but jqs5 is support for sure, I check the code.

michalidesko commented 2 years ago

yes jsq5 it is supported. I dont see support error log. But not working.. Thanks!

Charliecheung2 commented 2 years ago

try jsqs, they are almost identical

{
    "platform": "MiHumidifier",
    "devices": [{
        "disabled": false,
        "name": "Humidifier",
        "address": "192.168........",
        "token": "b9755balbalblalbalbabalblalbal4442423",
        "model": "deerma.humidifier.jsqs",
        "updateInterval": 30,
        "autoSwitchToHumidityMode": false,
        "disableTargetHumidity": false,
        "temperatureSensor": {
            "enabled": false,
            "name": "Temperature"
        },
        "humiditySensor": {
            "enabled": true,
            "name": "Humidity"
        },
        "ledBulb": {
            "enabled": false,
            "name": "Led"
        },
        "buzzerSwitch": {
            "enabled": false,
            "name": "Buzzer"
        },
        "cleanModeSwitch": {
            "enabled": false,
            "name": "Clean Mode"
        }
    }]
}
michalidesko commented 2 years ago

same result with "model": "deerma.humidifier.jsqs", [12/13/2021, 9:14:28 AM] [MiHumidifier] [192.168.31.20] Fail to set device property "power". SocketError: Timeout [12/13/2021, 9:14:29 AM] [homebridge-mi-humidifier] This plugin generated a warning from the characteristic 'Current Relative Humidity': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info. [12/13/2021, 9:14:29 AM] [homebridge-mi-humidifier] This plugin generated a warning from the characteristic 'Relative Humidity Humidifier Threshold': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info. [12/13/2021, 9:14:29 AM] [homebridge-mi-humidifier] This plugin generated a warning from the characteristic 'Current Relative Humidity': characteristic value expected valid finite number and received "undefined" (undefined). See https://git.io/JtMGR for more info.

nikjuice commented 2 years ago

Hi! I also got exactly the same problem with "deerma.humidifier.jsq5". Running homebridge on macOS Monteray.

Some details about the device:

miiocli device --ip 192.168.0.115 --token b925354f90fc9d628e9eb555f11829f7 info Model: deerma.humidifier.jsq5 Hardware version: esp8266 Firmware version: 2.1.3

image

nt0xa commented 2 years ago

Hey @michalidesko @nikjuice,

Could you please collect debug logs? You can do it by running homebridge like this:

DEBUG=miio-api* homebridge -D
nikjuice commented 2 years ago

Hey @russtone , thanks for quick feedback. I just have tried and as it usually happens, it started to work. I believe that switching it off/on several times from outlet helps. Strange things that it responded on miiocli commands previously and in the same time got socket error for homeb. ridge. But it seems it was some glitch for me.

michalidesko commented 2 years ago

I have testing version on macbook too. deerma.humidifier.jsqs: [12. 1. 2022, 22:17:32] Got SIGTERM, shutting down Homebridge... miio-api:192.168.31.20:9ybtdt8u <- miio-api:192.168.31.20:9ybtdt8u 0000 21 31 00 20 00 00 00 00 0e c2 16 80 00 1e 71 93 miio-api:192.168.31.20:9ybtdt8u 0010 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff +202ms miio-api:192.168.31.20:9ybtdt8u <- Packet { miio-api:192.168.31.20:9ybtdt8u deviceId: 247600768, miio-api:192.168.31.20:9ybtdt8u timestamp: 1995155, miio-api:192.168.31.20:9ybtdt8u checksum: , miio-api:192.168.31.20:9ybtdt8u data: , miio-api:192.168.31.20:9ybtdt8u unknown: 0 miio-api:192.168.31.20:9ybtdt8u } +0ms [12. 1. 2022, 22:17:32] [MiHumidifier] [192.168.31.20] Removing characteristic 00000052-0000-1000-8000-0026BB765291 miio-api:192.168.31.20:qtgpa5df -> { miio-api:192.168.31.20:qtgpa5df id: 347462218, miio-api:192.168.31.20:qtgpa5df method: 'get_properties', miio-api:192.168.31.20:qtgpa5df params: [ miio-api:192.168.31.20:qtgpa5df { did: 'power', value: null, siid: 2, piid: 1 }, miio-api:192.168.31.20:qtgpa5df { did: 'fan_level', value: null, siid: 2, piid: 5 }, miio-api:192.168.31.20:qtgpa5df { did: 'water_level', value: null, siid: 7, piid: 1 }, miio-api:192.168.31.20:qtgpa5df { did: 'relative_humidity', value: null, siid: 3, piid: 1 }, miio-api:192.168.31.20:qtgpa5df { did: 'target_humidity', value: null, siid: 2, piid: 6 } miio-api:192.168.31.20:qtgpa5df ] miio-api:192.168.31.20:qtgpa5df } +0ms miio-api:192.168.31.20:qtgpa5df -> Packet { miio-api:192.168.31.20:qtgpa5df deviceId: 247600768, miio-api:192.168.31.20:qtgpa5df timestamp: 1995155 .....

and deerma.humidifier.jsq5: [12. 1. 2022, 22:31:45] Got SIGTERM, shutting down Homebridge... miio-api:192.168.31.20:89nn3bv4 <- miio-api:192.168.31.20:89nn3bv4 0000 21 31 00 20 00 00 00 00 0e c2 16 80 00 1e 74 e8 miio-api:192.168.31.20:89nn3bv4 0010 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff +225ms miio-api:192.168.31.20:89nn3bv4 <- Packet { miio-api:192.168.31.20:89nn3bv4 deviceId: 247600768, miio-api:192.168.31.20:89nn3bv4 timestamp: 1996008, miio-api:192.168.31.20:89nn3bv4 checksum: , miio-api:192.168.31.20:89nn3bv4 data: , miio-api:192.168.31.20:89nn3bv4 unknown: 0 miio-api:192.168.31.20:89nn3bv4 } +1ms [12. 1. 2022, 22:31:45] [MiHumidifier] [192.168.31.20] Removing characteristic 00000052-0000-1000-8000-0026BB765291 [12. 1. 2022, 22:31:45] [MiHumidifier] [192.168.31.20] Removing characteristic 000000A7-0000-1000-8000-0026BB765291 miio-api:192.168.31.20:7w86g8on -> { miio-api:192.168.31.20:7w86g8on id: 745809527, miio-api:192.168.31.20:7w86g8on method: 'get_properties', miio-api:192.168.31.20:7w86g8on params: [ miio-api:192.168.31.20:7w86g8on { did: 'power', value: null, siid: 2, piid: 1 }, miio-api:192.168.31.20:7w86g8on { did: 'fan_level', value: null, siid: 2, piid: 5 }, miio-api:192.168.31.20:7w86g8on { did: 'water_level', value: null, siid: 7, piid: 1 }, miio-api:192.168.31.20:7w86g8on { did: 'relative_humidity', value: null, siid: 3, piid: 1 }, miio-api:192.168.31.20:7w86g8on { did: 'target_humidity', value: null, siid: 2, piid: 6 } miio-api:192.168.31.20:7w86g8on ] miio-api:192.168.31.20:7w86g8on } +0ms miio-api:192.168.31.20:7w86g8on -> Packet { miio-api:192.168.31.20:7w86g8on deviceId: 247600768, miio-api:192.168.31.20:7w86g8on timestamp: 1996008 ....

nt0xa commented 2 years ago

@michalidesko Could you check device using miiocli utility?

pip3 install python-miio
miiocli device --ip <ip> --token <token> info
michalidesko commented 2 years ago

pip3 install python-miio works. but MBP:~ macpro$ miiocli device --ip 192.168.31.20 --token b975590a962bef28fd40d478fd4f7989 info -bash: miiocli: command not found

nikjuice commented 2 years ago

Have you tried to restart the terminal?

michalidesko commented 2 years ago

I installed brew, then updated python.. now become

MBP:~ macpro$ miiocli device --ip 192.168.31.20 --token b975590a962bef28fd40d478fd4f7989 info ERROR:miio.miioprotocol:Got error when receiving: timed out Error: No response from the device

nt0xa commented 2 years ago

Looks like your token is invalid. How did you get it? I recommend using this guide https://github.com/Maxmudjon/com.xiaomi-miio/blob/master/docs/obtain_token.md

michalidesko commented 2 years ago

Yes this is how i get tokenns. https://github.com/Maxmudjon/Get_MiHome_devices_token/releases Another devices tokens like Mi Smart Plug or Roborock works.

michalidesko commented 2 years ago

oh try loged with my another acount where Is Humidifier added and become another token. weird :) MBP:~ macpro$ miiocli device --ip 192.168.31.20 --token e7e9a0252ab41c84186877bbfccbc899 info Model: deerma.humidifier.jsq Hardware version: esp8266 Firmware version: 2.0.7

michalidesko commented 2 years ago

Solved! It was wrong token. My fault :( I become token from my account where never humidifier worked, because of EU version on Mainland China server. (I just try connect once) On another account with EU server where humidifier is connected, i become another working Token. Now all works with model set to: deerma.humidifier.mjjsq Thank you for support!

nt0xa commented 2 years ago

You are welcome! Glad you got it working :)