Growcube commands
GrowcubeCommand inherited classes are used to send commands to the Growcube.
- class growcube_client.growcubecommand.ClosePumpCommand(channel: Channel)
Bases:
GrowcubeCommandCommand 46 - Close pump command This deletes any pump related settings for the given channel
- class growcube_client.growcubecommand.GrowcubeCommand(command: str, message: str | None)
Bases:
objectGrowcube command base class
- Variables:
Command (dict) – Dictionary mapping command codes to command names.
CHD_HEAD (str) – Command header for CHD messages.
CMD_SET_WORK_MODE (str) – Command code for SetWorkModeCmd.
CMD_SYNC_TIME (str) – Command code for SyncTimeCmd.
CMD_PLANT_END (str) – Command code for PlantEndCmd.
CMD_CLOSE_PUMP (str) – Command code for ClosePumpCmd.
CMD_REQ_WATER (str) – Command code for ReqWaterCmd.
CMD_REQ_CURVE_DATA (str) – Command code for ReqCurveDataCmd.
CMD_WATER_MODE (str) – Command code for WaterModeCmd.
CMD_WIFI_SETTINGS (str) – Command code for WifiSettingsCmd.
MSG_SYNC_WATER_LEVEL (str) – Command code for SyncWaterLevelCmd.
MSG_SYNC_WATER_TIME (str) – Command code for SyncWaterTimeCmd.
MSG_DEVICE_UPGRADE (str) – Command code for DeviceUpgradeCmd.
MSG_FACTORY_RESET (str) – Command code for FactoryResetCmd.
command – The command code.
message – The message to send.
- Parameters:
command (str) – A string from the Command dictionary keys.
message (str) – The message to send.
- CHD_HEAD = 'elea'
- CMD_CLOSE_PUMP = '46'
- CMD_PLANT_END = '45'
- CMD_REQ_CURVE_DATA = '48'
- CMD_REQ_WATER = '47'
- CMD_SET_WORK_MODE = '43'
- CMD_SYNC_TIME = '44'
- CMD_WATER_MODE = '49'
- CMD_WIFI_SETTINGS = '50'
- Command = {'43': 'SetWorkModeCmd', '44': 'SyncTimeCmd', '45': 'PlantEndCmd', '46': 'ClosePumpCmd', '47': 'ReqWaterCmd', '48': 'ReqCurveDataCmd', '49': 'WaterModeCmd', '50': 'WifiSettingsCmd', 'ele502': 'SyncWaterLevelCmd', 'ele503': 'SyncWaterTimeCmd', 'ele504': 'DeviceUpgradeCmd', 'ele505': 'FactoryResetCmd'}
- MSG_DEVICE_UPGRADE = 'ele504'
- MSG_FACTORY_RESET = 'ele505'
- MSG_SYNC_WATER_LEVEL = 'ele502'
- MSG_SYNC_WATER_TIME = 'ele503'
- get_description() str
Get a human-readable description of the command.
- Returns:
A human-readable description of the command.
- Return type:
str
- get_message() str
Get the complete message for sending to the Growcube device.
- Returns:
The complete message.
- Return type:
str
- class growcube_client.growcubecommand.PlantEndCommand(channel: Channel)
Bases:
GrowcubeCommandCommand 45 - Plant end command This deletes any existing curve data for the given channel
- class growcube_client.growcubecommand.RequestCurveDataCommand(channel: Channel)
Bases:
GrowcubeCommandCommand 48 - Request curve data command This requests the moisture data for the given channel, used in the app to construct a graph
- class growcube_client.growcubecommand.SetWorkModeCommand(mode: WorkMode)
Bases:
GrowcubeCommandCommand 43 - Set work mode command
This command is used to set the work mode, and it is often sent as the first package from the phone app.
- get_description() str
Get a human-readable description of the command
- Returns:
A human-readable description of the command
- Return type:
str
- class growcube_client.growcubecommand.SyncDeviceUpgradeCommand
Bases:
GrowcubeCommandCommand 504 - Device upgrade Issues a device upgrade request
- class growcube_client.growcubecommand.SyncTimeCommand(timestamp: <module 'datetime' from '/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/datetime.py'>)
Bases:
GrowcubeCommandCommand 44 - Sync time command
This command is used to set the device time.
- class growcube_client.growcubecommand.SyncWFactoryResetCommand
Bases:
GrowcubeCommandCommand 505 - Factory reset Issues a factory reset request
- class growcube_client.growcubecommand.SyncWaterLevelCommand
Bases:
GrowcubeCommandCommand 502 - Sync water level
This command is likely used to synchronize the water level information with the device. It may be used to update the device’s internal water level tracking or to request the current water level status.
- class growcube_client.growcubecommand.SyncWaterTimeCommand
Bases:
GrowcubeCommandCommand 503 - Sync water time
This command is likely used to synchronize watering schedule times with the device. It may be used to update the device’s internal watering schedule or to request the current watering schedule information.
- class growcube_client.growcubecommand.WaterCommand(channel: Channel, state: bool)
Bases:
GrowcubeCommandCommand 47 - Water command This starts or stops watering on the given channel
- get_description() str
Get a human-readable description of the command
- Returns:
A human-readable description of the command
- Return type:
str
- class growcube_client.growcubecommand.WateringModeCommand(channel: Channel, watering_mode: WateringMode, value1: int, value2: int)
Bases:
GrowcubeCommandCommand 49 - Water mode command This sets the watering mode for the given channel
- class growcube_client.growcubecommand.WiFiSettingsCommand(ssid: str, password: str)
Bases:
GrowcubeCommandCommand 50 - WiFi settings command Set up the WiFi settings for the Growcube
- get_description() str
Get a human-readable description of the command
- Returns:
A human-readable description of the command
- Return type:
str
- get_message() str
Get the complete message for sending to the Growcube device.
- Returns:
The complete message.
- Return type:
str