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

remove spaces to match new helper format in 2023.5 #545

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LordSushiPhoenix
Copy link

@LordSushiPhoenix LordSushiPhoenix commented May 5, 2023

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.

Breaking change

If your PR contains a breaking change for existing users, it is important to describe what breaks, how to make it work again and why we did this. This section will be used to craft the changelog entry, after your PR gets approved and merged.

Note: Remove this section if this PR is NOT a breaking change.

May break compatibility with Home Assistant versions before 2023.5

Proposed change*

Describe the big picture of your changes here, and why your pull request should be accepted. If it fixes a bug or resolves a feature request, be sure to put closes #XXXX in this section to auto-close relevant issues.

Please note that for important and breaking changes it's always better to open an issue first for discussing the proposal.

Make sure to provide enough information so that your pull request can be reviewed.

The last controller event format has changed in 2023.5 and broken some controller automations. Removing spaces fixes it. Closes #544

#544 (comment)

Checklist*

  • I followed sections of the Contribution Guidelines relevant to changes I'm proposing.
  • I properly tested proposed changes on my system and confirm that they are working as expected.
  • I formatted files with Prettier using the command npm run format before submitting my Pull Request.

@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2023

Hey @LordSushiPhoenix, 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

@tumtumsback tumtumsback left a comment

Choose a reason for hiding this comment

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

Implemented this, but it did not solve the issue for me.

@LaPe63
Copy link

LaPe63 commented May 8, 2023

This change works for me on both of my systems, with E1743 controllers.

@tumtumsback
Copy link

Ok so then what am I doing wrong?

I completely replaced the contents here: /config/blueprints/automation/EPMatt/ikea_e1743.yaml

I copied the raw conents of the e1743.yaml file posted by @LordSushiPhoenix overtop of the existing contents, saved, restarted home assistant, but no dice... am I doing something wrong?

@tumtumsback
Copy link

This change works for me on both of my systems, with E1743 controllers.

LaPe63 what is your secret ... I've tried everything, I can't get double press events working on my E1743 remotes in 2023.5+

@LaPe63
Copy link

LaPe63 commented May 15, 2023

This change works for me on both of my systems, with E1743 controllers.

LaPe63 what is your secret ... I've tried everything, I can't get double press events working on my E1743 remotes in 2023.5+

Dont know, just made sure i had the latest version (2022.08.08) and then i edited the file directly under /config/blueprints/automation/EPMatt/ and removed the spaces in 6 places, and restarted HA. I did the same on ikea_e2001_e2002, and it also worked.

@tumtumsback
Copy link

tumtumsback commented May 15, 2023

This change works for me on both of my systems, with E1743 controllers.

LaPe63 what is your secret ... I've tried everything, I can't get double press events working on my E1743 remotes in 2023.5+

Dont know, just made sure i had the latest version (2022.08.08) and then i edited the file directly under /config/blueprints/automation/EPMatt/ and removed the spaces in 6 places, and restarted HA. I did the same on ikea_e2001_e2002, and it also worked.

6 places? what do you mean by that ...

Also, what integration are you using -- Deconz, ZHA, or Z2M?

@LordSushiPhoenix
Copy link
Author

I'm using Z2M.

@tumtumsback
Copy link

Hmm okay because my 1743s are joined via Deconz ... I wonder if there's something different there?

@LordSushiPhoenix
Copy link
Author

LordSushiPhoenix commented May 15, 2023

Possibly, I've only ever used or tested Z2M. Does the string in your last event helper look like the ones in this comment? #544 (comment)

@tumtumsback
Copy link

Possibly, I've only ever used or tested Z2M. Does the string in your last event helper look like the ones in this comment? #544 (comment)

To test this, I'd have to snapshot (so I can rollback when doubletap breaks again), upgrade to 2023.5, and then test... I'll see what I can do later today.

@LordSushiPhoenix
Copy link
Author

If you grab the string on 2023.5 that would at least validate whether or not the new regex matches it without rolling back.

@tumtumsback
Copy link

