Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ZBT-CCTSwitch-D0001 [Alternative Implementation] #838

Closed
wants to merge 1 commit into from

Conversation

verjus
Copy link
Contributor

@verjus verjus commented Dec 23, 2019

This is a different implementation to that of @qosmio that I would like to propose as an alternative. It is not fundamentally different but it differs in some important details.

  • The remote support 4 physical buttons (click) defined as [on/off, dimmer, CCT and scene]
  • Two virtual buttons are defined as [dimmer-hold and CCT-hold]
  • The following actions are defined [on, off, brightness_up, brightness_down, color_temp_up, color_temp_down, recall]
  • In addition, the following actions are associated with a long press: [release_brightness_up, release_brightness_down, release_color_temp_up, release_color_temp_down]
  • The state ON/OFF kept by the remote is passed along all messages.
  • The state is set to ON when the scene button is pressed.
  • The implementation does not rely on sequence number to merge both messages generated by a press on the Scene button (button 4). Note that button 4 can be programmed by holding it down to 3 scenes defined as combination of (color temperature and brightness)
  • For consistency with other controllers, states are in upper case (ON/OFF) and color temperature is defined as color_temp instead of colortemp.
  • Raw transition time is passed
  • Raw color temperature is passed. It appears that the color temperature is encoded as 17.6 times its value in Kelvin. color_temp = 370 is equivalent to 650K.

Button 1

(Pressed 3 times in a row)
{"linkquality":2,"color_temp":222,"brightness":64,"state":"OFF","action":"off","click":"on/off"}
{"linkquality":0,"color_temp":222,"brightness":64,"state":"ON","action":"on","click":"on/off"}
{"linkquality":5,"color_temp":222,"brightness":64,"state":"OFF","action":"off","click":"on/off"}

Button 2

(Pressed 9 times in a row)
{"linkquality":15,"color_temp":222,"brightness":191,"state":"OFF","transition_time":3,"click":"dimmer","action":"brightness_down"}
{"linkquality":15,"color_temp":222,"brightness":127,"state":"OFF","transition_time":3,"click":"dimmer","action":"brightness_down"}
{"linkquality":15,"color_temp":222,"brightness":64,"state":"OFF","transition_time":3,"click":"dimmer","action":"brightness_down"}
{"linkquality":15,"color_temp":222,"brightness":13,"state":"OFF","transition_time":3,"click":"dimmer","action":"brightness_down"}
{"linkquality":15,"color_temp":222,"brightness":64,"state":"OFF","transition_time":3,"click":"dimmer","action":"brightness_up"}
{"linkquality":13,"color_temp":222,"brightness":127,"state":"OFF","transition_time":3,"click":"dimmer","action":"brightness_up"}
{"linkquality":15,"color_temp":222,"brightness":191,"state":"OFF","transition_time":3,"click":"dimmer","action":"brightness_up"}
{"linkquality":10,"color_temp":222,"brightness":254,"state":"OFF","transition_time":3,"click":"dimmer","action":"brightness_up"}
{"linkquality":15,"color_temp":222,"brightness":191,"state":"OFF","transition_time":3,"click":"dimmer","action":"brightness_down"}

Button 3

(Pressed 9 times in a row)
{"linkquality":0,"color_temp":285,"brightness":191,"state":"OFF","transition_time":3,"click":"CCT","action":"color_temp_down"}
{"linkquality":5,"color_temp":222,"brightness":191,"state":"OFF","transition_time":3,"click":"CCT","action":"color_temp_down"}
{"linkquality":0,"color_temp":181,"brightness":191,"state":"OFF","transition_time":3,"click":"CCT","action":"color_temp_down"}
{"linkquality":13,"color_temp":153,"brightness":191,"state":"OFF","transition_time":3,"click":"CCT","action":"color_temp_down"}
{"linkquality":2,"color_temp":181,"brightness":191,"state":"OFF","transition_time":3,"click":"CCT","action":"color_temp_up"}
{"linkquality":0,"color_temp":222,"brightness":191,"state":"OFF","transition_time":3,"click":"CCT","action":"color_temp_up"}
{"linkquality":5,"color_temp":285,"brightness":191,"state":"OFF","transition_time":3,"click":"CCT","action":"color_temp_up"}
{"linkquality":5,"color_temp":370,"brightness":191,"state":"OFF","transition_time":3,"click":"CCT","action":"color_temp_up"}
{"linkquality":0,"color_temp":285,"brightness":191,"state":"OFF","transition_time":3,"click":"CCT","action":"color_temp_down"}

Button 4

(Pressed 3 times in a row)
{"linkquality":0,"color_temp":370,"brightness":13,"state":"ON","transition_time":3,"click":"scene","action":"recall"}
{"linkquality":10,"color_temp":321,"brightness":254,"state":"ON","transition_time":3,"click":"scene","action":"recall"}
{"linkquality":0,"color_temp":222,"brightness":127,"state":"ON","transition_time":3,"click":"scene","action":"recall"}
{"linkquality":10,"color_temp":370,"brightness":13,"state":"ON","transition_time":3,"click":"scene","action":"recall"}

Button 2 (Long Press):

(Long Pressed twice)
{"linkquality":0,"color_temp":370,"brightness":13,"state":"ON","action":"brightness_up","click":"dimmer-hold"}
{"linkquality":0,"color_temp":370,"brightness":13,"state":"ON","action":"release_brightness_up","click":"dimmer-hold","duration":1529}

{"linkquality":0,"color_temp":370,"brightness":13,"state":"ON","action":"brightness_down","click":"dimmer-hold"}
{"linkquality":0,"color_temp":370,"brightness":13,"state":"ON","action":"release_brightness_down","click":"dimmer-hold","duration":1491}

Button 3 (Long Press):

(Long Pressed twice)
{"linkquality":13,"color_temp":370,"brightness":13,"state":"ON","action":"color_temp_down","click":"CCT-hold"}
{"linkquality":0,"color_temp":370,"brightness":13,"state":"ON","action":"release_color_temp_down","click":"CCT-hold","duration":2045}

{"linkquality":7,"color_temp":370,"brightness":13,"state":"ON","action":"color_temp_up","click":"CCT-hold"}
{"linkquality":0,"color_temp":370,"brightness":13,"state":"ON","action":"release_color_temp_up","click":"CCT-hold","duration":1574}

@Koenkk
Copy link
Owner

Koenkk commented Dec 23, 2019

I've just merged #826 before seeing this, please check together on the best implementation.

@verjus
Copy link
Contributor Author

verjus commented Dec 23, 2019 via email

@verjus verjus closed this Jan 13, 2020
xmow49 pushed a commit to xmow49/zigbee-herdsman-converters that referenced this pull request Jun 14, 2024
Co-authored-by: Koenkk <Koenkk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants