Skip to content

Commit

Permalink
Merge pull request #17 from andrexp/update_fix
Browse files Browse the repository at this point in the history
Update fix and add some error codes
  • Loading branch information
FredBit90 authored Aug 4, 2023
2 parents 842feaa + c9587e2 commit 75426af
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
MQTT_PUBLISH_RETAIN = False # Publish Command as retain
GARDENA_NNG_FORWARD_PATH_EVT = "ipc:///tmp/lemonbeatd-event.ipc" # nngforward path from Gardena Smart Gateway to receive events
GARDENA_NNG_FORWARD_PATH_CMD = "ipc:///tmp/lemonbeatd-command.ipc" # nngforward path from Gardena Smart Gateway to publish commands
SCRIPT_VERSION = '1.1.0.2' # Version of GardenaLocalControl script
SCRIPT_VERSION = '1.1.1.0' # Version of GardenaLocalControl script
10 changes: 8 additions & 2 deletions docs/control_telegram
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Deactivate hibernation, same as start with schedule
<data>B20701010000</data>

Status-Codes
* values with question mark (?) must are suggested and need to be confirmed *

0 = None
1 = Mow
Expand All @@ -111,11 +112,16 @@ Status-Codes
15 = Mow manually (with time)
16 = Parked, SensorControl


Error-Codes
* values with question mark (?) must are suggested and need to be confirmed *

1 = Outside working area
2 = No loop signal
10 = Upside down
15 = Lifted
16 = Stuck in charging station
17 = Charging station blocked
19 = Problem shock sensor front
71 = Alert! Mower lifted
? 18 = collision sensor problem rear
19 = collision sensor problem front
71 = Alert! Mower lifted
13 changes: 10 additions & 3 deletions gardenalocalcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,16 @@ def gardenaEventInterpreter(event_str):

# fill into object to publish via MQTT, sometimes payload has more than one dataset
for data in payload.keys():
for key in payload[data].keys():
if key == "vi" or key == "vo":
publishEventDataQueue.put(EventData(deviceId,data,payload[data][key]))
# with gateway software version 7.8.1 payloads comes with additional "_urn" key which value is only a string value instead of key-value-pair(s) again
# this leads into wrong data parsing - for fixing all key-value-pairs which are different will be ignored
try:
# if there is data to read - get value(s)
for key in payload[data].keys():
if key == "vi" or key == "vo":
publishEventDataQueue.put(EventData(deviceId,data,payload[data][key]))
except:
# there is no usable data for us - ignore
pass

except Exception as e:
logging.debug("ERR Parsing JSON-Data: {}".format(e))
Expand Down

0 comments on commit 75426af

Please sign in to comment.