merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
388 stars 61 forks source link

New Device: viomi.health_pot.v1 Multipurpose Kettle MJYSH01YM #176

Closed DJay-X closed 2 years ago

DJay-X commented 2 years ago

Hi @merdok If possible, it would be great to have the viomi.health_pot.v1 Mijia Smart Multipurpose Wi-Fi Kettle MJYSH01YM via your Plugin in HomeKit.

https://home.miot-spec.com/spec?type=urn%3Amiot-spec-v2%3Adevice%3Ahealth-pot%3A0000A051%3Aviomi-v1%3A1

On, off, Temperature and reflecting the status when using the device manually would be fantastic.

If you need anything I can help to support, please of course let me know. Currently, I am using https://github.com/ch3rn1k/homebridge-multipurpose-kettle

merdok commented 2 years ago

Hi, that should be possible. I see that this as a kettle device and i will try to include it in the upcoming update!

merdok commented 2 years ago

Support is now added in version 1.0.0! Although this is a very special device and was kind of hard to include it as an kettle, please let me know how it works!

DJay-X commented 2 years ago

Thanks @merdok

Unfortunately I get this error and homebridge crash.

[2/2/2022, 11:17:21 AM] [miot] [Kettle] Setting up miot device!
[2/2/2022, 11:17:21 AM] [miot] [Kettle] Device requires MiCloud! Trying to connect!
[2/2/2022, 11:17:21 AM] [miot] [Kettle] Successfully connected to MiCloud!
[2/2/2022, 11:17:21 AM] [miot] [Kettle] Getting device info from MiCloud!
[2/2/2022, 11:17:24 AM] [miot] [Kettle] Device setup finished! Miot device ready!
[2/2/2022, 11:17:24 AM] [miot] [Kettle] [Miot Device] Connected to device: viomi.health_pot.v1
[2/2/2022, 11:17:24 AM] [miot] [Kettle] Setup failed!
[2/2/2022, 11:17:24 AM] [miot] [Kettle] TypeError: Cannot read properties of null (reading 'hasValueRange')
[2/2/2022, 11:17:24 AM] TypeError: Cannot read properties of null (reading 'hasValueRange')
    at ViomiHealth_potV1.getPropertyValueRange (/homebridge/node_modules/homebridge-miot/lib/base/BaseDevice.js:348:14)
    at ViomiHealth_potV1.targetTemperatureRange (/homebridge/node_modules/homebridge-miot/lib/modules/generic/GenericDevice.js:369:22)
    at KettleAccessory.getKettleHeatingThresholdTemperature (/homebridge/node_modules/homebridge-miot/lib/modules/kettle/KettleAccessory.js:169:29)
    at KettleAccessory.updateAccessoryStatus (/homebridge/node_modules/homebridge-miot/lib/modules/kettle/KettleAccessory.js:189:139)
    at ViomiHealth_potV1.updateAccessoryStatus (/homebridge/node_modules/homebridge-miot/lib/base/BaseDevice.js:231:54)
    at MiotDevice.<anonymous> (/homebridge/node_modules/homebridge-miot/lib/base/BaseDevice.js:71:12)
    at MiotDevice.emit (node:events:390:28)
    at MiotDevice._disconnect (/homebridge/node_modules/homebridge-miot/lib/protocol/MiotDevice.js:309:10)
    at MiotDevice._reconnect (/homebridge/node_modules/homebridge-miot/lib/protocol/MiotDevice.js:313:10)
    at MiotDevice._deviceFound (/homebridge/node_modules/homebridge-miot/lib/protocol/MiotDevice.js:286:14)
[2/2/2022, 11:17:24 AM] Got SIGTERM, shutting down Homebridge...
[2/2/2022, 11:17:29 AM] [HB Supervisor] Homebridge Process Ended. Code: 143, Signal: null
                {
                    "name": "Kettle",
                    "ip": "xxx.xxx.xxx.xx",
                    "token": "xxxxxxx",
                    "deviceId": "xxxxxxxxx",
                    "model": "viomi.health_pot.v1",
                    "pollingInterval": 10,
                    "deepDebugLog": false,
                    "micloud": {
                        "username": "xx@xxxx.com",
                        "password": "xxxxx",
                        "country": "cn"
                    },
                    "buzzerControl": true,
                    "ledControl": true,
                    "childLockControl": true,
                    "modeControl": true
                }
merdok commented 2 years ago

Oh, yeah I see the issue... will fix that later!

merdok commented 2 years ago

Should be fixed in version 1.0.1

DJay-X commented 2 years ago

No error anymore. 👍

[2/3/2022, 9:54:43 AM] [miot] [Kettle] Device found: viomi.health_pot.v1
[2/3/2022, 9:54:43 AM] [miot] [Kettle] Setting up miot device!
[2/3/2022, 9:54:43 AM] [miot] [Kettle] Device requires MiCloud! Trying to connect!
[2/3/2022, 9:54:43 AM] [miot] [Kettle] Successfully connected to MiCloud!
[2/3/2022, 9:54:43 AM] [miot] [Kettle] Getting device info from MiCloud!
[2/3/2022, 9:54:44 AM] [miot] [Kettle] Device setup finished! Miot device ready!
[2/3/2022, 9:54:44 AM] [miot] [Kettle] [Miot Device] Connected to device: viomi.health_pot.v1
[2/3/2022, 9:54:44 AM] [miot] [Kettle] Doing initial property fetch.
[2/3/2022, 9:54:49 AM] [miot] [Kettle] Starting property polling.

However, I still can't control the kettle. It is not possible to turn the kettle on/off. When turning the kettle on by the other plugin I'm using currently, the "Mode - Custom" is turning on and the temperature is counting. Also "Left time" is changing. But "activate" keeps off.

Napkin 03 02 22, 10 27 57 AM

I hoped to replace https://github.com/ch3rn1k/homebridge-multipurpose-kettle with your plugin. With this plugin I have some different configuration options like setting the default heating target. Or change the mode from switch (with fix temperature) to thermostat with individual temperature.

  {
            "accessory": "MiMultipurposeKettle",
            "ip": "xxx.xxx.xxx.xx",
            "token": "xxxxx",
            "mode": "switch",
            "heat": 90,
            "name": "Wasserkocher",
            "sound": true,
            "temperature": true,
            "debug": false,
            "interval": 10
        },
merdok commented 2 years ago

Ufff, I just noticed that all the properties in the miot spec are read only, so I guess it is not possible to control your device using miot. Unfortunately there is nothing I can do about it...

DJay-X commented 2 years ago

What a shame. But thanks anyway. Then I can only hope that homebridge-multipurpose-kettle will still work for w while.