chrisz / pyhusmow

Control your Husqvarna automower
GNU General Public License v3.0
59 stars 29 forks source link

Park #24

Open tnemrap opened 6 years ago

tnemrap commented 6 years ago

Is it possible to get options to Park as Park Timer and Park UFN (until further notice).

/Mike

simlu commented 6 years ago

Yeah, pretty sure it's PARKED_PARKED_SELECTED vs PARKED_TIMER

tnemrap commented 6 years ago

Does that mean that I can already use control PARKED_TIMER?

simlu commented 6 years ago

@tnemrap I'm very familiar with the Husqvarna api, but not so much with this particular code base. So I'm not sure what is currently possible.

Maybe someone else can jump in and answer. Thanks!

Hoytron commented 6 years ago

I've just tested it. But doesn't work. PARKED_PARKED_SELECTED and PARKED_TIMER are the status response put no control command.

Does anyone have the different controll commands? Or is there any key to send within the json object? Something like:

json={ "action" = PARK; "mode" = AUTO; }

drost commented 6 years ago

@simlu Now I'm curious. Are there other code bases for the Husqvarna API? This project is unfortunately the only source of information that I found about the API.

Hoytron commented 6 years ago

I can't find any other commands. But the new iOS app version is able to 'start mowing for 3h/6h/9h' or to 'start mowing the main area'. (only have the german app version) Last one means, the automower is set to AUTO mode and starts mowing ,if current time is within the timer borders, or at the next timer beginning time.

simlu commented 6 years ago

@Hoytron Should be able to inspect network traffic. On jail broken Android this is fairly easy, but I don't know if the new app version is up. I would expect it can be done on iOS as well.

@drost There is, but it's closed source for now. I've been working on a website to display heatmap and mower status over time. I might make it OS at some point, not sure where it's gonna go (too many projects on the go atm).

maglub commented 6 years ago

@simlu Is there any good source for the API other than scanning the network?

simlu commented 6 years ago

@maglub This repo or you could decompile the android apk. Decompiling is definitely viable, but I don't know code quality or if they use obfuscation - both would make the resulting code harder to read. Might also be against TOS - but so might be using the api directly.

tnemrap commented 6 years ago

Find with charles that PARK_TIMER is url /control/park/duration/timer no data START_OVERRIDE 3h is /control/start/override/period data is { "period": 180 }

nicoduj commented 5 years ago

Hi all, I am currently making an homebridge plugin for automower, based on this one : https://github.com/dinmammas/homebridge-robonect/blob/master/index.js.

I am searching however how to handle the PARK_TIMER command at least.

if anyone has any clue ;) (can't use charles anymore since the app detects the SSL proxy :( )

nicoduj commented 5 years ago

https://www.npmjs.com/package/homebridge-automower here it is :)

full list of command I found : //trackApiUrl = 'https://amc-api.dss.husqvarnagroup.net/app/v1/'; //me.trackApiUrl + 'mowers/' + me.mowerID + '/control/start/'; //me.trackApiUrl + 'mowers/' + me.mowerID + '/control/start/'; //me.trackApiUrl + 'mowers/' + me.mowerID + '/control/start/override/period'; + JSON String "duration" in body //me.trackApiUrl + 'mowers/' + me.mowerID + '/control/pause'; //me.trackApiUrl + 'mowers/' + me.mowerID + '/control/park/duration/timer'; //me.trackApiUrl + 'mowers/' + me.mowerID + '/control/park/duration/period'; + JSON String "duration" in body