ChrisHaPunkt / stihl-imow-webapi

Unofficial Python Wrapper to the STIHL iMow Lawn Mowers. Created for being used with https://github.com/ChrisHaPunkt/ha-stihl-imow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mower states

StefanCohen opened this issue · comments

I've been observing my 522c thru the API for a few days and I think the extraStatus and lastNoErrorMainState values are significant to decode the state of the mower during exceptions but I haven't been able to figure how yet. A few examples:

Stop button pressed:
'mainState': 1,
'extraStatus': 144,
'extraStatus1': 0,
'extraStatus2': 0,
'extraStatus3': 0,
'extraStatus4': 0,
'extraStatus5': 65536
'lastNoErrorMainState': 6,

Mower Stuck:
mainState': 1,
"extraStatus": 80,
"extraStatus1": 0,
"extraStatus2": 0,
"extraStatus3": 65536,
"extraStatus4": 0,
"extraStatus5": 0,
"lastNoErrorMainState": 11

Hood blocked:
'mainState': 1,
'extraStatus': 78,
'extraStatus1': 0,
'extraStatus2': 0,
'extraStatus3': 16384,
'extraStatus4': 0,
'extraStatus5': 0,
'lastNoErrorMainState': 5

Also, the plaintext error codes doesn't seem to be accessible yet via the API yet. In the Web interface, they are available when pressing the "More Information" button on the mower tab. The Mower Stuck example above is registered as an "M4027" error message. It would be very handy to have both the error code and textual error message as variables on the mower object as that would remove the need to decode the extrastatus fields.

I can confirm the "Mower Stuck"
'status': {'bladeService': False,
'chargeLevel': 0,
'extraStatus': 80,
'extraStatus1': 0,
'extraStatus2': 0,
'extraStatus3': 65536,
'extraStatus4': 0,
'extraStatus5': 0,
'lastGeoPositionDate': '2021-06-06T15:03:43+00:00',
'lastNoErrorMainState': 5,
'lastSeenDate': '2021-06-06T14:45:54+00:00',
'mainState': 1,
'online': True,
'rainStatus': False},
image

I just found a way to receive the human readble information from upstream. I'm going to extend the MowerTask class to provide all the information

Closed with PR #11
See Changelog for version 0.5.0 for new representation of the state.