mapping for switches?
Closed this issue · 3 comments
Hey there,
I got a Z-Wave dimmer, which I only want to use like a switch. (by the way, the dimmer isn't supported properly by homebridge-fhem).
the problem:
When the dimmer is switched off its state is "dim 0". When its switched on its state is "dim 99". I could not find any helpful hint how to properly map a switch.
I only found this:
attr <hub> genericDeviceType switch
attr <hub> homebridgeMapping clear
On=activity,subtype=TV,valueOn=TV,cmdOn=activity+TV,cmdOff=off
On=activity,subtype=DVD,valueOn=/DVD/,cmdOn=activity+DVD,cmdOff=off
On=activity,subtype=Off,valueOn=PowerOff,valueOff=PowerOff,cmd=off
But I have problems to interpret this and don't get how to adapt it.
the dimmer should be supported. at least it is for another user. but he as 0 as off. not dim 0. is there really such a variation between devices?
homebridgeMapping On=state,valueOff=/^dim.0$/,cmdOn=on,cmdOff=off Brightness=clear
genericDeviceType can be switch, outlet or light.
i have just checked in a version that should detect both 0 and dim 0 as off. maybe you can try it. if you want to remove the Brightness just use
homebridgeMapping Brightness=clear
Thank you very much.
but he as 0 as off. not dim 0. is there really such a variation between devices?
It looks like. dim 0
and dim 99
are the state values that are automatically set when the pushbuttons (german "Unterputz-Taster") are pressed.
I said it's not properly supported because I have the following issue:
I can switch it on and off via home kit. But when I do, the dimmer can't be controlled via the normal pushbuttons anymore. It's really strange... I can't explain why yet. I will further investigate the issue tomorrow and check back with you here.
Well, I don't see any pattern. Sometimes it's off
and sometimes it's dim 0
.
I fixed it with this slightly changed mapping:
homebridgeMapping On=state,valueOff=/^dim.0|off$/,cmdOn=on,cmdOff=off Brightness=clear
I don't know why my device's behavior differs from the other user you mentioned. Maybe I will investigate it further when I have the time.
Thank you very much for your time.