@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:
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.
@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.
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: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 https://github.com/jonkristian/alko/issues/6#issuecomment-2209501253