If you grab the string on 2023.5 that would at least validate whether or not the new regex matches it without rolling back.

10-4 // and where exactly would I be looking for this string -- in the Deconz logs?

@LordSushiPhoenix
Copy link
Author

Right in home assistant, under the helpers tab. Find the input text helper used for the automation and copy the value.

@LaPe63
Copy link

LaPe63 commented May 15, 2023

Hmm okay because my 1743s are joined via Deconz ... I wonder if there's something different there?

Hmm okay because my 1743s are joined via Deconz ... I wonder if there's something different there?

I'm also on z2M.

@LaPe63
Copy link

LaPe63 commented May 15, 2023

This change works for me on both of my systems, with E1743 controllers.

LaPe63 what is your secret ... I've tried everything, I can't get double press events working on my E1743 remotes in 2023.5+

Dont know, just made sure i had the latest version (2022.08.08) and then i edited the file directly under /config/blueprints/automation/EPMatt/ and removed the spaces in 6 places, and restarted HA. I did the same on ikea_e2001_e2002, and it also worked.

6 places? what do you mean by that ...
I changed the line 280 and 281 to match the commit.

Also, what integration are you using -- Deconz, ZHA, or Z2M?
Z2M.

@tumtumsback
Copy link

Before 2023.5:

Successful Fan turn off:

Text 1 changed to {"trigger_action": "double_press", "last_triggered": "2023-05-15 09:37:31.006032-04:00"} triggered by automation Bathroom - Doubletap - Fan triggered by event 'deconz_event'
9:37:31 AM - 5 hours ago
Text 1 changed to {"trigger_action": 2002, "last_triggered": "2023-05-15 09:37:31.000759-04:00"} triggered by automation Bathroom - Doubletap - Fan triggered by event 'deconz_event'
9:37:31 AM - 5 hours ago
Text 1 changed to {"trigger_action": 2002, "last_triggered": "2023-05-15 09:37:30.200153-04:00"} triggered by automation Bathroom - Doubletap - Fan triggered by event 'deconz_event'
9:37:30 AM - 5 hours ago

Successful Fan turn on:

Text 1 changed to {"trigger_action": "double_press", "last_triggered": "2023-05-15 09:37:26.105687-04:00"} triggered by automation Bathroom - Doubletap - Fan triggered by event 'deconz_event'
9:37:26 AM - 5 hours ago
Text 1 changed to {"trigger_action": 1002, "last_triggered": "2023-05-15 09:37:26.100899-04:00"} triggered by automation Bathroom - Doubletap - Fan triggered by event 'deconz_event'
9:37:26 AM - 5 hours ago
Text 1 changed to {"trigger_action": 1002, "last_triggered": "2023-05-15 09:37:25.300586-04:00"} triggered by automation Bathroom - Doubletap - Fan triggered by event 'deconz_event'
9:37:25 AM - 5 hours ago

After 2023.5:

Unsuccessful Fan turn on(s):

Double press attempt #2

Text 1 changed to {"a":1002,"t":1684174588.065661} triggered by automation Bathroom - Doubletap - Fan triggered by event 'deconz_event'
2:16:28 PM - 23 seconds ago
Text 1 changed to {"a":1002,"t":1684174587.465954} triggered by automation Bathroom - Doubletap - Fan triggered by event 'deconz_event'

Double press attempt #1

2:16:27 PM - 24 seconds ago
Text 1 changed to {"a":1002,"t":1684174583.114406} triggered by automation Bathroom - Doubletap - Fan triggered by event 'deconz_event'
2:16:23 PM - 28 seconds ago
Text 1 changed to {"a":1002,"t":1684174582.609161} triggered by automation Bathroom - Doubletap - Fan triggered by event 'deconz_event'

@tumtumsback
Copy link

tumtumsback commented May 15, 2023

So regarding the above, I upgraded to 2023.5, then replaced the YAML with the fixed YAML, then restarted HA completely, and that's what I get.

Before 2023.5, you can see after two "1002" events, it then successfully triggers the "double_press" action to turn on the Fan.

