Skip to content

Commit

Permalink
feat(device): add Hue Smart Button support for deCONZ
Browse files Browse the repository at this point in the history
related to #226
  • Loading branch information
xaviml committed Jan 23, 2021
1 parent b67c4dc commit e81208a
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 70 deletions.
10 changes: 10 additions & 0 deletions apps/controllerx/cx_devices/phillips.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,13 @@ def get_deconz_actions_mapping(self) -> DefaultActionsMapping:
# 6000: "", # button_2_4_press
6003: Light.RELEASE, # button_2_4_release_after_hold
}


class HueSmartButtonLightController(LightController):
def get_deconz_actions_mapping(self) -> DefaultActionsMapping:
return {
# 1000: "", # Initial press
1001: Light.HOLD_BRIGHTNESS_TOGGLE,
1002: Light.TOGGLE,
1003: Light.RELEASE,
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,37 @@ device_support:
controller: HueDimmerController
delay: 350
mapping:
- "Click \"I\" → Turn on"
- "Hold \"I\" → Color temp up / Right color wheel"
- 'Click "I" → Turn on'
- 'Hold "I" → Color temp up / Right color wheel'
- "Click 🔆 → Brighten up (1 step)"
- "Hold 🔆→ Brighten up"
- "Click 🔅 → Dim down (1 step)"
- "Hold 🔅 → Dim down"
- "Click \"O\" → Turn off"
- "Hold \"O\" → Color temp down / Left color wheel"
- 'Click "O" → Turn off'
- 'Hold "O" → Color temp down / Left color wheel'
integrations:
- name: Zigbee2MQTT
codename: z2m
actions:
- "on-press → Click \"I\""
- "on-hold → Hold \"I\""
- "on-hold-release → Release \"I\""
- 'on-press → Click "I"'
- 'on-hold → Hold "I"'
- 'on-hold-release → Release "I"'
- "up-press → Click 🔆"
- "up-hold → Hold 🔆"
- "up-hold-release → Release 🔆"
- "down-press → Click 🔅"
- "down-hold → Hold 🔅"
- "down-hold-release → Release 🔅"
- "off-press → Click \"O\""
- "off-hold → Hold \"O\""
- "off-hold-release → Release \"O\""
- 'off-press → Click "O"'
- 'off-hold → Hold "O"'
- 'off-hold-release → Release "O"'
- name: deCONZ
codename: deconz
actions:
- "1000 → Click \"I\""
- "1001 → Hold \"I\""
- "1002 → Click release \"I\""
- "1003 → Hold release \"I\""
- '1000 → Click "I"'
- '1001 → Hold "I"'
- '1002 → Click release "I"'
- '1003 → Hold release "I"'
- "2000 → Click 🔆"
- "2001 → Hold 🔆"
- "2002 → Click release 🔆"
Expand All @@ -44,30 +44,30 @@ integrations:
- "3001 → Hold 🔅"
- "3002 → Click release 🔅"
- "3003 → Hold release 🔅"
- "4000 → Click \"O\""
- "4001 → Hold \"O\""
- "4002 → Click release \"O\""
- "4003 → Hold release \"O\""
- '4000 → Click "O"'
- '4001 → Hold "O"'
- '4002 → Click release "O"'
- '4003 → Hold release "O"'
- name: ZHA
codename: zha
actions: # CHANGE THIS
- "on_short_release → Click \"I\""
- "on_hold → Hold \"I\""
- "on_long_release → Release \"I\""
actions:
- 'on_short_release → Click "I"'
- 'on_hold → Hold "I"'
- 'on_long_release → Release "I"'
- "up_short_release → Click 🔆"
- "up_hold → Hold 🔆"
- "up_long_release → Release 🔆"
- "down_short_release → Click 🔅"
- "down_hold → Hold 🔅"
- "down_long_release → Release 🔅"
- "off_short_release → Click \"O\""
- "off_hold → Hold \"O\""
- "off_long_release → Release \"O\""
- 'off_short_release → Click "O"'
- 'off_hold → Hold "O"'
- 'off_long_release → Release "O"'

note: >-
In case of working with <strong>z2m</strong> and wanting to use the multiclick functionality, then
you need to make sure to remove from the device specific (devices.yaml) the
`multiple_press_timeout` option.
In case of <strong>deCONZ</strong>, all the click actions are mapped with X002 actions, so when the
button is released after being clicked.
button is released after being clicked.
17 changes: 17 additions & 0 deletions docs/_data/controllers/8718699693985.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Hue Smart Button (Philips)
device_support:
- type: Light
domain: light
controller: HueSmartButtonLightController
delay: 350
mapping:
- "Click → Toggle"
- "Hold → Brightness up/down with direction changes"
integrations:
- name: deCONZ
codename: deconz
actions:
- "1000 → Click"
- "1001 → Hold"
- "1002 → Click release"
- "1003 → Hold release"
28 changes: 14 additions & 14 deletions docs/_data/controllers/LEGRAND-600083.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ device_support:
controller: Legrand600083LightController
delay: 350
mapping:
- press bottom button → Turn on
- press top button → Turn off
- hold bottom button → Brighten up
- hold top button → Dim down
- "press bottom button → Turn on"
- "press top button → Turn off"
- "hold bottom button → Brighten up"
- "hold top button → Dim down"
integrations:
- name: Zigbee2MQTT
codename: z2m
actions:
- "on" → press bottom button
- "off" → press top button
- brightness_move_up → hold bottom button
- brightness_move_down → hold top button
- brightness_stop → release any button
- '"on" → press bottom button'
- '"off" → press top button'
- "brightness_move_up → hold bottom button"
- "brightness_move_down → hold top button"
- "brightness_stop → release any button"
- name: ZHA
codename: zha
actions:
- 1_on → press bottom button
- 1_off → press top button
- 1_move_up → hold bottom button
- 1_move_down → hold top button
- 1_stop → release any button
- "1_on → press bottom button"
- "1_off → press top button"
- "1_move_up → hold bottom button"
- "1_move_down → hold top button"
- "1_stop → release any button"
56 changes: 28 additions & 28 deletions docs/_data/controllers/LEGRAND-600088.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,38 @@ device_support:
controller: Legrand600088LightController
delay: 350
mapping:
- press bottom left button → Turn on
- press top left button → Turn off
- hold bottom left button → Change color or color temperature up
- hold top left button → Change color or color temperature down
- press bottom right button → Full brightness
- press top right button → Minimum brightness
- hold bottom right button → Brighten up
- hold top right button → Dim down
- "press bottom left button → Turn on"
- "press top left button → Turn off"
- "hold bottom left button → Change color or color temperature up"
- "hold top left button → Change color or color temperature down"
- "press bottom right button → Full brightness"
- "press top right button → Minimum brightness"
- "hold bottom right button → Brighten up"
- "hold top right button → Dim down"
integrations:
- name: Zigbee2MQTT
codename: z2m
actions:
- on_left → press bottom left button
- off_left → press top left button
- brightness_move_up_left → hold bottom left button
- brightness_move_down_left → hold top left button
- brightness_stop_left → release any left button
- on_right → press bottom right button
- off_right → press top right button
- brightness_move_up_right → hold bottom right button
- brightness_move_down_right → hold top right button
- brightness_stop_right → release any right button
- "on_left → press bottom left button"
- "off_left → press top left button"
- "brightness_move_up_left → hold bottom left button"
- "brightness_move_down_left → hold top left button"
- "brightness_stop_left → release any left button"
- "on_right → press bottom right button"
- "off_right → press top right button"
- "brightness_move_up_right → hold bottom right button"
- "brightness_move_down_right → hold top right button"
- "brightness_stop_right → release any right button"
- name: ZHA
codename: zha
actions:
- 1_on → press bottom left button
- 1_off → press top left button
- 1_move_up → hold bottom left button
- 1_move_down → hold top left button
- 1_stop → release any left button
- 2_on → press bottom right button
- 2_off → press top right button
- 2_move_up → hold bottom right button
- 2_move_down → hold top right button
- 2_stop → release any right button
- "1_on → press bottom left button"
- "1_off → press top left button"
- "1_move_up → hold bottom left button"
- "1_move_down → hold top left button"
- "1_stop → release any left button"
- "2_on → press bottom right button"
- "2_off → press top right button"
- "2_move_up → hold bottom right button"
- "2_move_down → hold top right button"
- "2_stop → release any right button"
File renamed without changes
Binary file added docs/assets/img/8718699693985.jpeg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
layout: controller
title: Hue Dimmer switch (Philips)
device: hue-dimmer-switch
device: "324131092621"
---
5 changes: 5 additions & 0 deletions docs/controllers/8718699693985.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: controller
title: Hue Smart Button (Philips)
device: "8718699693985"
---

0 comments on commit e81208a

Please sign in to comment.