Skip to content

Commit

Permalink
feat(device): add ZB-3009 support for Zigbee2MQTT
Browse files Browse the repository at this point in the history
related to #237
  • Loading branch information
xaviml committed Feb 6, 2021
1 parent d37cac6 commit 5dae2d7
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
19 changes: 19 additions & 0 deletions apps/controllerx/cx_devices/rgb_genie.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,22 @@ def get_zha_action(self, data: EventData) -> str:
elif command == "move_hue":
return "stop_move_hue" if tuple(data["args"]) == (0, 0) else "move_hue"
return command


class ZB3009LightController(LightController):
def get_z2m_actions_mapping(self) -> DefaultActionsMapping:
return {
"on": Light.TOGGLE,
"off": Light.TOGGLE,
"brightness_move_up": Light.HOLD_BRIGHTNESS_UP,
"brightness_move_down": Light.HOLD_BRIGHTNESS_DOWN,
"brightness_stop": Light.RELEASE,
"color_temperature_move_down": Light.CLICK_COLOR_TEMP_DOWN,
"color_temperature_move_up": Light.CLICK_COLOR_TEMP_UP,
"color_temperature_move": Light.COLORTEMP_FROM_CONTROLLER,
"color_move": Light.XYCOLOR_FROM_CONTROLLER,
# "hue_move": "", # Play/pause button
# "recall_1": "", # Scene 1
# "recall_3": "", # Scene 2
# "recall_2": "", # Scene 3
}
30 changes: 30 additions & 0 deletions docs/_data/controllers/ZB-3009.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: ZB-3009 (RGB Genie)
device_support:
- type: Light
domain: light
controller: ZB3009LightController
delay: 350
mapping:
- "Click on/off → Toggle"
- "Click red circle → Change color of the bulb to red"
- "Click blue circle → Change color of the bulb to blue"
- "Click green circle → Change color of the bulb to green"
- "Click white circle → Change color temperature"
- "Hold white circle → Change color temperature"
- "Click three rings → Toggle through white warmth"
- "Hold brightness button → Change brightness"
- "Click color wheel → Change xy color"

integrations:
- name: Zigbee2MQTT
codename: z2m
actions:
- '"on" → Click on/off'
- '"off" → Click on/off'
- "brightness_move_up → Hold brightness button"
- "brightness_move_down → Hold brightness button"
- "brightness_stop → Release brightness button"
- "color_temperature_move_down → Hold white circle"
- "color_temperature_move_up → Hold white circle"
- "color_temperature_move → Click white circle"
- "color_move → Click red/blue/green button, three wrings button and color wheel"
Binary file added docs/assets/img/ZB-3009.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/controllers/ZB-3009.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: controller
title: ZB-3009 (RGB Genie)
device: ZB-3009
---

0 comments on commit 5dae2d7

Please sign in to comment.