Skip to content

Commit

Permalink
Added RDM002 support (diyhue#907)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fisico authored May 6, 2023
1 parent 8712dd0 commit e1bacc7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
3 changes: 2 additions & 1 deletion BridgeEmulator/sensors/sensor_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"ZLLPresence" : { "state": {"lastupdated": "none","presence": None }, "config": {"on": False,"battery": 100,"reachable": True,"alert": "none","ledindication": False,"usertest": False,"sensitivity": 2,"sensitivitymax": 2,"pending": [] }, "static": {"swupdate": {"state": "noupdates","lastinstall": "2021-03-16T21:16:40"}, "manufacturername": "Signify Netherlands B.V.", "productname": "Hue motion sensor", "swversion": "6.1.1.27575", "capabilities":{"certified":True,"primary":True}}},
"ZLLLightLevel" : {"state": {"dark": True,"daylight": False,"lightlevel": 6000,"lastupdated": "none"}, "config": {"on": False,"battery": 100,"reachable": True,"alert": "none","tholddark": 9346,"tholdoffset": 7000,"ledindication": False,"usertest": False,"pending": []}, "static": {"swupdate": { "state": "noupdates", "lastinstall": "2021-03-16T21:16:40"}, "manufacturername": "Signify Netherlands B.V.","productname": "Hue ambient light sensor","swversion": "6.1.1.27575","capabilities": { "certified": True, "primary": False}}}}

sensorTypes["RDM002"] = {"ZLLSwitch": {"state":{"buttonevent":3002,"lastupdated":"2023-05-13T09:34:38"},"config":{"on": True,"battery": 100,"reachable": True,"pending": []},"static":{"swupdate":{"state": "noupdates","lastinstall": "2022-07-01T14:38:51"},"manufacturername": "Signify Netherlands B.V.","productname": "Hue tap dial switch","swversion": "2.59.19","capabilities": {"certified": True,"primary": False,"inputs": [{"repeatintervals": [800],"events": [{"buttonevent": 1000,"eventtype": "initial_press"},{"buttonevent": 1001,"eventtype": "repeat"},{"buttonevent": 1002,"eventtype": "short_release"},{"buttonevent": 1003,"eventtype": "long_release"},{"buttonevent": 1010,"eventtype": "long_press"}]},{"repeatintervals": [800],"events": [{"buttonevent": 2000,"eventtype": "initial_press"},{"buttonevent": 2001,"eventtype": "repeat"},{"buttonevent": 2002,"eventtype": "short_release"},{"buttonevent": 2003,"eventtype": "long_release"},{"buttonevent": 2010,"eventtype": "long_press"}]},{"repeatintervals": [800],"events": [{"buttonevent": 3000,"eventtype": "initial_press"},{"buttonevent": 3001,"eventtype": "repeat"},{"buttonevent": 3002,"eventtype": "short_release"},{"buttonevent": 3003,"eventtype": "long_release"},{"buttonevent": 3010,"eventtype": "long_press"}]},{"repeatintervals": [800],"events": [{"buttonevent": 4000,"eventtype": "initial_press"},{"buttonevent": 4001,"eventtype": "repeat"},{"buttonevent": 4002,"eventtype": "short_release"},{"buttonevent": 4003,"eventtype": "long_release"},{"buttonevent": 4010,"eventtype": "long_press"}]}]}}}}
sensorTypes["RDM002"] = {"ZLLSwitch": {"state":{"buttonevent":3002,"lastupdated":"2023-05-13T09:34:38"},"config":{"on":True,"battery":100,"reachable":True,"pending":[]},"static":{"swupdate":{"state":"noupdates","lastinstall":"2022-07-01T14:38:51"},"manufacturername":"Signify Netherlands B.V.","productname":"Hue tap dial switch","swversion":"2.59.25","capabilities":{"certified":True,"primary":False,"inputs":[{"repeatintervals":[800],"events":[{"buttonevent":1000,"eventtype":"initial_press"},{"buttonevent":1001,"eventtype":"repeat"},{"buttonevent":1002,"eventtype":"short_release"},{"buttonevent":1003,"eventtype":"long_release"},{"buttonevent":1010,"eventtype":"long_press"}]},{"repeatintervals":[800],"events":[{"buttonevent":2000,"eventtype":"initial_press"},{"buttonevent":2001,"eventtype":"repeat"},{"buttonevent":2002,"eventtype":"short_release"},{"buttonevent":2003,"eventtype":"long_release"},{"buttonevent":2010,"eventtype":"long_press"}]},{"repeatintervals":[800],"events":[{"buttonevent":3000,"eventtype":"initial_press"},{"buttonevent":3001,"eventtype":"repeat"},{"buttonevent":3002,"eventtype":"short_release"},{"buttonevent":3003,"eventtype":"long_release"},{"buttonevent":3010,"eventtype":"long_press"}]},{"repeatintervals":[800],"events":[{"buttonevent":4000,"eventtype":"initial_press"},{"buttonevent":4001,"eventtype":"repeat"},{"buttonevent":4002,"eventtype":"short_release"},{"buttonevent":4003,"eventtype":"long_release"},{"buttonevent":4010,"eventtype":"long_press"}]}]}}},
"ZLLRelativeRotary":{"state":{"rotaryevent":2,"expectedrotation":90,"expectedeventduration":400,"lastupdated":"2023-05-13T09:34:38"},"config":{"on":True,"battery":100,"reachable":True,"pending":[]},"static":{"swupdate":{"state":"noupdates","lastinstall":"2022-07-01T14:38:51"},"manufacturername":"Signify Netherlands B.V.","productname":"Hue tap dial switch","swversion":"2.59.25","capabilities":{"certified":True,"primary":False,"inputs":[{"repeatintervals":[400],"events":[{"rotaryevent":1,"eventtype":"start"},{"rotaryevent":2,"eventtype":"repeat"}]}]}}}}

