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

No status update after upgrading to 0.34 #41

Closed
sogjohan opened this issue Dec 15, 2021 · 13 comments
Closed

No status update after upgrading to 0.34 #41

sogjohan opened this issue Dec 15, 2021 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@sogjohan
Copy link

After upgrading to 0.34 status update/feedback in HA stops working.
I can activate the alarm and lock the door from HA but I get no feedback/status update. The alarm looks like it's off and the door is marked as unlocked even though it's locked.
After downgrading to 0.33 everything works fine again.
I've upgraded to HA 2021.12 but no change in behaviour.

@gjohansson-ST gjohansson-ST self-assigned this Dec 19, 2021
@gjohansson-ST gjohansson-ST added the bug Something isn't working label Dec 19, 2021
@gjohansson-ST
Copy link
Owner

This should be sorted in the latest beta just released. Give it a try and report back.

@sogjohan
Copy link
Author

I just upgraded to 0.34 beta 11. Alarm status update seems to be working but the yale lock integration is still acting weird.
Locking works but the icon/status in HA doesn't change and unlocking has no effect on the lock.

@gjohansson-ST
Copy link
Owner

You didn't get a timeout in the logs and it works a bit later?

@sogjohan
Copy link
Author

I've done some further testing and noticed the following:
In my HA I have a button for locking/unlocking which has been using the "toggle" function.
When using that button now, only locking works. Nothing happens when I try to unlock.
If I change the function for the button to "Default action" the entity window opens and I have a "unlock" and "lock" button.
If I use those both locking and unlocking works.
The status icon for the lock never updates though. It remains as unlocked no matter what state the lock is in physically.

I don't see any timeouts in the logs. this is the only message regarding Sector:
2021-12-20 11:20:19 ERROR (MainThread) [homeassistant.components.switch] Error while setting up sector platform for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/sector/switch.py", line 36, in async_setup_entry
for switch in switches:
TypeError: 'NoneType' object is not iterable

@gjohansson-ST
Copy link
Owner

Found it. Will release new beta shortly

@sogjohan
Copy link
Author

I just upgraded to 0.34 beta 12 and now everything seems to work as intended. Thanks for the fix :)
(I don't know if it's "by design" but I think that it's noticeably slower than on 0.33.)

@gjohansson-ST
Copy link
Owner

Unless you changed it yourself the refresh time is 60 seconds (Sector is not happy with a lower value).
Can you elaborate what you mean with slower?

@sogjohan
Copy link
Author

I've always had the refresh time set to 60 seconds so no change there.
I find it slower for HA to update the status for the alarm and lock than on 0.33.
I can hear the lock activating physically but it takes longer time for HA to display the change.

@gjohansson-ST
Copy link
Owner

I was previously writing the state with the action so then it would go much faster but HA would not know if the lock was actually locked or not. So since then I changed it so it now waits for the api to return the information.
I was thinking to put in the write-state function again but then one can think the lock is locked but actually it isn't because a malfunction or something.
What you think is the better approach?

@gjohansson-ST
Copy link
Owner

I did anyway now change so it should change the state immediately.
I also changed the general updating so I would be happy if you can trigger a state change outside of HA just to see the updating of state happens as it should (open the doorlock or something manually).
Thanks

@sogjohan
Copy link
Author

updated to beta 13
The status updates faster now but if the slow way is more "correct" I have no problems learning to live with that ;)
I get this error in log when locking/unlocking (but it still works):
2021-12-20 20:00:11 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140636250184432] object NoneType can't be used in 'await' expression
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
await handler.job.target(service_call)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 209, in handle_service
await self.hass.helpers.service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 663, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 896, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 700, in _handle_entity_call
await result
File "/config/custom_components/sector/lock.py", line 123, in async_lock
await self.async_write_ha_state()
TypeError: object NoneType can't be used in 'await' expression

I also tried opening the lock manually but it had no effect in HA. It still says "locked"

@gjohansson-ST
Copy link
Owner

I think that's all sorted now. --> New beta
So the lock should react immediately on your locking/unlocking and likewise if you do a manual test you should see the state changes as the api is polled.
Thanks for testing

@gjohansson-ST
Copy link
Owner

Solved in latest release v0.3.4

Repository owner locked as resolved and limited conversation to collaborators Jan 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants