jonkristian / alko Goto Github PK
View Code? Open in Web Editor NEWAL-KO Robolinho component for Home Assistant
License: MIT License
AL-KO Robolinho component for Home Assistant
License: MIT License
@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)
I have contacted Al-ko today to inquire about opening up their API, and it is now possible to access it via this link: https://alko-garden.dk/api-adgang/
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?
my device is unavaible and fail
it says
try again:400 message='bad request' url='https://idp.al-ko.com/connect/token'
home-assistant_alko_2024-08-12T13-09-58.751Z.log
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!
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?
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.
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 :)
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:
Could you be so kind and advise how to get secret and token to make the integration running on HA?
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....
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.