tonesto7/homebridge-smartthings-tonesto7

SetLevel (dimmers/lights/switches) no longer working

Closed this issue · 2 comments

rkydd commented

Smartthings (or Homekit??) seems to have changed or updated the capabilities of switches/lights/dimmers and the set level call now no longer seems to work - in my set up a dimmer plug (Aeotec Smart Dimmer 6) using the ZWave Metering Dimmer DTH was working find until recently with Homebridge, but now doesn't respond to changes in the dimmer/light level control - it seems that the Setlevel procedure in the DTH is no longer called.

I note that the DTH has been updated by Samsung and the SetLevel call now takes two arguments when the original only took one. If I change the DTH it seems to break other things.....

rkydd commented

i have found a fix/hack that resolves my issue, though i am not sure how. My analysis above is probably incorrect - though something somewhere (homekit, smartthings or homebridge) has changed resulting in the dimmer set level not working - I just don't know why.

I have worked around it by changing some code in your smart app in my hub

I altered the lanEventHandler function in how it parses and extracts the Val1, Val2 parameter from the event message.
Changing:
case "hkCommand":
//log.trace "hkCommand($msgData)"
def val1 = msgData?value1 ?: null
def val2 = msgData?.value2 ?: null

to be:
case "hkCommand":
//log.trace "hkCommand($msgData)"
def val1 = msgData?.values?.value1 ?: null
def val2 = msgData?.values?.value2 ?: null

seems to have fixed my problem. It appears that the value1 and value 2 parameters are delivered as a structure now, I just don't know why?

Hope this helps

Thanks for finding this. It will be released later today in v1.5.4