Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save danielrosehill/fc9283a68b2add812b6f4d66e24bea9c to your computer and use it in GitHub Desktop.

Select an option

Save danielrosehill/fc9283a68b2add812b6f4d66e24bea9c to your computer and use it in GitHub Desktop.
Gerber Prime 6000 / PSC05 smart-home controller — local HTTP control cheat sheet (no cloud): /sdk.cgi + /network.cgi API, gotchas, minimal Python

Gerber Prime 6000 / PSC05 — local control cheat sheet (no cloud)

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

Defaults (vendor, from FCC manual)

  • Web UI / API: admin / 888888 (HTTP Basic)
  • Config Wi-Fi (SoftAP) WPA key: 12345678, gateway 10.10.10.254

Two endpoints

  • /sdk.cgi — device control/status. POST form field json = 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/state
    • switch — relay on/off (val 255/0)
  • /network.cgi — Wi-Fi/network. POST raw command string: getwifimode, getssidlist, setstassid=, setstapwd=, setwifimode=AP|STA|OFF, wificommit (reboots).

Data model

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.

Gotchas that cost hours

  • 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.

Minimal Python (stdlib only)

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 ON

Help wanted: roller-shutter open/close/stop command, dimmer control, pure-API STA join. Contribute at the repo above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment