merdok / homebridge-miot

Homebridge plugin for devices supporting the Xiaomi miot protocol
MIT License
383 stars 62 forks source link

Could not read current temperature of HS2205(HS2201) #371

Closed moonphase97 closed 1 year ago

moonphase97 commented 1 year ago

Describe the bug

Could not read current temperature of HS2205 from Home Bridge.

Expected behavior

HS2201 and HS2205 have the same interface. https://home.miot-spec.com/spec?type=urn:miot-spec-v2:device:electric-blanket:0000A069:isleep-hs2201:1 https://home.miot-spec.com/spec?type=urn:miot-spec-v2:device:electric-blanket:0000A069:isleep-hs2205:1

So I recognized my HS2201 device as HS2205 in Homebridge. All other functions work, but the current temperature is always showing 0.0 °C.

Your config.json

"devices": [
    {
        "name": "Xiaomi Graphene Baseboard Heater",
        "ip": "192.168.8.xx",
        "token": "xxxxxx",
        "model": "leshow.heater.bs2",
        "pollingInterval": 10,
        "deepDebugLog": false,
        "customAccessory": false,
        "buzzerControl": true,
        "ledControl": true,
        "childLockControl": true,
        "modeControl": true,
        "offDelayControl": true
    },
    {
        "name": "LETSLEEP water heated blanket",
        "ip": "192.168.8.xx",
        "token": "xxxxxx",
        "model": "isleep.blanket.hs2205",
        "pollingInterval": 10,
        "deepDebugLog": false,
        "buzzerControl": true,
        "ledControl": true,
        "childLockControl": true,
        "modeControl": true
    }
],
"platform": "miot"
}

Debug log

[30/10/2022, 17:06:53] [miot] [LETSLEEP water heated blanket] Device found! Setting up miot device from local connection!
[30/10/2022, 17:06:53] [miot] [LETSLEEP water heated blanket] Connected to device: isleep.blanket.hs2201
[30/10/2022, 17:06:53] [miot] [LETSLEEP water heated blanket] Doing initial property fetch.
[30/10/2022, 17:06:53] [miot] [LETSLEEP water heated blanket] Starting property polling.

Screenshots IMG_5288

merdok commented 1 year ago

This is an issue with the device and not the plugin i would guess. You can post a deep debug log so that we can see what the actual device reports.

moonphase97 commented 1 year ago

here's the deep debug log.

electric-blanket:temperature: 0 | (not synced)

thanks

[30/10/2022, 18:37:24] [miot] [LETSLEEP water heated blanket] Preparing property poll!
[30/10/2022, 18:37:24] [miot] [LETSLEEP water heated blanket] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14
[30/10/2022, 18:37:24] [miot] [LETSLEEP water heated blanket] Chunks:  [
 [
  "countdown:countdown-time",
  "physical-controls-locked:physical-controls-locked",
  "electric-blanket:mode"
 ]
]
[30/10/2022, 18:37:24] [miot] [LETSLEEP water heated blanket] (Protocol) Call 192.168.8.xx: get_properties - [{"did":"426730826","siid":5,"piid":1},{"did":"426730826","siid":3,"piid":1},{"did":"426730826","siid":2,"piid":3}] - {}
[30/10/2022, 18:37:24] [miot] [LETSLEEP water heated blanket] (Protocol) Start handshake 192.168.8.xx
[30/10/2022, 18:37:24] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx <- (2) {"method":"get_properties","params":[{"did":"426730826","siid":5,"piid":1},{"did":"426730826","siid":3,"piid":1},{"did":"426730826","siid":2,"piid":3}],"id":19}
[30/10/2022, 18:37:24] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx <- !1�oeJ��?�$m�h]�X��0D
[30/10/2022, 18:37:24] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx -> Data: {"id":19,"result":[{"did":"426730826","siid":5,"piid":1,"code":0,"value":0},{"did":"426730826","siid":3,"piid":1,"code":0,"value":false},{"did":"426730826","siid":2,"piid":3,"code":0,"value":0}],"exe_time":172}
[30/10/2022, 18:37:24] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx -> Message: {"id":19,"result":[{"did":"426730826","siid":5,"piid":1,"code":0,"value":0},{"did":"426730826","siid":3,"piid":1,"code":0,"value":false},{"did":"426730826","siid":2,"piid":3,"code":0,"value":0}],"exe_time":172}
[30/10/2022, 18:37:24] [miot] [LETSLEEP water heated blanket] Successfully updated property chunk! RAW: [{"did":"426730826","siid":5,"piid":1,"code":0,"value":0},{"did":"426730826","siid":3,"piid":1,"code":0,"value":false},{"did":"426730826","siid":2,"piid":3,"code":0,"value":0}]
[30/10/2022, 18:37:24] [miot] [LETSLEEP water heated blanket] Device properties updated: 
[
  "electric-blanket:on: true",
  "electric-blanket:fault: 0 | (not synced)",
  "electric-blanket:mode: 0",
  "electric-blanket:target-temperature: 45",
  "electric-blanket:temperature: 0 | (not synced)",
  "electric-blanket:water-level: 0 | (not synced)",
  "physical-controls-locked:physical-controls-locked: false",
  "countdown:countdown-time: 0",
  "custom:low-temperature: false | (not synced)",
  "custom:screen-switch: false | (not synced)",
  "custom:key-tone: false | (not synced)",
  "custom:automatic-shutdown: false | (not synced)",
  "custom:sleep-level: 0 | (not synced)",
  "custom:fast-heating: false | (not synced)"
]
moonphase97 commented 1 year ago

