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

[NEW DEVICE] TuYa ERS-10TZBVK-AA in Z2M #559

Closed
domidyon opened this issue Aug 30, 2022 · 16 comments
Closed

[NEW DEVICE] TuYa ERS-10TZBVK-AA in Z2M #559

domidyon opened this issue Aug 30, 2022 · 16 comments
Assignees
Labels
new-device New device

Comments

@domidyon
Copy link

domidyon commented Aug 30, 2022

New Device Support

Device Information

  • Device Model: TuYa ERS-10TZBVK-AA
  • Device Description: Smart Knob
  • Device Manufacturer: TuYa

Integration: z2m

Actions

  • rotate_right: Sent when knob is rotated to the right
  • rotate_left: Sent when knob is rotated to the left
  • single: Sent when knob is pushed downward
  • double: Sent when knob is pushed downward twice
  • hold: Sent when knob is pushed down and kept down for a few seconds

Notes

Aforementioned actions were performed when device was in 'event' mode.

@domidyon domidyon added the new-device New device label Aug 30, 2022
@xaviml
Copy link
Owner

xaviml commented Sep 5, 2022

Hi @domidyon ,

Thank you for the device information, I will be giving support for this device for next release.

According to documentation, the device exposes more actions: https://www.zigbee2mqtt.io/devices/ERS-10TZBVK-AA.html Is that correct?

Regards,
Xavi M.

@domidyon
Copy link
Author

domidyon commented Sep 5, 2022

Hi @domidyon ,

Thank you for the device information, I will be giving support for this device for next release.

According to documentation, the device exposes more actions: https://www.zigbee2mqtt.io/devices/ERS-10TZBVK-AA.html Is that correct?

Regards, Xavi M.

Hi Xavi,

I would love to check that out for you. Unfortunately, i'm having a hard time to figure out how I would perform a scan or whatever to see what else is possible for the device. Do you have a link or article I could dive into and let you know?

@RedWavve
Copy link

RedWavve commented Sep 5, 2022

Proper Z2M description is the link you shared, yes.

Device can be set in two modes : COMMAND and EVENT

COMMAND mode will send:

  • ACTION (Rotate Left)= Brightness_Step_Up
  • ACTION (Rotate Right) = Brightness_Step_Down
  • ACTION (Single Click) = Toggle
  • ACTION (HOLD more than 3s) = Hue_Move
  • Action (UnHold button) = Hue_Stop
  • ACTION (Push+Hold and Rotate Left) = color_temperature_step_up
  • ACTION (Push+Hold and Rotate Left)= color_temperature_step_down
  • Action_Step_Size = %Numeric_Value (0_255)
  • Action_Rate = Keeps "No value" all the time

There is no double push in Command Mode

EVENT mode will send:

  • ACTION (Rotate Left) = rotate_left
  • ACTION (Rotate Left)= rotate_right
  • ACTION (Single Click)= single
  • ACTION (Double Click) = double
  • ACTION (Hold) = hold

In EVENT mode, action_step_size, action_transition_time, action_rate are still present but show "no value"

A triple click seems firmware dependend (no action shown) and will toggle between COMMAND and EVENT mode.

It is however possible to impact on the command mode:
"Operation mode: "command" - for group control, "event" - for clicks. Value can be found in the published state on the operation_mode property. To read (/get) the value publish a message to topic zigbee2mqtt/FRIENDLY_NAME/get with payload {"operation_mode": ""}. To write (/set) a value publish a message to topic zigbee2mqtt/FRIENDLY_NAME/set with payload {"operation_mode": NEW_VALUE}. The possible values are: command, event."

As i'd be trying to use mine using HASS.AGENT, could we have Light, Zigbee2MQTT Light, as well as MediaController for this device if possible ?
I'd basically hack it using the Active_Windows entity, and try to make it act differently in Plex, Youtube, etc
Thank you !

@domidyon
Copy link
Author

domidyon commented Sep 5, 2022

Ah thanks @RedWavve -- I haven't had mine in 'action' mode. I will report the corresponding actions to button presses/actions in 20 minutes or so - currently doing some maintenance on my Z2M.

@RedWavve
Copy link

RedWavve commented Sep 5, 2022

Ah thanks @RedWavve -- I haven't had mine in 'action' mode. I will report the corresponding actions to button presses/actions in 20 minutes or so - currently doing some maintenance on my Z2M.

I should have them all up, so no need !

You can see or check the mode in Z2M, using the "Expose" tab of the device

@xaviml
Copy link
Owner

xaviml commented Sep 9, 2022

Hi @domidyon and @RedWavve ,

Thank you for your input. I am currently implementing the default mapping for this controller and this is what I came up with:

