-
Notifications
You must be signed in to change notification settings - Fork 2
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
Full set of mower commands #10
Comments
I just fount that in the HA dev docs chapter 3.18 vacuum class StateVacuumEntity the methods |
Maybe introduce a switch for the mower called "follow schedule". The mapping of state will get a bit complicated though. For example I don't know if START_SECONDS_TO_OVERRIDE will return to schedule after the override seconds expire. |
Hi @wijnandtop, such a switch would be great, but I think it is extremely difficult and error prone to implement. The main reason is that the schedule on/off state of the mower depends on several factors and there seems to be no mower command that can only change that state without any side effects. Also the commands are not context free. For example: I am very much afraid we would invite evil with the trial to implement such a convenience function. So my recommendation is to limit us to safely exposing the 4 existing commands if possible, or go with 3 commands if not. In fact your integration using the reverse engineer API also had only three commands exposed (through What we should in fact do, is clearly document, which HA vacuum service calls which mower API command. So people will understand the difference between e.g. .start and .turn_on. I volunteer to write that documentation. |
That sounds like a good idea! I agree with you about how this should work. I looked at the HA dev documentation you linked to and looked in the code for StateVacuumEntity in HA, and I found where it's says "Not supported" for I haven't quite understood how a StateVacuumEntity is supposed to be controlled if it's not through the turn_on/turn_off methods (that you say didn't get through in your attempt). The dev documentation on the web (https://developers.home-assistant.io/docs/core/entity/vacuum) also doesn't say anything about the difference between I found one difference though, the Without knowing that you have already tested, I would try this:
|
The changes that I proposed for a 3 command system are already running nicely in my local HA installation and with my mower. They are very similar to your code above. I have also already tried to add the **kwargs param to I am currently about to prepare a PR that will
Will need until tomorrow to get the PR up to your repo. |
This PR implements the 3 command version, but the |
TODO: |
Documentation for current 3 command version added in PR #19. |
Please continue in the new repository: py-smart-gardena/hass-gardena-smart-system#2 |
Oskar, first and foremost a big THANK YOU for your work!
Over the last days I have tested your component with my Gardena mower (which is my only Gardena Smart component). With my limited knowledge of Python and of the deeper mechanics of HA I have compiled the following details, which are hopefully correct:
The Husqvarna/Gardena API provides 4 mower commands:
START_SECONDS_TO_OVERRIDE
- Manual operation, use 'seconds' attribute to define duration.START_DONT_OVERRIDE
- Automatic operation.PARK_UNTIL_NEXT_TASK
- Cancel the current operation and return to charging station.PARK_UNTIL_FURTHER_NOTICE
- Cancel the current operation, return to charging station, ignore schedule.These 4 are all implemented as methods in your py-smart-gardena2 lib.
But only 2 of them are exposed as HA services by your custom component:
START_SECONDS_TO_OVERRIDE
through services:
vacuum.turn_on
, andvacuum.start
PARK_UNTIL_NEXT_TASK
through services:
vacuum.turn_off
,vacuum.return_to_base
, andvacuum.stop
My request is to expose all 4 commands.
The rationale is simply that they are needed. There is currently no service to stop the mower permanently (deactivate the schedule) and also no service that would activate the schedule without immediately starting the mower.
IMHO the best mapping would be this:
START_SECONDS_TO_OVERRIDE
=vacuum.start
START_DONT_OVERRIDE
=vacuum.turn_on
PARK_UNTIL_NEXT_TASK
=vacuum.return_to_base
PARK_UNTIL_FURTHER_NOTICE
=vacuum.stop
andvacuum.turn_off
I tried implementing this myself to create a PR. But unfortunately I found that the turn_off and turn_on service calls never get through to the corresponding methods in vacuum.py of your component. I am far from capable of finding the reasons for that. Without the turn_on/off calls we would have only 3 services left to map 4 mower commands.
If in the end we would have to live with only 3 services, I would recommend the following mapping - which would provide the most important functions for automations:
START_SECONDS_TO_OVERRIDE
=vacuum.start
PARK_UNTIL_NEXT_TASK
=vacuum.return_to_base
PARK_UNTIL_FURTHER_NOTICE
=vacuum.stop
But it would be much more desirable to have all commands exposed.
Please drop a comment if I can help in any way.
The text was updated successfully, but these errors were encountered: