-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
[BUG] Power state not updated at wake up #370
Comments
Hey thanks for trying out Go Hass Agent and reporting this bug! Also thanks for the detailed walkthrough, I can clearly see the problem. For all sensor updates, I don't do any retries if an update fails to get sent to Home Assistant. In nearly all cases, this is fine, as you'll get new data on the next poll. However, in this case, you definitely do want to send the existing update otherwise the power state is wrong as you've discovered. I'll have to have a think about how I can implement this. I'll leave this bug open as a tracker and I'll update when I've got a fix. Cheers. |
Hey there, I've spent some time looking at this over my weekend and I believe b103679 should fix this issue. At least in my testing, after suspend my power state sensor is updating correctly. This will go into the next release 🎉 |
Hi, Another way could be to wait for an active connection before sending requests, but I don't know if there is a reliable way to detect it. |
All good today, multiple wake up and sensor was updated as expected. |
Go Hass Agent Version
Go Hass Agent: v10.5.1
Describe the bug
Power state is not update in Home Assistant at wake up from Suspsended mode.
go-hass-agent try to update sensor.state but network is not yet ready after wake up so there is an error. Even after network ready go-hass-agent do not try again to update sensor state in error.
Result is Home Assistant does not receive update about sensor state that change only once just after wake up and before network is up.
In log file attached :
I automate an action at PC wake up on Home Assistant. Because of this issue it does work.
Issue seems appear if PC is une suspended mode for a long time. If I wake up my PC 2 minutes after suspended mode power state is updated.
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
Power state update after PC wake up. 2 options maybe, wait for network before sending any sensor.state update, or retry previous sensor.state update that failed. Especially sensor.state that change little like Power State.
Screenshots
N/A
Logs
A log will be very helpful to look into this bug report. To get the log:
go-hass-log.txt
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: