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

Added support for IKEA E2201 RODRET Dimmer. #693

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

yarafie
Copy link
Contributor

@yarafie yarafie commented Feb 20, 2025

Thank you for taking the time to work on a Pull Request. Your contribution is really appreciated! 🎉
Please don't delete any part of the template, since keeping the provided structure will help maintainers to review your work more rapidly.

Sections marked as * are required and need to be filled in.

Proposed change*
IKEA E2201 RODRET Dimmer - Initial Release -
Added support for IKEA E2201 RODRET Dimmer.

Checklist*
[Y] I followed sections of the [Contribution Guidelines (https://github.com/yarafie/awesome-ha-blueprints/blob/main/CONTRIBUTING.md) relevant to changes I'm proposing.
[Y] I properly tested proposed changes on my system and confirm that they are working as expected.
[Y] I formatted files with Prettier using the command npm run format before submitting my Pull Request.

Copy link
Contributor

github-actions bot commented Feb 20, 2025

Hey @yarafie, thank you so much for your contribution! 🚀

🔄 We're currently running a few checks to make sure that everything is great with your contribution.
If further actions need to be performed before your contribution can be reviewed, additional guidance will be provided to you in the next comment.

Results are coming soon, stay tuned!

Copy link
Contributor

github-actions bot commented Feb 20, 2025

@yarafie
Copy link
Contributor Author

yarafie commented Feb 20, 2025

@EPMatt I was playing around with github and messed things up.

So decided to just start over and do a new PR.

Copy link

@Foggy2 Foggy2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @yarafie

I was curious how automations work in HA so I have spent some time going through the YAML to understand it.

I think I have a solution for the actions configured on the controller blueprint conflicting with the actions configured in the linked hook.

Specifically, configuring custom actions on the controller will not function as expected. With both the hook and controller executing the configured actions for that event, instead of just the custom actions on the controller.

In my limited testing this seems to work well, but I am not very familiar with HA automations so have a look and let me know your thoughts.

Comment on lines 431 to 437
- event: ahb_controller_event
event_data:
controller: '{{ controller_id }}'
action: button_up_double
- choose:
- conditions: []
sequence: !input action_button_up_double
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- event: ahb_controller_event
event_data:
controller: '{{ controller_id }}'
action: button_up_double
- choose:
- conditions: []
sequence: !input action_button_up_double
- choose:
- conditions:
- condition: template
value_template: '{{ iif(action_up_button_double, true, false) }}'
sequence: !input action_button_up_double
default:
- event: ahb_controller_event
event_data:
controller: '{{ controller_id }}'
action: button_up_double

button_up_long_max_loop_repeats: !input button_up_long_max_loop_repeats
button_down_long_max_loop_repeats: !input button_down_long_max_loop_repeats
# Button Inputs for Virtual Double Press
helper_double_press_delay: !input helper_double_press_delay
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
helper_double_press_delay: !input helper_double_press_delay
helper_double_press_delay: !input helper_double_press_delay
action_up_button_double: !input action_button_up_double

@yarafie
Copy link
Contributor Author

yarafie commented Feb 23, 2025

Thanks. will take a look at it.
I also found a logic issue in the current blueprint itself, need to test it first has to do with when to call the hook events themselves, I think I was calling them more than they should be called,

@yarafie
Copy link
Contributor Author

yarafie commented Feb 26, 2025

Hi @yarafie

I was curious how automations work in HA so I have spent some time going through the YAML to understand it.

I think I have a solution for the actions configured on the controller blueprint conflicting with the actions configured in the linked hook.

Specifically, configuring custom actions on the controller will not function as expected. With both the hook and controller executing the configured actions for that event, instead of just the custom actions on the controller.

In my limited testing this seems to work well, but I am not very familiar with HA automations so have a look and let me know your thoughts.

@Foggy2

I haven't gotten to look at your proposel yet, but I just pushed a new version for the Rodret on my fork.

I think I fixed the hook and configured custom actions overlap.
I also added the ability to enable looping of custom actions on long press (Needs to be enabled otherwise default is not to loop)

If you are game to test it, test away.

Copy link
Contributor

github-actions bot commented Mar 2, 2025

Copy link
Contributor

github-actions bot commented Mar 2, 2025

@Foggy2
Copy link

Foggy2 commented Mar 3, 2025

@yarafie I have the updated blueprint setup on two remotes that are linked to lights. So far so good.

Have tested

  • up (on)
  • down (off)
  • long press up (brightness up)
  • long press down (brightness down)
  • Double press up (color change)
  • Double press down (color change)

With the exception of custom actions all seem to work well. I did not test any of the long press configuration options, only what was set by default.

Concerning the custom actions, as noted above, both the custom action and the standard hook action are triggered simultaneously which is undesirable.

Thanks!

@yarafie
Copy link
Contributor Author

yarafie commented Mar 3, 2025

@yarafie I have the updated blueprint setup on two remotes that are linked to lights. So far so good.

Have tested

  • up (on)
  • down (off)
  • long press up (brightness up)
  • long press down (brightness down)
  • Double press up (color change)
  • Double press down (color change)

With the exception of custom actions all seem to work well. I did not test any of the long press configuration options, only what was set by default.

Concerning the custom actions, as noted above, both the custom action and the standard hook action are triggered simultaneously which is undesirable.

Thanks!

Thanks for testing.

The way EPMatt has setup his platform is to fire both the hook actions and custom actions at the same time. That's the way it is designed.
When you say "With the exception of cystom actions" are they not working?"

@Foggy2
Copy link

Foggy2 commented Mar 3, 2025

The way EPMatt has setup his platform is to fire both the hook actions and custom actions at the same time. That's the way it is designed.
When you say "With the exception of cystom actions" are they not working?"

No, the custom actions are working correctly but they fire both the hook and the custom action at the same time.

I realize now, that perhaps I have made an incorrect assumption that this behavior is unintended. My opinion is that if a custom action has been defined, then that should override the default action of the connected hook as multiple conflicting actions would cause undesired behaviors.

If it is intended that both actions are fired, then I would like to propose that another option be added to the UI that allows changing this behavior so that custom actions override the default hook.

@esolitos
Copy link

esolitos commented Mar 3, 2025

My opinion is that if a custom action has been defined, then that should override the default action of the connected hook as multiple conflicting actions would cause undesired behaviors.

I disagree: IMHO the correct behaviour is that all the Hooks should run.

If it is intended that both actions are fired, then I would like to propose that another option be added to the UI that allows changing this behavior so that custom actions override the default hook.

While this could makes sense, it would be out of scope for this PR, as this should be implemented in all the controllers.

@yarafie
Copy link
Contributor Author

yarafie commented Mar 3, 2025

The way EPMatt has setup his platform is to fire both the hook actions and custom actions at the same time. That's the way it is designed.
When you say "With the exception of cystom actions" are they not working?"

No, the custom actions are working correctly but they fire both the hook and the custom action at the same time.

I realize now, that perhaps I have made an incorrect assumption that this behavior is unintended. My opinion is that if a custom action has been defined, then that should override the default action of the connected hook as multiple conflicting actions would cause undesired behaviors.

Actually this gives more flexibility, but you really need to pay attention on how you set it up.
For example I have my RODRET Controlling two lamp lights using the Light hook so I csn turn off, turn on/,increase and decrease brightness using single and long presses.
The same RODRET I have set the double press custom action to turn on/off a closet light.

If it is intended that both actions are fired, then I would like to propose that another option be added to the UI that allows changing this behavior so that custom actions override the default hook.

Would defeat the flexibility mentioned above.

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.

3 participants