core icon indicating copy to clipboard operation
core copied to clipboard

Not able to toggle lock in UI Verisure

Open jazbraz opened this issue 2 years ago • 53 comments

The problem

I use to toggle the lock in the UI but since beta 2023.2.0b4 or since beta 2023.2.0b0, I get an error message. "Failed to call service lock/lock. Code "for locking None doesn´t match pattern ^\d{6}$" I have the lock code in the config and number of digits as before.

What version of Home Assistant Core has the issue?

Home Assistant 2023.2.0b5

What was the last working version of Home Assistant Core?

Home Assistant 2023.1.7

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Verisure

Link to integration documentation on our website

https://www.home-assistant.io/integrations/verisure/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

jazbraz avatar Jan 30 '23 17:01 jazbraz

Hey there @frenck, mind taking a look at this issue as it has been labeled with an integration (verisure) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of verisure can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign verisure Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


verisure documentation verisure source (message by IssueLinks)

home-assistant[bot] avatar Jan 30 '23 17:01 home-assistant[bot]

This problem has started for me too after upgrading to Home Assistant 2023.2.0 (at least that is the only change that has been made since the integration stopped working). I'm on a docker install.

Logger: homeassistant.components.websocket_api.http.connection
Source: components/lock/__init__.py:102
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:45:44 AM (2 occurrences)
Last logged: 11:41:59 AM

[140549383789424] Code '' for unlocking None doesn't match pattern ^\d{6}$
[140548017923376] Code '' for unlocking None doesn't match pattern ^\d{6}$
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 200, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1787, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1824, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 213, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 681, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 968, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 721, in _handle_entity_call
    await result
  File "/usr/src/homeassistant/homeassistant/components/lock/__init__.py", line 102, in _async_unlock
    raise ValueError(
ValueError: Code '' for unlocking None doesn't match pattern ^\d{6}$

konstantinozh avatar Feb 02 '23 10:02 konstantinozh

Just downgraded to Home Assistant 2023.1.7 using docker and the integration works again so I can confirm that the issue was introduced in 2023.2.0

konstantinozh avatar Feb 02 '23 11:02 konstantinozh

Have the same problem, as above the issue only appeared after upgrading to the beta, however if I go into the lock info I can enter a code and it works to lock/unlock the door. B981D804-4294-422B-972A-06E3803C51B5

flexi80 avatar Feb 02 '23 14:02 flexi80

Have the same problem, as above the issue only appeared after upgrading to the beta, however if I go into the lock info I can enter a code and it works to lock/unlock the door. B981D804-4294-422B-972A-06E3803C51B5

The issue is recreated if you go to your integrations page and enter a default code for the integration to use. Click the configure button on the Verisure integration to enter a default code.

konstantinozh avatar Feb 02 '23 15:02 konstantinozh

Same issue here. Look error code in bottom. Screenshot_2023-02-02-18-35-03-71_c3a231c25ed346e59462e84656a70e50

crackers81 avatar Feb 02 '23 17:02 crackers81

+1

mikke49 avatar Feb 03 '23 09:02 mikke49

+1. Any progress on this or is it quiet?

Mithrox avatar Feb 04 '23 09:02 Mithrox

+1. Any progress on this or is it quiet?

Not heard a thing.

crackers81 avatar Feb 04 '23 09:02 crackers81

I got the same issue after upgrading. Considering roll-back if it is not fixed. Kind of crucial integration for me.

Dimmeland avatar Feb 04 '23 14:02 Dimmeland

Same issue here...

JonnaI89 avatar Feb 04 '23 16:02 JonnaI89

Same issue here.

hefla avatar Feb 04 '23 17:02 hefla

Still an issue with 2023.2.2., when using default lock code.

erlendsellie avatar Feb 05 '23 07:02 erlendsellie

Same problem :(

bubbzy avatar Feb 05 '23 21:02 bubbzy

I installed 2023.2.2 and removed number of digits and default PIN in settings for the verisure integration. Then the automations containing a pin started working again!

Dimmeland avatar Feb 06 '23 21:02 Dimmeland

I installed 2023.2.2 and removed number of digits and default PIN in settings for the verisure integration. Then the automations containing a pin started working again!

Same here! Nice

JonnaI89 avatar Feb 07 '23 12:02 JonnaI89

I installed 2023.2.2 and removed number of digits and default PIN in settings for the verisure integration. Then the automations containing a pin started working again!

Can I ask how you did this, I do not understand from just the comment here. Sorry about that.

Mithrox avatar Feb 09 '23 10:02 Mithrox

I guess this is where I don't understand your change. I am doing my automation through Node Red, not the HA Automations, and since the code is defined on the Verisure integration with the right user logging in, I don't have to provide it in the automation config. Are you saying that you had additional code in your HA automation, and when you removed it, your automation worked?

You have also added the code in the Verisure integration config right? Or am I completely misunderstanding what you're showing?

Mithrox avatar Feb 09 '23 11:02 Mithrox

I guess this is where I don't understand your change. I am doing my automation through Node Red, not the HA Automations, and since the code is defined on the Verisure integration with the right user logging in, I don't have to provide it in the automation config. Are you saying that you had additional code in your HA automation, and when you removed it, your automation worked?

You have also added the code in the Verisure integration config right? Or am I completely misunderstanding what you're showing?

See the "xxxxxx" in my automation. There you add your door code. Use ha automation for it. Mutch more simple then node red for this. At the moment, verisure integration code does not work.

crackers81 avatar Feb 09 '23 12:02 crackers81

I guess this is where I don't understand your change. I am doing my automation through Node Red, not the HA Automations, and since the code is defined on the Verisure integration with the right user logging in, I don't have to provide it in the automation config. Are you saying that you had additional code in your HA automation, and when you removed it, your automation worked?

You have also added the code in the Verisure integration config right? Or am I completely misunderstanding what you're showing?

Remove the code from Verisure integration and use call service in Node red. Add the code in call service node (at the bottom it shows what the item is called in Json editor. ) Bing it works ;)

JonnaI89 avatar Feb 09 '23 12:02 JonnaI89

Thank you both, I got it now. I'll try to remove the code from the integration and then test in NR before upgrading, and as long as it works fine now I should be fine upgrading.

and @crackers81, I don't agree that HA automation is easier than NR though, once you know NR everything becomes simpler ;) But it's also like a religion or the old Apple/Android discussion, it's quite subjective.

Mithrox avatar Feb 09 '23 15:02 Mithrox

Thank you both, I got it now. I'll try to remove the code from the integration and then test in NR before upgrading, and as long as it works fine now I should be fine upgrading.

and @crackers81, I don't agree that HA automation is easier than NR though, once you know NR everything becomes simpler ;) But it's also like a religion or the old Apple/Android discussion, it's quite subjective.

Whatever floats your boat hehe. I use both. Something are easyer in nr og visa versa :) agreed ;)