sensorTypes["RWL021"] = {"ZLLSwitch": {"state":{"buttonevent":4000,"lastupdated":"2022-11-13T09:34:38"}, "config":{"on":True,"battery":None,"reachable":False,"pending":[]}, "static": {"swupdate":{"state":"transferring","lastinstall":"2022-11-13T09:32:55"}, "manufacturername":"Signify Netherlands B.V.","productname":"Hue dimmer switch","diversityid":"6426c751-c093-499e-afb6-9f0c863ec819","swversion":"2.44.0_hBB3C188","capabilities":{"certified":True,"primary":True,"inputs":[{"repeatintervals":[800],"events":[{"buttonevent":1000,"eventtype":"initial_press"},{"buttonevent":1001,"eventtype":"repeat"},{"buttonevent":1002,"eventtype":"short_release"},{"buttonevent":1003,"eventtype":"long_release"},{"buttonevent":1010,"eventtype":"long_press"}]},{"repeatintervals":[800],"events":[{"buttonevent":2000,"eventtype":"initial_press"},{"buttonevent":2001,"eventtype":"repeat"},{"buttonevent":2002,"eventtype":"short_release"},{"buttonevent":2003,"eventtype":"long_release"},{"buttonevent":2010,"eventtype":"long_press"}]},{"repeatintervals":[800],"events":[{"buttonevent":3000,"eventtype":"initial_press"},{"buttonevent":3001,"eventtype":"repeat"},{"buttonevent":3002,"eventtype":"short_release"},{"buttonevent":3003,"eventtype":"long_release"},{"buttonevent":3010,"eventtype":"long_press"}]},{"repeatintervals":[800],"events":[{"buttonevent":4000,"eventtype":"initial_press"},{"buttonevent":4001,"eventtype":"repeat"},{"buttonevent":4002,"eventtype":"short_release"},{"buttonevent":4003,"eventtype":"long_release"},{"buttonevent":4010,"eventtype":"long_press"}]}]}}}}
sensorTypes["ZGPSWITCH"] = {"ZGPSwitch": {"state": {"buttonevent": 0, "lastupdated": "none"}, "config": {"on": True, "battery": 100, "reachable": True}, "static": {"manufacturername": "Signify Netherlands B.V.", "swversion": ""}}}
Expand Down
40 changes: 29 additions & 11 deletions BridgeEmulator/services/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,44 @@
"arrow_right_click": {"many": 4002},
}
},
"8719514440937": {
"RDM002": {
"dataConversion": {
"rootKey": "action",
"button_1_press": {"buttonevent": 34},
"button_2_press": {"buttonevent": 16},
"button_3_press": {"buttonevent": 17},
"button_4_press": {"buttonevent": 18},
"dial_rotate_left_step": {"buttonevent": 2000},
"dial_rotate_right_step": {"buttonevent": 2001},
"dial_rotate_left_slow": {"many": 3000},
"dial_rotate_right_slow": {"many": 3001},
"button_1_press": {"buttonevent": 1000},
"button_1_hold": {"buttonevent": 1001},
"button_1_press_release": {"buttonevent": 1002},
"button_1_hold_release": {"buttonevent": 1003},
"button_2_press": {"buttonevent": 2000},
"button_2_hold": {"buttonevent": 2001},
"button_2_press_release": {"buttonevent": 2002},
"button_2_hold_release": {"buttonevent": 2003},
"button_3_press": {"buttonevent": 3000},
"button_3_hold": {"buttonevent": 3001},
"button_3_press_release": {"buttonevent": 3002},
"button_3_hold_release": {"buttonevent": 3003},
"button_4_press": {"buttonevent": 4000},
"button_4_hold": {"buttonevent": 4001},
"button_4_press_release": {"buttonevent": 4002},
"button_4_hold_release": {"buttonevent": 4003},
"dial_rotate_left_step": {"rotaryevent": 1},
"dial_rotate_left_slow": {"rotaryevent": 2},
"dial_rotate_left_fast": {"rotaryevent": 2},
"dial_rotate_right_step": {"rotaryevent": 1},
"dial_rotate_right_slow": {"rotaryevent": 2},
"dial_rotate_right_fast": {"rotaryevent": 2},
}
},
}



# WXKG01LM MiJia wireless switch https://www.zigbee2mqtt.io/devices/WXKG01LM.html

standardSensors["RWL022"] = standardSensors["RWL021"]
standardSensors["8719514440999"] = standardSensors["8719514440937"]
standardSensors["9290035001"] = standardSensors["8719514440937"]
standardSensors["8719514440937"] = standardSensors["RDM002"]
standardSensors["8719514440999"] = standardSensors["RDM002"]
standardSensors["9290035001"] = standardSensors["RDM002"]
standardSensors["9290035003"] = standardSensors["RDM002"]


def getClient():
Expand Down

0 comments on commit e1bacc7

Please sign in to comment.