osks / hass-gardena-smart-system

Moved to https://github.com/py-smart-gardena/hass-gardena-smart-system
Apache License 2.0
4 stars 2 forks source link

Missing Error status for Gardena Mower #12

Closed northpower25 closed 4 years ago

northpower25 commented 4 years ago

At first a great integration for the husquana/gardena smart system. Thanks for this! In addition to the great Integration it would be greate if errorcodes (like broken cables etc.) from the mower are shown as seperate sensor or as attribut of the Sileno device.

Jpsy commented 4 years ago

This can be done by exposing the LAST_ERROR_CODE of the mower API. I have implemented this already in my local system:

image

@osks would you like a PR or is there another solution that you prefer?

osks commented 4 years ago

A PR would be great!

osks commented 4 years ago

Either use ATTR_LAST_ERROR (which is used in switch.py) or replace both with a new ATTR_LAST_ERROR_CODE. I think I would prefer the later, because in the Gardena API it's called lastErrorCode.

Would it not be nice to also have the date and time for when the last error occured? This would perhaps best be implemented with support in py-smart-gardena though, but could alternatively be set when HA handles the update that gets the error.

Jpsy commented 4 years ago

https://github.com/osks/hass-gardena-smart-system/pull/14

This PR adds the mower error code as an attribute to the mower entity as shown above. It is based on the API property ATTR_LAST_ERROR_CODE.

The PR does not change switch.py and does not add any timestamp for the last error. (I am not yet capable of changing external libs like py-smart-gardena. Bear with me. :)