GithubHelp home page GithubHelp logo

jonkristian / alko Goto Github PK

View Code? Open in Web Editor NEW
16.0 10.0 3.0 37 KB

AL-KO Robolinho component for Home Assistant

License: MIT License

Python 96.98% Shell 3.02%
homeassistant home-assistant home-automation al-ko robolinho lawnmower

alko's People

Contributors

jonkristian avatar monitdk avatar sopparus avatar the-smart-home-maker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alko's Issues

Implement mowing window

@udosw has already started some work around this. Adding it as a separate issue for clarity, as I'm sure this is something we would want to see added to the integration.

          I started with requesting the mowingWindows to see the structure of the json:

curl -s -X GET -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" https://api.al-ko.com/v1/iot/things/${thingname}/state/reported | jq -r .mowingWindows
This results in:

{
  "monday": {
[...]
  "sunday": {
    "window_1": {
      "activityMode": false,
      "marginMode": false,
      "startHour": 8,
      "startMinute": 0,
      "duration": 330,
      "entryPoint": 0,
      "narrowPassageMode": false
    },
    "window_2": {
      "activityMode": false,
      "marginMode": false,
      "startHour": 13,
      "startMinute": 30,
      "duration": 330,
      "entryPoint": 0,
      "narrowPassageMode": false
    }
  }
}

So the code to set a mowingWindow to active is:

curl -s -X PATCH -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" https://api.al-ko.com/v1/iot/things/${thingname}/state/desired -d '{"mowingWindows": {"sunday": {"window_2": {"activityMode": true}}}}'
You can even see the marker change from grey to red in the inTouch app realtime.

Originally posted by @udosw in #6 (comment)

Issue with configuring: timeout() got an unexpected keyword argument 'loop'

I have a problem with configuring Alko integration in Home Assistant.

I have added client_secret to configuration.yaml. When I'm adding the integration and put all the necessary keys, I get an error: Retrying setup: timeout() got an unexpected keyword argument 'loop'

Complete log:

Logger: custom_components.alko
Source: custom_components/alko/__init__.py:98
Integration: AL-KO ([documentation](https://github.com/jonkristian/alko))
First occurred: 7:37:31 PM (49 occurrences)
Last logged: 8:28:03 PM

Unexpected error fetching alko_coordinator data: timeout() got an unexpected keyword argument 'loop'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 239, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 195, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/alko/__init__.py", line 98, in async_update_data
    await alko.get_devices()
  File "/usr/local/lib/python3.10/site-packages/pyalko/__init__.py", line 39, in get_devices
    response: ClientResponse = await self._client.get(
  File "/usr/local/lib/python3.10/site-packages/pyalko/client.py", line 25, in get
    return await self.request("GET", url, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/pyalko/client.py", line 45, in request
    async with async_timeout.timeout(20, loop=get_event_loop()):
TypeError: timeout() got an unexpected keyword argument 'loop'

What may be causing that issue?

Improve the config flow

Currently we have a working integration however the config flow is not ideal. As it stands you will first have to add your application credentials (client_id / client_secret) before you go through the normal steps of adding the integration.

I have not yet figured out how to combine the built-in oauth flow with the aditional params (username / password), so if there's anyone out there that could take a look at the config_flow.py, that would be great!

Having to change control mode back and forth to get it to work (see video)

Thanks for making this integration! It is greatly appreciated.

One issue I face: When I want the mower to start, I have to set the control to "Working" and then to "Idle" and the back to "Working for it to start. And when i want it to stop, I have to set it to "Idle" and then "Working" and then "Idle" again to make it stop. As shown in this video: https://github.com/user-attachments/assets/6d2040d9-5f6d-4b28-b174-6f10f22706f7 (turn on sound)

How to fix this?

No application_credentials platform for alko

The installation process is not working.

In the "Add Application Credentials" Windows, I got the following error message:
"No application_credentials platform for alko"

Bildschirmfoto 2024-08-08 um 07 59 28

Could you please offer some help?
Thank you

Show ecoMode or rainSensor controls only for devices that support it

Not all Robolinho devices are equipped with a rain sensor or an eco mode. So the integration should leverage the information provided in the pimInfo (here it is stated whether the device provide rain sensor and eco mode or not) to selectively show these controls only of they are supported by the device.

Features: Edge cutting, resetting knife status, installing firmware updates.

First, thanks for doing the hard work and writing this integration.
I've set it up today, and so far it works like a charm.

I know this is the very early stages, but one thing that I miss, is the ability to start the mover with "edge cutting" (bad translation perhaps) . Further resetting the knife service status and installing updates would be great - then there is no more need for the Intouch app :)

Finding secret and tokens (Android only | Requires adb) - script error

Hello,

I am trying to go through the below procedure described in the documentation:

Manual or via HACS

If you're using HACS you can add this repo as a custom repository and install, otherwise download or clone and copy the folder custom_components/alko into your custom_components/. Be sure to restart.
Finding secret and tokens (Android only | Requires adb)

The AL-KO API is unfortunately not open for 3rd party applications. In order for this component to work you will have to have set up the AL-KO inTOUCH app and a working adb connection to your phone. To extract your secret and tokens I've created a very simple and crude script that will output these in the terminal.

Download [intouch-credentials.sh](https://raw.githubusercontent.com/jonkristian/alko/master/tools/intouch-credentials.sh) (located in tools folder).
Then chmod +x intouch-credentials.sh and ./intouch-credentials.sh to run.
Now unlock your phone and click confirm the backup operation (do not encrypt).
This should print your client_secret, access_token and refresh_token the latter two is required during the integration setup step.
Add the following to your configuration.yaml.

alko:
client_id: inTouchApp
client_secret: your_client_secret

After a restart you should now be able to add the integration via the integrations page, remember that tokens are short-lived 30 minutes.

Unfortunately while trying to run the script I am getting error message that such file or directory does not exist:

obraz

Could you be so kind and advise how to get secret and token to make the integration running on HA?

inTouch app dead ?

Are inTouch servers have some issues ?
Since more then one week my Robolinho is not visible in app. I made a reset inTouch from Robolinho menu , conected once again to wifi , removed from inTouch ap , and it can't connect any more.
I can see , that Robolinho is connecting to Wifi every 2 min. ( and pobably is not able to o something in server , and it do reset after 2 min). Internet is availble from this network , but not works.
I send a mail to Al-Ko support last friday , but till now they answer was a question :" From where am I ? " and no further responce....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.