# Command mode
"brightness_step_up": Light.CLICK_BRIGHTNESS_UP,
"brightness_step_down": Light.CLICK_BRIGHTNESS_DOWN,
"toggle": Light.TOGGLE,
"hue_move": Light.HOLD_BRIGHTNESS_TOGGLE,
"hue_stop": Light.RELEASE,
"color_temperature_step_up": Light.CLICK_COLOR_UP,
"color_temperature_step_down": Light.CLICK_COLOR_DOWN,

# Event mode
"rotate_left": Light.CLICK_BRIGHTNESS_DOWN,
"rotate_right": Light.CLICK_BRIGHTNESS_UP,
"single": Light.TOGGLE,
"double": Light.ON_FULL_BRIGHTNESS,
"hold": Light.ON_MIN_BRIGHTNESS,

Note that I did not add hold actions to the rotations since there are no stop rotation actions. If you want to feel how this would look like after the device is supported, you can try the following configuration:

example_app:
  module: controllerx
  class: LightController
  controller: sensor.your_controller_action
  integration: z2m
  light: light.your_light
  mapping:
    # Command mode
    brightness_step_up: click_brightness_up
    brightness_step_down: click_brightness_down
    toggle: toggle
    hue_move: hold_brightness_toggle
    hue_stop: release
    color_temperature_step_up: click_color_up
    color_temperature_step_down: click_color_down
    # Event mode
    rotate_left: click_brightness_down
    rotate_right: click_brightness_up
    single: toggle
    double: on_full_brightness
    hold: on_min_brightness

Let me know if there is any action you would change for something different. You can check the predefined actions here.

Regards,
Xavi M.

@RedWavve
Copy link

I'll check, but it is used for controlling my computer volume with Hass.Agent and badly made automations, so I might not be the only one trying the behavior. Plus the device has a lot going on (do I press, do I hold, do I rotate, do the three at the same time just to change the color temp...

My prévision is that most people will use it in "EVENT" mode, and avoid the double clic to not enter the "hell mode".

Otherwise, the last three make perfect sense : I click frantically, give me all the light, and if I hold it like a lady, it will gently fall to min brightness.

And custom mapping is very easy.

Thanks you very much ;-)

@xaviml
Copy link
Owner

xaviml commented Sep 10, 2022

Hi @RedWavve ,

It is up to you to do the testing in any way you thing needs to be done. Ideally, it would be nice to test all events and see if it feels natural or any modifications need to be made.

I can help you out to give you a custom mapping for a media player too.

Unfortunately, I do not have this controller, so I can not test it out myself.

Regards,
Xavi M.

@domidyon
Copy link
Author

Hi @xaviml

For me, the current mappings you've set up are perfect and exactly what I am looking for. No further feedback from me. I could perform the testing for you if you'd like. Is this in a beta repo or a way in which I could implement this myself to let you know?

@xaviml
Copy link
Owner

xaviml commented Sep 11, 2022

Hi @domidyon ,

Thank you for confirming. You ca copy and paste the controllerx config I left in my previous comment with the mapping. That should work with you current ControllerX version, and it will simulate what the mapping for this controller will do.

Regards,
Xavi M.

@domidyon
Copy link
Author

@xaviml First and foremost, many thanks for your implementation!

The command mode is working fine. It's not as silky smooth as the IKEA remotes i've got in ControllerX, but I think that's due to the limitations of the device itself and not your implementation. I am guessing it sends outs it's messages somewhat spread or delayed.

The event mode is rather finicky for me, and the turning of the knob is sometimes not picked up properly so it tends to do the opposite of what I want it to do (Dim the light instead of making them brighter). Other than that - it's really great! Let me know if I can do some more in depth stuff for you.

@xaviml
Copy link
Owner

xaviml commented Sep 11, 2022

Hi @domidyon ,

Thank you for the testing (and the donation :) ). It seems that what you experience is device specific I would say. The IKEA controller are great because it has an action when it starts rotating, and when it stops, so ControllerX can control it much smoothly. For this controller there is no stop action when it stops rotating, so the rotation action is a "click" action, as you would do with a button click. This is probably what you are experiencing. The only hold action I added is when you long press the knob (in command mode), so that one should work quite smoothly because it has a stop action.

Regards,
Xavi M.

@domidyon
Copy link
Author

Hi Xavi,

Makes sense and confirms what I suspected! This will do more than fine for my use case. Consider this issue closed for my part. I am unsure whether RedWavve requires any further support so i'll leave it open.

@xaviml
Copy link
Owner

xaviml commented Sep 11, 2022

Thank you @domidyon ,

Leave it open for now. I will be adding support to device as a media player controller as well based on the light mapping.

I will be closing this issue myself once it is released.

Regards,
Xavi M.

@xaviml
Copy link
Owner

xaviml commented Sep 12, 2022

I created a new beta release that includes the support for this controller. You can check release notes here.

I will be releasing the normal version later this week.

@xaviml
Copy link
Owner

xaviml commented Sep 17, 2022

This device is now ready to be used in ControllerX v4.23.0. I will mark this issue as closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-device New device
Projects
None yet
Development

No branches or pull requests

3 participants