-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Fix Husqvarna Automower schedule switch turning back on #117692
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
Fix Husqvarna Automower schedule switch turning back on #117692
Conversation
I would like to test it but I am not an programmer. I can only read code as an amateur. Is it possible to download the switch.py file add it somewhere to HA and then test it ? Or do you really need programmers to check your code? |
You can download all the files from here and copy them in the custom components folder: Description how it works exactly: https://developers.home-assistant.io/docs/development_tips?_highlight=production#test-core-integration-changes-in-your-production-home-assistant-environment |
Thanks! I deleted that folder recently from my system since I still used the HACS component but updated to the CORE version. I will put it back and test in and report back (415x here) |
I installed it in the custom_components folder and added a version in de manifest.json. rebooted HA and now I have 23 integrations in stead of 21. However when i switch off the schedule while docked it turns on in 2 secs. Maybe I overlooked something? How can I show the logs? 2024-05-23 23:06:33.311 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration husqvarna_automower which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-05-23 23:11:54.503 DEBUG (MainThread) [aioautomower.auth] request[post]=https://api.amc.husqvarna.dev/v1/mowers/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/actions None |
What's happening next in the logs? So far it looks good. |
2024-05-26 00:08:01.277 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration husqvarna_automower which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant Hope this helps..... I dont know where I should be looking fot in de debug code. How long do I let the debugging run ? |
That looks different, than my mower: |
It's actually easier than expected. @tuupos: Can you test again, with this files: https://github.com/home-assistant/core/tree/ae3106f4fbb1b5881437b44ad4755faab964b84e/homeassistant/components/husqvarna_automower ? |
I will try it but unfortunately i am not able to test it before Sunday. In will keep you informed. |
@tuupos Were you able to test it? |
Had no time, downloading now the testfiles. |
following log results. As I look at the schedule switch: it works in HA. The switch stays off when I disable it and stays turned on when I enable it. (SyncWorker_0) [homeassistant.loader] We found a custom integration husqvarna_automower which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-06-12 06:49:51.297 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [1400XXXXXXXXXX] Unexpected exception The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): |
@tuupos: That's good. |
Can I do anything futher to get the update into HA core? ( I see merging is blocked ?) |
No, we have to wait for a review. |
Can you update the description? The helper doesn’t seem to be used anymore, as the code was simplified a lot (looking at the previous commits). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good.
I‘ve updated your PR description a bit to make it more accurate, since the fix changed at some point.
Breaking change
Proposed change
Until now two attributes were used to detect the mower's schedule state:
attributes.mower.state == mowerStates.RESTRICTED
andattributes.planner.restricted_reason == RestrictedReasons.NOT_APPLICABLE
This was working for some models. According to the API documentation
self.mower_attributes.mower.mode != MowerModes.HOME
is the right attribute to check.If the mower is on the way home, or is already in the dock, this check will return
False
, so the schedule switch is off.Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: