merdok / homebridge-miot

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

Mi Smart Thermostat Temperature Reading #399

Closed sa3eedo12 closed 1 year ago

sa3eedo12 commented 1 year ago

Hi,

I just added my Mi Thermostat using the plugin, and while the device shows up, I’m not getting any temperature readings and the status always switches to off.

Happy to provide any logs to fix this.

Thank you for working on this plugin!

Saeed

merdok commented 1 year ago

Hi, yeah you would need to provide at least some homebridge debug logs.

sa3eedo12 commented 1 year ago

Here you go :)

[12/1/2022, 3:24:48 AM] [miot] [Living Room AC] Preparing property poll! [12/1/2022, 3:24:48 AM] [miot] [Living Room AC] Splitting properties into chunks. Number of chunks: 1. Chunk size: 14 [12/1/2022, 3:24:48 AM] [miot] [Living Room AC] Chunks: [ [ "thermostat:on", "thermostat:status", "thermostat:fault", "thermostat:mode", "thermostat:target-temperature", "thermostat:temperature", "heatold:childlock" ] ] [12/1/2022, 3:24:48 AM] [miot] [Living Room AC] (Protocol) Call 192.168.70.9: get_properties - [{"did":"472270822","siid":2,"piid":1},{"did":"472270822","siid":2,"piid":2},{"did":"472270822","siid":2,"piid":3},{"did":"472270822","siid":2,"piid":4},{"did":"472270822","siid":2,"piid":5},{"did":"472270822","siid":2,"piid":7},{"did":"472270822","siid":4,"piid":1}] - {} [12/1/2022, 3:24:48 AM] [miot] [Living Room AC] (Protocol) Start handshake 192.168.70.9 [12/1/2022, 3:24:48 AM] [miot] [Living Room AC] (Protocol) 192.168.70.9 <- (2) {"method":"get_properties","params":[{"did":"472270822","siid":2,"piid":1},{"did":"472270822","siid":2,"piid":2},{"did":"472270822","siid":2,"piid":3},{"did":"472270822","siid":2,"piid":4},{"did":"472270822","siid":2,"piid":5},{"did":"472270822","siid":2,"piid":7},{"did":"472270822","siid":4,"piid":1}],"id":12} [12/1/2022, 3:24:48 AM] [miot] [Living Room AC] (Protocol) 192.168.70.9 <- !1` &G  9s  l $+{A [12/1/2022, 3:24:49 AM] [miot] [Living Room AC] (Protocol) 192.168.70.9 -> Data: {"id":12,"result":[{"did":"472270822","siid":2,"piid":1,"code":0,"value":true},{"did":"472270822","siid":2,"piid":2,"code":-4004},{"did":"472270822","siid":2,"piid":3,"code":-4004},{"did":"472270822","siid":2,"piid":4,"code":-4004},{"did":"472270822","siid":2,"piid":5,"code":-4004},{"did":"472270822","siid":2,"piid":7,"code":-4004},{"did":"472270822","siid":4,"piid":1,"code":-4004}],"exe_time":280} [12/1/2022, 3:24:49 AM] [miot] [Living Room AC] (Protocol) 192.168.70.9 -> Message: {"id":12,"result":[{"did":"472270822","siid":2,"piid":1,"code":0,"value":true},{"did":"472270822","siid":2,"piid":2,"code":-4004},{"did":"472270822","siid":2,"piid":3,"code":-4004},{"did":"472270822","siid":2,"piid":4,"code":-4004},{"did":"472270822","siid":2,"piid":5,"code":-4004},{"did":"472270822","siid":2,"piid":7,"code":-4004},{"did":"472270822","siid":4,"piid":1,"code":-4004}],"exe_time":280} [12/1/2022, 3:24:49 AM] [miot] [Living Room AC] Successfully updated property chunk! RAW: [{"did":"472270822","siid":2,"piid":1,"code":0,"value":true},{"did":"472270822","siid":2,"piid":2,"code":-4004},{"did":"472270822","siid":2,"piid":3,"code":-4004},{"did":"472270822","siid":2,"piid":4,"code":-4004},{"did":"472270822","siid":2,"piid":5,"code":-4004},{"did":"472270822","siid":2,"piid":7,"code":-4004},{"did":"472270822","siid":4,"piid":1,"code":-4004}] [12/1/2022, 3:24:49 AM] [miot] [Living Room AC] Error while parsing response from device for property thermostat:status. Response: {"did":"472270822","siid":2,"piid":2,"code":-4004} [12/1/2022, 3:24:49 AM] [miot] [Living Room AC] Error while parsing response from device for property thermostat:fault. Response: {"did":"472270822","siid":2,"piid":3,"code":-4004} [12/1/2022, 3:24:49 AM] [miot] [Living Room AC] Error while parsing response from device for property thermostat:mode. Response: {"did":"472270822","siid":2,"piid":4,"code":-4004} [12/1/2022, 3:24:49 AM] [miot] [Living Room AC] Error while parsing response from device for property thermostat:target-temperature. Response: {"did":"472270822","siid":2,"piid":5,"code":-4004} [12/1/2022, 3:24:49 AM] [miot] [Living Room AC] Error while parsing response from device for property thermostat:temperature. Response: {"did":"472270822","siid":2,"piid":7,"code":-4004} [12/1/2022, 3:24:49 AM] [miot] [Living Room AC] Error while parsing response from device for property heatold:childlock. Response: {"did":"472270822","siid":4,"piid":1,"code":-4004} [12/1/2022, 3:24:49 AM] [miot] [Living Room AC] Device properties updated: [ "thermostat:on: true", "thermostat:status: 0 | (not synced)", "thermostat:fault: 0 | (not synced)", "thermostat:mode: 0 | (not synced)", "thermostat:target-temperature: 0 | (not synced)", "thermostat:fan-level: 0 | (not synced)", "thermostat:temperature: 0 | (not synced)", "heatold:childlock: false | (not synced)", "heatold:sensortype: 0 | (not synced)", "heatold:tempactivate: 0 | (not synced)", "heatold:tempcomp: 0 | (not synced)", "heatold:tempfloor: 0 | (not synced)", "heatold:maxsettemp: 0 | (not synced)", "heatold:minsettemp: 0 | (not synced)" ]

merdok commented 1 year ago

You are getting a 4004 error code, that means an internal device error. You can try to connect to the device over micloud and see if that fixes your issue. For that you can use the forceMiCloud flag and specify your micloud credentials in the config.json

sa3eedo12 commented 1 year ago

That worked, thank you!

Would it be possible to add the fan controls instead of the cool, and heat?

merdok commented 1 year ago

It depends on your device, the plugin will usually display whatever your device can control over the miot protocol.