Skip to content

Commit

Permalink
Merge pull request #14 from andrexp/feature_add
Browse files Browse the repository at this point in the history
added raw command and documentation
  • Loading branch information
FredBit90 authored May 6, 2023
2 parents 898dfa2 + fcea79a commit d6dbb81
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 29 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,28 @@ Example:
"payload": true
}

#### raw
With this command all left variations of commands can be sent. Especially new or not fully observed commands can be tested. More complex commands like settings or time schedules can also be used. See [docs/control_telegram](docs/control_telegram) for more information and reversed engineered commands. Note: All bytecodes has to be decoded with Base64 first.

The payload of the command accepts following values:

| Command | Possible values |
|-------------------|--------------------------------------------------------------------------------------------------------------------|
| operation | read, write |
| gardenaCommand | all reverse engineered commands or observed topics such as "schedule_config" |
| varType | vi, vo (this seem to be a declaration of a variable Type "i" may stand for integer value, "o" for string value) |
| gardenaPayload | payload to send coded in Base64 |

Example (sends a schedule configuration for ONE schedule from 8:00am to 8:05am Monday-Sunday):

GardenaLocalControl/012345678901234567890/Command
{
"command": "raw",
"payload": "write,schedule_config,vo,AH8IAAUAAA=="
}



## FAQ

### How do I root my Gardena Smart Gateway and prepare it for using the script
Expand Down
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.0.1.4' # Version of GardenaLocalControl script
SCRIPT_VERSION = '1.1.0.0' # Version of GardenaLocalControl script
87 changes: 59 additions & 28 deletions docs/control_telegram
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
Generic Settings
gardenaCommand "settings_control"

1 |2 |3 |4 |5 |6 |7 |8 |9 |10|11|12|13|14|15|16
FF|FF|FF|FF|FF|FF|FF|FF|00|3C|1D|00|00|07|01|00
1 |2 |3 |4 |5 |6 |7 |8 |9 |10|11|12|13|14|15|16|17|18
00|00|00|00|00|00|00|00|00|00|3C|1D|00|00|07|01|00|00

BYTE Meaning
1 Bitmask for changing bytes (Byte 9)
2 Bitmask for changing bytes (Byte 10)
3 Bitmask for changing bytes (Byte 11)
4 Bitmask for changing bytes (Byte 12)
5 Bitmask for changing bytes (Byte 13)
6 Bitmask for changing bytes (Byte 14)
7 Bitmask for changing bytes (Byte 15)
8 Bitmask for changing bytes (Byte 16)
9 Distance to charging station pre-decimal (0)
10 Distance to charging station decimal (,60 m)
11 Drive past wire in cm (29 cm)
12
13 Garage ON-OFF
14
15 Eco Mode ON-OFF
16
1 Bitmask for changing bytes (Byte 10)
2 Bitmask for changing bytes (Byte 11)
3 Bitmask for changing bytes (Byte 12)
4 Bitmask for changing bytes (Byte 13)
5 Bitmask for changing bytes (Byte 14)
6 Bitmask for changing bytes (Byte 15)
7 Bitmask for changing bytes (Byte 16)
8 Bitmask for changing bytes (Byte 17)
9 Bitmask for changing bytes (Byte 18)
10 Distance to charging station pre-decimal (0)
11 Distance to charging station decimal (,60 m)
12 Drive past wire in cm (29 cm)
13 SensorControl (00 = OFF, 02 = LOW, 03 = MID, 04 = HIGH)
14 Garage ON-OFF
15
16 Eco Mode ON-OFF
17 FrostSensor ON-OFF
18

Garden zone-settings
gardenaCommand "starting_points"

1 |2 |3 |4 |5 |6 |7 |8 |9 |10|11|12|13|14|15|16|17|18
02|0E|00|5A|00|00|02|1E|00|19|01|01|02|3C|00|28|00|01

Expand Down Expand Up @@ -55,7 +60,41 @@ Zone 3
15
16 see above
17 see above
18 see above
18 see abov

Schedule_Config
gardenaCommand "schedule_config"

1 |2 |3 |4 |5 |6 |7
00|06|08|00|76|02|00

BYTE Meaning
----------------------------------
1 Current number of schedule
2 Days of week where schedule is valid
Bit Meaning
--------------------------
1 Sunday
2 Monday
3 Tuesday
4 Wednesday
5 Thursday
6 Friday
7 Saturday
Example: Schedule shoud be valid on Monday, Tuesday and Friday. Resulting byte will be 26
3 Starting time (hours)
4 Starting time (minutes)
5 Mow duration in minutes low byte
6 Mow duration in minutes high byte
7 ???

If more than one schedule is available the schedules simply seem to be appended each.

Activate hibernation
<data>F60701120000</data>

Deactivate hibernation, same as start with schedule
<data>B20701010000</data>

Status-Codes

Expand All @@ -77,12 +116,4 @@ Error-Codes
10 = Upside down
15 = Lifted
16 = Stuck in charging station
17 = Charging station blocked


Activate hibernation
<data>F60701120000</data>

Deactivate hibernation, same as start with schedule
<data>B20701010000</data>

17 = Charging station blocked
10 changes: 10 additions & 0 deletions gardenalocalcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import paho.mqtt.client as mqtt
import logging
import json
import base64
from threading import Thread
from queue import Queue
from random import Random
Expand Down Expand Up @@ -109,6 +110,15 @@ def gardenaCommandBuilder(command):
operation = "read"
gardenaCommand = "status"
varType = "vi"
elif command.command == "raw":
raw_cmd_props = command.payload.split(',')
operation = raw_cmd_props[0]
gardenaCommand = raw_cmd_props[1]
varType = raw_cmd_props[2]
gardenaPayload = raw_cmd_props[3]
# the varType "vo" has to be transmitted as string, therefore adding quotes
if varType == "vo":
gardenaPayload = "\"" + gardenaPayload + "\""
else:
# further commands have to be first observed, all commands which are not in list above will be ignored
return False
Expand Down

0 comments on commit d6dbb81

Please sign in to comment.