fjs21 / homebridge-kumo

Control your Kumo cloud devices using Homebridge.
https://www.npmjs.com/package/homebridge-kumo
Apache License 2.0
33 stars 8 forks source link

Humidity Sensor Doesn't Appear #63

Closed Jason-Morcos closed 2 years ago

Jason-Morcos commented 2 years ago

Hi there! Thanks for the awesome plugin!

I recently added an external sensor to one of my heat pumps (https://smile.amazon.com/gp/product/B07P55NWXY/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1). This sensor provides an external temperature measurement to the heat pump and adds humidity as well. The new humidity measurement is showing up in the Kumo app, but doesn't seem to be showing up in Homebridge even after several Homebridge restarts.

Should it show up? Are there steps I need to take to make it show up?

image

image

fjs21 commented 2 years ago

Hi @Jason-Morcos, I don't have a humidity sensor but I'm sure we could add support. You would need to turn on debugging in your homebridge instance and take a look at the log when the device is queried. You might be able to see the relevant humidity reading in the JSON response from the unit. We could then update the plugin to look for that, and if available, add a new humidity sensor to the accessory.

Jason-Morcos commented 2 years ago

Hi @fjs21, thanks for the reply!

Turning on debug logging, I do see it in the large JSON that's printed out around initialization under kumoSensorSettings:

  systemChangeoverEnabled: false,
  minCoolSetpoint: 16,
  maxHeatSetpoint: 31,
  kumoSensorSettings: {
    uuid: '6b730410b262020000000000e77f7022',
    rssi: -58,
    txPower: -53,
    battery: 93,
    temperature: 19.388203,
    humidity: 70.660156
  },
  lastAdapterUpdate: '2022-06-02 03:48:26.689534',
  autoChangeoverEnabled: false,

I'm not seeing the humidity in the queryDevice_Direct logs however, just in the initial initialization of the plugin

Jason-Morcos commented 2 years ago

The direct access replies do indicate that the device knows it's using a sensor however

{
  r: {
    indoorUnit: {
      status: {
        activeThermistor: 'sensor0',
        defrost: false,
        fanSpeed: 'auto',
        filterDirty: false,
        hotAdjust: false,
        mode: 'cool',
        roomTemp: 19.5,
        runTest: 0,
        spCool: 23,
        spHeat: 18.5,
        standby: false,
        tempSource: 'sensor0',
        vaneDir: 'auto'
      }
    }
  }
}

(the other units show "unset" for the activeThermistor field)

LtHummus commented 2 years ago

I actually have a branch I'm working on this as I have the humidity sensors set up. It's mostly working at this point (see screenshot), but the code can probably do with some minor cleanup and testing. I have a pretty bad way of detecting the presense of sensors, but I will improve that since I didn't even look at the contents of the direct access query.

My branch lives at https://github.com/LtHummus/homebridge-kumo/tree/add-humidity-from-external-sensor and I'm hoping to have something ready to PR soon.

edit: i did look at some of the querying that the app uses for non-direct, and that seems a bit more tricky as the app doesn't update too often, but I didn't look too hard in to it...

image

fjs21 commented 2 years ago

@LtHummus that sounds cool! Based on the kumo python package, a while back I did some initial stuff in the kumo-api.ts file with the function - queryDeviceSensors_Direct

I can't test so it is tricky and I'm not sure if you should give it the ductless unit serial or the serial of the sensor that @Jason-Morcos gets during initial setup.

Once you ready with a PR I can take a look and get it merged for others to try out.

LtHummus commented 2 years ago

Yup, I took your queryDeviceSensors_Direct function and tweaked it to work with the data that gets sent back, but your code there is mostly intact :D

edit: for testing, I have kind of the opposite problem of everyone else, all of my units have sensors associated with them, so it's harder for me to test units without (though I've faked it a bit with test data and patching a few things)

fjs21 commented 2 years ago

I had a quick look over your fork. Nice work. I'd be happy to merge a PR, test on my system and release.

LtHummus commented 2 years ago

https://github.com/fjs21/homebridge-kumo/pull/65 opened