After 2023.5, you can see the two "1002" events, but a "double_press" action never follows. And, I see the "1002" events appear to be crafted differently -- I see "a" now instead of "trigger_action" -- I guess the newer YAML has different conventions/coding in it...

@LordSushiPhoenix
Copy link
Author

LordSushiPhoenix commented May 15, 2023

Assuming you were running the version of the blueprint yaml that's currently in main, I'm not sure why it works for you on 2022.4, but the yaml is trying to match the string "a":".*", i.e. "a":"1002" where the deconz events are stored as "a":1002. This probably has something to do with it since there are no quote characters to match.

@tumtumsback
Copy link

tumtumsback commented May 15, 2023 via email

@LordSushiPhoenix
Copy link
Author

LordSushiPhoenix commented May 15, 2023

This probably has something to do with it since there are no quote characters to match.

try removing the escaped quotation marks around the .* in both lines.

Edit: if your version of the yaml was old enough, it may also have been before the introduction of debouncing, you may need to play with the debounce and double press delay. FWIW a triple tap more reliably triggers the double tap action on both my e1743 and e2001 controllers when the double press delay is set to a sane value (double tap consistently triggers when it's set to 4000ms, but then you have to wait 4s for single press actions.)

@tumtumsback
Copy link

This probably has something to do with it since there are no quote characters to match.

try removing the escaped quotation marks around the .* in both lines.

Edit: if your version of the yaml was old enough, it may also have been before the introduction of debouncing, you may need to play with the debounce and double press delay. FWIW a triple tap more reliably triggers the double tap action on both my e1743 and e2001 controllers when the double press delay is set to a sane value (double tap consistently triggers when it's set to 4000ms, but then you have to wait 4s for single press actions.)

HOLY FLIP!

I removed the escaped quotation marks as you had suggested and it fricken worked.

@tumtumsback
Copy link

So I assume this YAML now needs to be updated again to fix the regex to work properly with deconz?

@anthonylavado
Copy link

Just wanted to add that this fixed long press issues for me with ZHA. There is indeed a difference between how HASS 2023.4.x and older would parse the messages. The new message format omits the spaces in the helper text.

@larsmathuseck
Copy link

Any updates on this PR? Waiting for this fix to be merged ✌️

@botrosco
Copy link

This also fixes the E1744 indefinitely increasing/decreasing brightness levels

@arsenicks
Copy link

Any updates on this PR? Waiting for this fix to be merged ✌️

Witth 48PR currently waiting, I wouldn't bet on that. I'm not sure @EPMatt still maintain, he seems absent from this project for few months but he seems to be active on some of his other github repo so I don't know what's up.. It's not an easy job to maintain "big" projects, he might be exausted or anything.. It would just be nice to know what's happening so everybody can move on with a fork or he can nominate other member of the community to help I guess.

Someone has oppenned an issue asking if the repo is really unmaintained/dead, noreply yet.. ( issue #554 )

@collateral127
Copy link

collateral127 commented Sep 13, 2023

This probably has something to do with it since there are no quote characters to match.

try removing the escaped quotation marks around the .* in both lines.
Edit: if your version of the yaml was old enough, it may also have been before the introduction of debouncing, you may need to play with the debounce and double press delay. FWIW a triple tap more reliably triggers the double tap action on both my e1743 and e2001 controllers when the double press delay is set to a sane value (double tap consistently triggers when it's set to 4000ms, but then you have to wait 4s for single press actions.)

HOLY FLIP!

I removed the escaped quotation marks as you had suggested and it fricken worked.

if anyone is curious as to how you should structure that string for deconz, here it is:

regex_match("^\{((\"a\":.*|\"t\":\d+\.\d+)(,)?){2}\}$"))

not gonna lie, it took me far too long to work this out - i don't know regex very well, and was having trouble translating the words you were all speaking into regex that actually worked haha

if you replace the regex in lines 439 and 440 (of the current file in main) with the above, it should start working for users with deconz integrations

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.

Bug - Controller - IKEA E1743 TRÅDFRI On/Off Switch & Dimmer - Double Tap stopped working
8 participants