Controlling a Gerber Prime 6000-series smart-home controller (relay / shutter DIN-rail box,
"Home Mate 2" app, config Wi-Fi named PSC05-<mac>) locally over HTTP, no vendor cloud.
Reverse-engineered from its web UI. Full code + docs:
https://github.com/danielrosehill/gerber-prime-6000-local-api
- Web UI / API:
admin/888888(HTTP Basic) - Config Wi-Fi (SoftAP) WPA key:
12345678, gateway10.10.10.254
/sdk.cgi— device control/status.POSTform fieldjson=encodeURIComponent(encodeURI(<json>))(double-encoded). Body:{"control":{"cmd":"...","uid":N,"chid":N,"val":N}}. Response is URI-encoded JSON;respcode:100= OK.get_all_device— list devices/channels/stateswitch— relay on/off (val255/0)
/network.cgi— Wi-Fi/network.POSTraw command string:getwifimode,getssidlist,setstassid=,setstapwd=,setwifimode=AP|STA|OFF,wificommit(reboots).
ctrltype 23 = on/off relay (basicvalue 0/255); ctrltype 26 = roller shutter.
pan27_info has curtain_sec (shutter travel time) + modbus_addr / modbus_is_slave.
- Switching to Wi-Fi STA via the API alone doesn't complete a join (security type not set). Do the STA switch from the web UI (pick the network from the scan list), then power-cycle. Then it's reboot-stable.
- Old (2018) Wi-Fi client: may fail on APs requiring 802.11w/PMF or fast-roaming — use a 2.4 GHz WPA2-PSK, PMF-off SSID.
- Recovery = power-cycle (non-destructive; falls back to config AP). Never hold Reset ~5 s — that factory-resets and wipes scenes/names/bindings.
- Modbus (RJ11 = RS485): master/slave toggle + address are in the web UI (Settings → PAN27 Information). Default master.
import base64, json, urllib.parse, urllib.request
eU=lambda s:urllib.parse.quote(s,safe="!#$&'()*+,-./:;=?@_~")
eC=lambda s:urllib.parse.quote(s,safe="!'()*-._~")
def sdk(host, cmd, **f):
ctl={"cmd":cmd}; ctl.update({k:v for k,v in f.items() if v is not None})
body="json="+eC(eU(json.dumps({"control":ctl},separators=(",",":"))))
req=urllib.request.Request(f"http://{host}/sdk.cgi", data=body.encode(),
headers={"Authorization":"Basic "+base64.b64encode(b"admin:888888").decode(),
"Content-Type":"application/x-www-form-urlencoded"})
return json.loads(urllib.parse.unquote(urllib.request.urlopen(req,timeout=10).read().decode()))
print(sdk("10.10.10.254","get_all_device")) # list channels
sdk("10.10.10.254","switch",uid=257,chid=3,val=255) # relay chid 3 ONHelp wanted: roller-shutter open/close/stop command, dimmer control, pure-API STA join. Contribute at the repo above.