jvmahon / Homebridge-HomeSeer4

Homebridge Plugin for HomeSeer 3 and 4
29 stars 8 forks source link

Devices with atypical On Off Values behave incorrectly #78

Closed tylerleppek closed 4 years ago

tylerleppek commented 4 years ago

I’m trying to expose my Pico Switches through Homeseer to HomeKit.

Pico Switches in Homeseer expose the following values. On: 2 On Release: 92 Off: 4 Off Release:94

The problem seems to be off release, when the Pico sets itself to off release the HomeKit switch is set to the wrong on state (I’m guessing this is because the value is 94 and there’s some weird/light/dimmer logic happening?)

I’ve tried the following in my config.json. "onValue": 2, "offValue": 4 *Homebrige-Homeseer doesn’t send the device change to Homeseer and the device state is actually incorrect.

"onValue": 92, "offValue": 94 *Homebridge-Homeseer doesn’t send the device change to Homeseer

"onValue": [2,92] "offValue": [4,94] *Homebridge-Homeseer registers the change but the home app gets out of sync, always showing the device as ‘on’ when the pico switches state is ‘94’ off button-released

What I’d like is the ability to specify offValues and onValues. The array also doesn’t seem to function correctly.

jvmahon commented 4 years ago

This is a new one for me. The code expects switches to have two values - a value for On, and a Value for Off. I'm not quite sure how the "On Release" and "off Release" function, but ...

  1. Maybe the code thinks its a dimmer, rather than a binary light switch. You can "force" it to be a binary. Try the following:
    {"type":"BinaryLIght", "ref":###,  "onValue":2, "offValue":4}

If you're controlling something other than a light (i.e., an applicance), you would use

{"type":"Switch", "ref":###,  "onValue":2, "offValue":4}

Where ### corresponds to the HomeSeer reference number.

If this doesn't work, you might have to create a mapping between your pico switches and a virtual switch which is then used to connect to Homekit. This concept is explained here: https://github.com/jvmahon/Homebridge-HomeSeer4/wiki/Mapping-HomeKit-Devices-to-a-Virtual-HomeSeer-Device

jvmahon commented 4 years ago

No further response so I closed the issue.