crackers81 avatar Feb 09 '23 15:02 crackers81

Whatever floats your boat hehe. I use both. Something are easyer in nr og visa versa :) agreed ;)

I was extremely reluctant to do NR from the start and stuck with HA automation as only engine for the longest time, but now I am a convert ;) I still have some automations that I haven't moved to NR just because it simply doesn't make any difference, but I do all my new there. But it's great to have options, something for everyone.

Mithrox avatar Feb 09 '23 15:02 Mithrox

Remove the code from Verisure integration and use call service in Node red. Add the code in call service node (at the bottom it shows what the item is called in Json editor. ) Bing it works ;)

I have still not upgraded as I thought of one thing. In my UI I am using the lock. references directly, and there is no code in the code behind it, and no automation, just switch function lock/unlock. How would that work if I remove the code on the integration since I cannot add it on the device setup directly?

Anyone know if this will be fixed back to normal function soon?

Mithrox avatar Feb 13 '23 19:02 Mithrox

@frenck Do you have time to look at this? 💯

crackers81 avatar Feb 13 '23 19:02 crackers81

For info; the service enable_autolock is still working. I have a timebase automation that enables auto lock at 9pm so the door gets locked at night anyways. Still a problem but maybe can't help some in the waiting for a solution :)

bubbzy avatar Feb 13 '23 19:02 bubbzy

@frenck Do you have time to look at this? 💯

There is already a pull request pending that will probably fix this. It's awaiting review. When it's merged it will be included in a HA release. It's already linked in this thread, but I'll include the link below

https://github.com/home-assistant/core/pull/87544

konstantinozh avatar Feb 13 '23 20:02 konstantinozh

@frenck Do you have time to look at this? 💯

There is already a pull request pending that will probably fix this. It's awaiting review. When it's merged it will be included in a HA release. It's already linked in this thread, but I'll include the link below

#87544

The pull you are linking to is 1 week old. This is 2 weeks old. Weird with no answer here first........ Thanks

crackers81 avatar Feb 13 '23 20:02 crackers81

I read the release notes of the 2023.2.5 version now, but I do not see any mention of the Verisure fix. Can anyone confirm if it did come into this new version last night, or if it's still waiting to be implemented?

Mithrox avatar Feb 16 '23 15:02 Mithrox

The fix has not been implemented. The pull request has been changed to a draft awaiting an architecture discussion.

They will decide if they will implement the fix or revert the code change that introduced this problem in the first place.

I have no idea when the discussion is going to take place. Until then we have to make do with the workarounds or an older version sadly.

konstantinozh avatar Feb 16 '23 16:02 konstantinozh