oops,I accidentally closed it

merdok commented 1 year ago

Can you also post a log from the setup so that i can see what device class is being used?

moonphase97 commented 1 year ago

Sorry to late, Here's the log

There's some weird broken text like !1�oeJ�<��kC�xpM���$Y

Thanks for your hard work

[01/11/2022, 19:13:05] Homebridge v1.5.1 (HAP v0.10.4) (Homebridge 5829) is running on port xxxx.
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Found cached device information: isleep.blanket.hs2201
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Model known: isleep.blanket.hs2205!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Initializing device!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Creating device instance by model: isleep.blanket.hs2205!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a airconditioner device! Device class could not be found: ../modules/airconditioner/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a airer device! Device class could not be found: ../modules/airer/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a airfryer device! Device class could not be found: ../modules/airfryer/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a airmonitor device! Device class could not be found: ../modules/airmonitor/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a airpurifier device! Device class could not be found: ../modules/airpurifier/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a bathheater device! Device class could not be found: ../modules/bathheater/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a camera device! Device class could not be found: ../modules/camera/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a ceilingfan device! Device class could not be found: ../modules/ceilingfan/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a coffeemachine device! Device class could not be found: ../modules/coffeemachine/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a cooker device! Device class could not be found: ../modules/cooker/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a curtain device! Device class could not be found: ../modules/curtain/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a custom device! Device class could not be found: ../modules/custom/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a dehumidifier device! Device class could not be found: ../modules/dehumidifier/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a fan device! Device class could not be found: ../modules/fan/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a freshairsystem device! Device class could not be found: ../modules/freshairsystem/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Not a generic device! Device class could not be found: ../modules/generic/devices/isleep.blanket.hs2205.js
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] It is a heater device! Found device class at ../modules/heater/devices/isleep.blanket.hs2205.js!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Initializing device services
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Device services: [
  "electric-blanket",
  "physical-controls-locked",
  "countdown",
  "custom"
]
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Initializing device properties
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Device properties: [
  "electric-blanket:on",
  "electric-blanket:fault",
  "electric-blanket:mode",
  "electric-blanket:target-temperature",
  "electric-blanket:temperature",
  "electric-blanket:water-level",
  "physical-controls-locked:physical-controls-locked",
  "countdown:countdown-time",
  "custom:low-temperature",
  "custom:screen-switch",
  "custom:key-tone",
  "custom:automatic-shutdown",
  "custom:sleep-level",
  "custom:fast-heating"
]
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Initializing device actions
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Initializing device events
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Device events: [
  "custom:scheduled-shutdown",
  "custom:mite-removal"
]
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Initial properties to monitor: [
  "countdown:countdown-time",
  "physical-controls-locked:physical-controls-locked"
]
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Successfully created a Heater device! It is a Painted sleep water heating pad HS2205.
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Initializing accessory!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Creating Heater accessory for device LETSLEEP water heated blanket!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Found accessory class at ../modules/heater/HeaterAccessory.js!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] <-W-> Creating Mode wrapper of type Property for property electric-blanket:mode
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] <-W-> Property type: Value List! Creating list item switches!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Successfully created Mode wrapper of type Property!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Accessory successfully initialized!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Final properties to monitor: [
  "countdown:countdown-time",
  "physical-controls-locked:physical-controls-locked",
  "electric-blanket:mode"
]
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Registering 1 accessories!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Everything looks good! Initiating property polling!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) Start handshake 192.168.8.xx
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) Server listening 0.0.0.0:51428
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx -> Handshake reply
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) Call 192.168.8.xx: miIO.info - {"timeout":5000,"retries":3} - {}
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) Start handshake 192.168.8.xx
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx <- (2) {"method":"miIO.info","params":{"timeout":5000,"retries":3},"id":1}
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx <- !1poeJ�<N�-?(B��Z&��I
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx -> Data: {"id":1,"result":{"life":233532,"model":"isleep.blanket.hs2201","token":"892e11e9ca744dfb65a40bbd22a23cc6","ipflag":1,"fw_ver":"2.2.2","mcu_fw_ver":"0001","miio_ver":"0.0.9","hw_ver":"RTL8720C","mmfree":58016,"mac":"58:B6:23:CE:67:DF","wifi_fw_ver":"WifiVer.N\/A","ap":{"ssid":"Dam-A 2.4g","bssid":"58:11:22:15:26:60","rssi":-38,"primary":10},"netif":{"localIp":"192.168.8.xx","mask":"255.255.255.0","gw":"192.168.8.1"},"uid":1583474741,"config_type":"app"},"exe_time":65}
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx -> Message: {"id":1,"result":{"life":233532,"model":"isleep.blanket.hs2201","token":"892e11e9ca744dfb65a40bbd22a23cc6","ipflag":1,"fw_ver":"2.2.2","mcu_fw_ver":"0001","miio_ver":"0.0.9","hw_ver":"RTL8720C","mmfree":58016,"mac":"58:B6:23:CE:67:DF","wifi_fw_ver":"WifiVer.N\/A","ap":{"ssid":"Dam-A 2.4g","bssid":"58:11:22:15:26:60","rssi":-38,"primary":10},"netif":{"localIp":"192.168.8.xx","mask":"255.255.255.0","gw":"192.168.8.1"},"uid":1583474741,"config_type":"app"},"exe_time":xx}
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Device found! Setting up miot device from local connection!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Device firmware: 2.2.2
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Full device info: 
{
  "life": 233532,
  "model": "isleep.blanket.hs2201",
  "token": "892e11e9ca744dfb65a40bbd22a23cc6",
  "ipflag": 1,
  "fw_ver": "2.2.2",
  "mcu_fw_ver": "0001",
  "miio_ver": "0.0.9",
  "hw_ver": "RTL8720C",
  "mmfree": 58016,
  "mac": "58:B6:23:CE:67:DF",
  "wifi_fw_ver": "WifiVer.N/A",
  "ap": {
    "ssid": "xxxx",
    "bssid": "58:11:22:15:26:60",
    "rssi": -38,
    "primary": 10
  },
  "netif": {
    "localIp": "192.168.8.xx",
    "mask": "255.255.255.0",
    "gw": "192.168.8.1"
  },
  "uid": 1583474741,
  "config_type": "app"
}
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Connected to device: isleep.blanket.hs2201
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Doing initial property fetch.
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Preparing property poll!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Chunks:  [
 [
  "countdown:countdown-time",
  "physical-controls-locked:physical-controls-locked",
  "electric-blanket:mode"
 ]
]
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) Call 192.168.8.xx: get_properties - [{"did":"426730826","siid":5,"piid":1},{"did":"426730826","siid":3,"piid":1},{"did":"426730826","siid":2,"piid":3}] - {}
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) Start handshake 192.168.8.xx
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx <- (2) {"method":"get_properties","params":[{"did":"426730826","siid":5,"piid":1},{"did":"426730826","siid":3,"piid":1},{"did":"426730826","siid":2,"piid":3}],"id":2}
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx <- !1�oeJ�<��kC�xpM���$Y
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Successfully saved device info!
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx -> Data: {"id":2,"result":[{"did":"426730826","siid":5,"piid":1,"code":0,"value":0},{"did":"426730826","siid":3,"piid":1,"code":0,"value":false},{"did":"426730826","siid":2,"piid":3,"code":0,"value":0}],"exe_time":137}
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx -> Message: {"id":2,"result":[{"did":"426730826","siid":5,"piid":1,"code":0,"value":0},{"did":"426730826","siid":3,"piid":1,"code":0,"value":false},{"did":"426730826","siid":2,"piid":3,"code":0,"value":0}],"exe_time":137}
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Successfully updated property chunk! RAW: [{"did":"426730826","siid":5,"piid":1,"code":0,"value":0},{"did":"426730826","siid":3,"piid":1,"code":0,"value":false},{"did":"426730826","siid":2,"piid":3,"code":0,"value":0}]
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Got initial device properties: 
[
  "electric-blanket:on: false | (not synced)",
  "electric-blanket:fault: 0 | (not synced)",
  "electric-blanket:mode: 0",
  "electric-blanket:target-temperature: 0 | (not synced)",
  "electric-blanket:temperature: 0 | (not synced)",
  "electric-blanket:water-level: 0 | (not synced)",
  "physical-controls-locked:physical-controls-locked: false",
  "countdown:countdown-time: 0",
  "custom:low-temperature: false | (not synced)",
  "custom:screen-switch: false | (not synced)",
  "custom:key-tone: false | (not synced)",
  "custom:automatic-shutdown: false | (not synced)",
  "custom:sleep-level: 0 | (not synced)",
  "custom:fast-heating: false | (not synced)"
]
[01/11/2022, 19:13:05] [miot] [LETSLEEP water heated blanket] Starting property polling.
[01/11/2022, 19:13:15] [miot] [LETSLEEP water heated blanket] Preparing property poll!
[01/11/2022, 19:13:15] [miot] [LETSLEEP water heated blanket] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14
[01/11/2022, 19:13:15] [miot] [LETSLEEP water heated blanket] Chunks:  [
 [
  "countdown:countdown-time",
  "physical-controls-locked:physical-controls-locked",
  "electric-blanket:mode"
 ]
]
[01/11/2022, 19:13:15] [miot] [LETSLEEP water heated blanket] (Protocol) Call 192.168.8.xx: get_properties - [{"did":"426730826","siid":5,"piid":1},{"did":"426730826","siid":3,"piid":1},{"did":"426730826","siid":2,"piid":3}] - {}
[01/11/2022, 19:13:15] [miot] [LETSLEEP water heated blanket] (Protocol) Start handshake 192.168.8.xx
[01/11/2022, 19:13:15] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx <- (2) {"method":"get_properties","params":[{"did":"426730826","siid":5,"piid":1},{"did":"426730826","siid":3,"piid":1},{"did":"426730826","siid":2,"piid":3}],"id":3}
[01/11/2022, 19:13:15] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx <- !1�oeJ�F�
<�̈́��O�C@        �
[01/11/2022, 19:13:16] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx -> Data: {"id":3,"result":[{"did":"426730826","siid":5,"piid":1,"code":0,"value":0},{"did":"426730826","siid":3,"piid":1,"code":0,"value":false},{"did":"426730826","siid":2,"piid":3,"code":0,"value":0}],"exe_time":203}
[01/11/2022, 19:13:16] [miot] [LETSLEEP water heated blanket] (Protocol) 192.168.8.xx -> Message: {"id":3,"result":[{"did":"426730826","siid":5,"piid":1,"code":0,"value":0},{"did":"426730826","siid":3,"piid":1,"code":0,"value":false},{"did":"426730826","siid":2,"piid":3,"code":0,"value":0}],"exe_time":203}
[01/11/2022, 19:13:16] [miot] [LETSLEEP water heated blanket] Successfully updated property chunk! RAW: [{"did":"426730826","siid":5,"piid":1,"code":0,"value":0},{"did":"426730826","siid":3,"piid":1,"code":0,"value":false},{"did":"426730826","siid":2,"piid":3,"code":0,"value":0}]
[01/11/2022, 19:13:16] [miot] [LETSLEEP water heated blanket] Device properties updated: 
[
  "electric-blanket:on: false | (not synced)",
  "electric-blanket:fault: 0 | (not synced)",
  "electric-blanket:mode: 0",
  "electric-blanket:target-temperature: 0 | (not synced)",
  "electric-blanket:temperature: 0 | (not synced)",
  "electric-blanket:water-level: 0 | (not synced)",
  "physical-controls-locked:physical-controls-locked: false",
  "countdown:countdown-time: 0",
  "custom:low-temperature: false | (not synced)",
  "custom:screen-switch: false | (not synced)",
  "custom:key-tone: false | (not synced)",
  "custom:automatic-shutdown: false | (not synced)",
  "custom:sleep-level: 0 | (not synced)",
  "custom:fast-heating: false | (not synced)"
]
merdok commented 1 year ago

Thanks! Should now be fixed in version 1.4.1

moonphase97 commented 1 year ago

It works fine, Thanks to your hard work.