manzanotti/geniushub-client

Can't set override mode (temp, duration) for zones

Closed this issue · 16 comments

This is the initial state of the On/Off zone, Override/On:

(venv) dbonnes@vm-builder:~$ python ghclient.py ${HUB_ADDRESS} -u ${USERNAME} -p ${PASSWORD} -z17 -vv
{"id": 17, "name": "Test On / Off", "type": "on / off", "mode": "override", "setpoint": true, "override": {"duration": 549, "setpoint": true}, "_state": {"bIsActive": true, "bOutRequestHeat": true}}

... then we instruct the zone to Override/Off (0 is off) for 10 minutes:

(venv) dbonnes@vm-builder:~$ python ghclient.py ${HUB_ADDRESS} -u ${USERNAME} -p ${PASSWORD} -z17 -t0 -s600

However, it didn't take effect (setpoint is still true):

(venv) dbonnes@vm-builder:~$ python ghclient.py ${HUB_ADDRESS} -u ${USERNAME} -p ${PASSWORD} -z17 -vv
{"id": 17, "name": "Test On / Off", "type": "on / off", "mode": "override", "setpoint": true, "override": {"duration": 529, "setpoint": true}, "_state": {"bIsActive": true, "bOutRequestHeat": true}}

... let's try it again, but via curl:

(venv) dbonnes@vm-builder:~$ curl --user ${USERNAME}:${HASH} -X PATCH  http://${HUB_ADDRESS}:1223/v3/zone/17 -d '{"iMode": 16, "fBoostSP": 0, "iBoostTimeRemaining": 600}' > /dev/null

That did work (setpoint is true, and duration has increased):

(venv) dbonnes@vm-builder:~$ python ghclient.py ${HUB_ADDRESS} -u ${USERNAME} -p ${PASSWORD} -z17 -vv
{"id": 17, "name": "Test On / Off", "type": "on / off", "mode": "override", "setpoint": false, "override": {"duration": 589, "setpoint": false}, "_state": {"bIsActive": true, "bOutRequestHeat": false}}

I don't know if other zone types/mode are affected.

OK, the cause is (note '1' & '600' rather than 1 & 600 in the last line):

(venv) dbonnes@vm-builder:~/clients/geniushub$ python ghclient.py ${HUB_ADDRESS} -u ${USERNAME} -p ${PASSWORD} -z17 -t1 -s600
DEBUG: Zone(17).set_override(setpoint=1, duration=600)...
DEBUG: _request(method=PATCH, url=zone/17, data={'iMode': 16, 'fBoostSP': '1', 'iBoostTimeRemaining': '600'})

merged.

Hmm.. so have been playing this / overriding lights:

--zone=9 --mode=override - this still doesn't set a duration
--zone=9 -t0 -s3600 - this just put my outlet into override mode, but was overrode to "Off" !? (with a timer of 1 hour)

(also the -t0 for zone with no heat kinda bothers me as a UI)

The response from the v3 API (which I managed to grab) .. has iMode 16 .. presumably override, at least according to const.py.. but also has iOverrideMode 1 .. whatever that means?

--temp=[0|1] is appropriate for On/Off zones, rather than --mode=override, and -z9 -t0 is (now) the same as -z9 -t0 -s3600

(also the -t0 for zone with no heat kinda bothers me as a UI)

wontfix (for now, anyway)

Hmm so, after turning on the light using the genius app:

    "bIsActive": true,
    "bOutRequestHeat": true,
    "bPrimaryZone": true,
    "datapoints": [
      {
        "addr": "SwitchBinary",
        "confirmedValue": false,
        "lastUpdate": 0,
        "path": "site/0xEE9DA527/6",
        "type": "Int",
        "val": 1,
        "val_pend": 1,
        "val_prev": 1
      }
    ],
    "fBoostSP": 1,
    "fMaxSP": 1,
    "fMinSP": 0,
    "fOutput": 1,
    "fSP": 1,
    "iBaseMode": 1,
    "iBoostTimeRemaining": 3579,
    "iFlagActualKit": 0,
    "iFlagExpectedKit": 0,
    "iFlags": 1023,
    "iID": 9,
    "iMode": 16,
    "iOverrideDuration": 14400,
    "iOverrideMode": 1,
    "iPriority": 9,
    "iType": 2,
    "lOptions": 0,
    "linkedSettings": {
      "bFollowActive": false,
      "bFollowOutput": true,
      "fLinkSP": 21,
      "lstLinkedTo": []
    },

(and its on)

After turning it on using --zone=9 -t0 -s3600:

    "bIsActive": true,
    "bOutRequestHeat": false,
    "bPrimaryZone": true,
    "datapoints": [
      {
        "addr": "SwitchBinary",
        "confirmedValue": false,
        "lastUpdate": 0,
        "path": "site/0xEE9DA527/6",
        "type": "Int",
        "val": 0,
        "val_pend": 0,
        "val_prev": 0
      }
    ],
    "fBoostSP": 0,
    "fMaxSP": 1,
    "fMinSP": 0,
    "fOutput": 0,
    "fSP": 0,
    "iBaseMode": 1,
    "iBoostTimeRemaining": 3579,
    "iFlagActualKit": 0,
    "iFlagExpectedKit": 0,
    "iFlags": 1023,
    "iID": 9,
    "iMode": 16,
    "iOverrideDuration": 14400,
    "iOverrideMode": 1,
    "iPriority": 9,
    "iType": 2,
    "lOptions": 0,
    "linkedSettings": {
      "bFollowActive": false,
      "bFollowOutput": true,
      "fLinkSP": 21,
      "lstLinkedTo": []
    },

(and its off)

Before, the current state is on, confirmed via this command:

python ghclient.py ${HUB_ADDRESS} -u ${USERNAME} -p ${PASSWORD} -z11 -v

... which gives this v1 JSON:

{
	"id": 11,
	"name": "WiFi Repeater",
	"type": "on / off",
	"mode": "override",
	"setpoint": true,
	"override": {
		"duration": 3489,
		"setpoint": true
	}
}

Or, with this command, which gives this v3 JSON:

python ghclient.py ${HUB_ADDRESS} -u ${USERNAME} -p ${PASSWORD} -z11 -vvv

{"bIsActive": true, "bOutRequestHeat": true, "bPrimaryZone": true, "datapoints": [{"addr": "SwitchBinary", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 1, "val_pend": 1, "val_prev": 1}, {"addr": "SwitchBinary", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 1, "val_pend": 1, "val_prev": 1}], "fBoostSP": 1.0, "fMaxSP": 1, "fMinSP": 0, "fOutput": 1.0, "fSP": 1.0, "iBaseMode": 1, "iBoostTimeRemaining": 3489, "iFlagActualKit": 0, "iFlagExpectedKit": 0, "iFlags": 1023, "iID": 11, "iMode": 16, "iOverrideDuration": 3600, "iOverrideMode": 1, "iPriority": 10, "iType": 2, "lOptions": 0, "linkedSettings": {"bFollowActive": false, "bFollowOutput": true, "fLinkSP": 21.0, "lstLinkedTo": []}, "log": ["1970-01-01 01:00:40.408 INFO ZoneTimer(11) Mode changed to 1", "1970-01-01 01:00:41.563 DBG  ZoneTimer(11) Registering node: site/0xE1351ECB/6 / site/0xE1351ECB/6 (0xd44928)", "1970-01-01 01:00:41.665 DBG  ZoneTimer(11) Registering node: site/0xE1351ECB/36 / site/0xE1351ECB/36 (0xd07cd8)", "1970-01-01 01:00:42.043 DBG  ZoneTimer(11) Registering DataPoint: site/0xE1351ECB/36/SwitchBinary (0xd2aed0)", "1970-01-01 01:00:42.301 DBG  ZoneTimer(11) Registering DataPoint: site/0xE1351ECB/6/SwitchBinary (0xd28308)", "2019-10-28 12:01:43.171 INFO ZoneTimer(11) Triggers: output: 0 setpoint: 1 reactive: 1 boost: 0 test: 0 linkChildActive: 0 linkChildOutput: 0, preheat: 0", "2019-11-01 15:02:07.802 INFO ZoneTimer(11) Mode changed to 16", "2019-11-01 15:02:11.475 INFO ZoneTimer(11) Triggers: output: 1 setpoint: 1 reactive: 1 boost: 1 test: 0 linkChildActive: 0 linkChildOutput: 0, preheat: 0"], "lstIssues": [], "nodes": [{"addr": "36", "childNodes": {"_cfg": {"addr": "_cfg", "childNodes": {}, "childValues": {"name": {"addr": "name", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36/_cfg", "type": "String", "val": "Smart Plug", "val_pend": "", "val_prev": "Smart Plug"}, "sku": {"addr": "sku", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36/_cfg", "type": "String", "val": "PH-PLG-C", "val_pend": "", "val_prev": "PH-PLG-C"}}, "type": ""}}, "childValues": {"ApplicationVersion": {"addr": "ApplicationVersion", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "String", "val": "1.12", "val_pend": "1.12", "val_prev": "1.12"}, "BasicValue": {"addr": "BasicValue", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "LibraryType": {"addr": "LibraryType", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "String", "val": "Enhanced Slave", "val_pend": "Enhanced Slave", "val_prev": "Enhanced Slave"}, "ProtectionState": {"addr": "ProtectionState", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "ProtocolVersion": {"addr": "ProtocolVersion", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "String", "val": "4.5", "val_pend": "4.5", "val_prev": "4.5"}, "SwitchAllMode": {"addr": "SwitchAllMode", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 255, "val_pend": 0, "val_prev": 255}, "SwitchBinary": {"addr": "SwitchBinary", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 1, "val_pend": 1, "val_prev": 1}, "hash": {"addr": "hash", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "String", "val": "0x0000013C00110001", "val_pend": "0x0000013C00110001", "val_prev": "0x0000013C00110001"}, "health": {"addr": "health", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "lastComms": {"addr": "lastComms", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 1572620534, "val_pend": 0, "val_prev": 1572620534}, "location": {"addr": "location", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "String", "val": "WiFi Repeater", "val_pend": "", "val_prev": "WiFi Repeater"}, "manfID": {"addr": "manfID", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "String", "val": "316/1/17", "val_pend": "316/1/17", "val_prev": "316/1/17"}, "powerLevel": {"addr": "powerLevel", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}}, "type": ""}, {"addr": "6", "childNodes": {"_cfg": {"addr": "_cfg", "childNodes": {}, "childValues": {"name": {"addr": "name", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6/_cfg", "type": "String", "val": "Smart Plug", "val_pend": "", "val_prev": "Smart Plug"}, "sku": {"addr": "sku", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6/_cfg", "type": "String", "val": "PH-PLG-C", "val_pend": "", "val_prev": "PH-PLG-C"}}, "type": ""}}, "childValues": {"ApplicationVersion": {"addr": "ApplicationVersion", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "String", "val": "1.12", "val_pend": "1.12", "val_prev": "1.12"}, "BasicValue": {"addr": "BasicValue", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "LibraryType": {"addr": "LibraryType", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "String", "val": "Enhanced Slave", "val_pend": "Enhanced Slave", "val_prev": "Enhanced Slave"}, "ProtectionState": {"addr": "ProtectionState", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "ProtocolVersion": {"addr": "ProtocolVersion", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "String", "val": "4.5", "val_pend": "4.5", "val_prev": "4.5"}, "SwitchAllMode": {"addr": "SwitchAllMode", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 255, "val_pend": 0, "val_prev": 255}, "SwitchBinary": {"addr": "SwitchBinary", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 1, "val_pend": 1, "val_prev": 1}, "hash": {"addr": "hash", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "String", "val": "0x0000013C00110001", "val_pend": "0x0000013C00110001", "val_prev": "0x0000013C00110001"}, "health": {"addr": "health", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "lastComms": {"addr": "lastComms", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 1572620598, "val_pend": 0, "val_prev": 1572620598}, "location": {"addr": "location", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "String", "val": "WiFi Repeater", "val_pend": "", "val_prev": "WiFi Repeater"}, "manfID": {"addr": "manfID", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "String", "val": "316/1/17", "val_pend": "316/1/17", "val_prev": "316/1/17"}, "powerLevel": {"addr": "powerLevel", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}}, "type": ""}], "objTimer": [{"fSP": 0.0, "iDay": 0, "iTm": -1}, {"fSP": 1.0, "iDay": 0, "iTm": 0}, {"fSP": 0.0, "iDay": 0, "iTm": 86400}, {"fSP": 0.0, "iDay": 1, "iTm": -1}, {"fSP": 1.0, "iDay": 1, "iTm": 0}, {"fSP": 0.0, "iDay": 1, "iTm": 86400}, {"fSP": 0.0, "iDay": 2, "iTm": -1}, {"fSP": 1.0, "iDay": 2, "iTm": 0}, {"fSP": 0.0, "iDay": 2, "iTm": 86400}, {"fSP": 0.0, "iDay": 3, "iTm": -1}, {"fSP": 1.0, "iDay": 3, "iTm": 0}, {"fSP": 0.0, "iDay": 3, "iTm": 86400}, {"fSP": 0.0, "iDay": 4, "iTm": -1}, {"fSP": 1.0, "iDay": 4, "iTm": 0}, {"fSP": 0.0, "iDay": 4, "iTm": 86400}, {"fSP": 0.0, "iDay": 5, "iTm": -1}, {"fSP": 1.0, "iDay": 5, "iTm": 0}, {"fSP": 0.0, "iDay": 5, "iTm": 86400}, {"fSP": 0.0, "iDay": 6, "iTm": -1}, {"fSP": 1.0, "iDay": 6, "iTm": 0}, {"fSP": 0.0, "iDay": 6, "iTm": 86400}], "strName": "WiFi Repeater", "trigger": {"boost": 1, "linkChildActive": 0, "linkChildOutput": 0, "output": 1, "preheat": 0, "reactive": 1, "setpoint": 1, "test": 0}, "zoneReactive": {"bTriggerOff": true, "bTriggerOn": false, "fActivityLevel": 0.0, "fThreshold": 1.0, "iReactiveMinutesTriggerOff": 20, "iReactiveMinutesTriggerOn": 2, "iSensitivity": 80, "iTimeTillOff": 0, "iTimeTillOn": 2, "tmLastActivity": 0}, "zoneSubType": 0}

Then we turn it off:

python ghclient.py ${HUB_ADDRESS} -u ${USERNAME} -p ${PASSWORD} -z11 -t0 -s2600

After, the state has changed to off, confirmed via this command:

python ghclient.py ${HUB_ADDRESS} -u ${USERNAME} -p ${PASSWORD} -z11 -v

... which gives this v1 JSON Note the "setpoint": true):

{
	"id": 11,
	"name": "WiFi Repeater",
	"type": "on / off",
	"mode": "override",
	"setpoint": true,
	"override": {
		"duration": 2600,
		"setpoint": false
	}
}

If we wait a few seconds, then we get this v1 JSON:

{
	"id": 11,
	"name": "WiFi Repeater",
	"type": "on / off",
	"mode": "override",
	"setpoint": false,
	"override": {
		"duration": 1586,
		"setpoint": false
	}
}

Or, with this command, which gives this v3 JSON:

python ghclient.py ${HUB_ADDRESS} -u ${USERNAME} -p ${PASSWORD} -z11 -vvv

{"bIsActive": true, "bOutRequestHeat": false, "bPrimaryZone": true, "datapoints": [{"addr": "SwitchBinary", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, {"addr": "SwitchBinary", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}], "fBoostSP": 0.0, "fMaxSP": 1, "fMinSP": 0, "fOutput": 0.0, "fSP": 0.0, "iBaseMode": 1, "iBoostTimeRemaining": 1576, "iFlagActualKit": 0, "iFlagExpectedKit": 0, "iFlags": 1023, "iID": 11, "iMode": 16, "iOverrideDuration": 3600, "iOverrideMode": 1, "iPriority": 10, "iType": 2, "lOptions": 0, "linkedSettings": {"bFollowActive": false, "bFollowOutput": true, "fLinkSP": 21.0, "lstLinkedTo": []}, "log": ["1970-01-01 01:00:40.408 INFO ZoneTimer(11) Mode changed to 1", "1970-01-01 01:00:41.563 DBG  ZoneTimer(11) Registering node: site/0xE1351ECB/6 / site/0xE1351ECB/6 (0xd44928)", "1970-01-01 01:00:41.665 DBG  ZoneTimer(11) Registering node: site/0xE1351ECB/36 / site/0xE1351ECB/36 (0xd07cd8)", "1970-01-01 01:00:42.043 DBG  ZoneTimer(11) Registering DataPoint: site/0xE1351ECB/36/SwitchBinary (0xd2aed0)", "1970-01-01 01:00:42.301 DBG  ZoneTimer(11) Registering DataPoint: site/0xE1351ECB/6/SwitchBinary (0xd28308)", "2019-10-28 12:01:43.171 INFO ZoneTimer(11) Triggers: output: 0 setpoint: 1 reactive: 1 boost: 0 test: 0 linkChildActive: 0 linkChildOutput: 0, preheat: 0", "2019-11-01 15:02:07.802 INFO ZoneTimer(11) Mode changed to 16", "2019-11-01 15:02:11.475 INFO ZoneTimer(11) Triggers: output: 1 setpoint: 1 reactive: 1 boost: 1 test: 0 linkChildActive: 0 linkChildOutput: 0, preheat: 0", "2019-11-01 15:04:31.644 INFO ZoneTimer(11) Triggers: output: 0 setpoint: 1 reactive: 1 boost: 0 test: 0 linkChildActive: 0 linkChildOutput: 0, preheat: 0"], "lstIssues": [], "nodes": [{"addr": "36", "childNodes": {"_cfg": {"addr": "_cfg", "childNodes": {}, "childValues": {"name": {"addr": "name", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36/_cfg", "type": "String", "val": "Smart Plug", "val_pend": "", "val_prev": "Smart Plug"}, "sku": {"addr": "sku", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36/_cfg", "type": "String", "val": "PH-PLG-C", "val_pend": "", "val_prev": "PH-PLG-C"}}, "type": ""}}, "childValues": {"ApplicationVersion": {"addr": "ApplicationVersion", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "String", "val": "1.12", "val_pend": "1.12", "val_prev": "1.12"}, "BasicValue": {"addr": "BasicValue", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "LibraryType": {"addr": "LibraryType", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "String", "val": "Enhanced Slave", "val_pend": "Enhanced Slave", "val_prev": "Enhanced Slave"}, "ProtectionState": {"addr": "ProtectionState", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "ProtocolVersion": {"addr": "ProtocolVersion", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "String", "val": "4.5", "val_pend": "4.5", "val_prev": "4.5"}, "SwitchAllMode": {"addr": "SwitchAllMode", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 255, "val_pend": 0, "val_prev": 255}, "SwitchBinary": {"addr": "SwitchBinary", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "hash": {"addr": "hash", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "String", "val": "0x0000013C00110001", "val_pend": "0x0000013C00110001", "val_prev": "0x0000013C00110001"}, "health": {"addr": "health", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "lastComms": {"addr": "lastComms", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 1572621625, "val_pend": 0, "val_prev": 1572621625}, "location": {"addr": "location", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "String", "val": "WiFi Repeater", "val_pend": "", "val_prev": "WiFi Repeater"}, "manfID": {"addr": "manfID", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "String", "val": "316/1/17", "val_pend": "316/1/17", "val_prev": "316/1/17"}, "powerLevel": {"addr": "powerLevel", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/36", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}}, "type": ""}, {"addr": "6", "childNodes": {"_cfg": {"addr": "_cfg", "childNodes": {}, "childValues": {"name": {"addr": "name", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6/_cfg", "type": "String", "val": "Smart Plug", "val_pend": "", "val_prev": "Smart Plug"}, "sku": {"addr": "sku", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6/_cfg", "type": "String", "val": "PH-PLG-C", "val_pend": "", "val_prev": "PH-PLG-C"}}, "type": ""}}, "childValues": {"ApplicationVersion": {"addr": "ApplicationVersion", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "String", "val": "1.12", "val_pend": "1.12", "val_prev": "1.12"}, "BasicValue": {"addr": "BasicValue", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "LibraryType": {"addr": "LibraryType", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "String", "val": "Enhanced Slave", "val_pend": "Enhanced Slave", "val_prev": "Enhanced Slave"}, "ProtectionState": {"addr": "ProtectionState", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "ProtocolVersion": {"addr": "ProtocolVersion", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "String", "val": "4.5", "val_pend": "4.5", "val_prev": "4.5"}, "SwitchAllMode": {"addr": "SwitchAllMode", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 255, "val_pend": 0, "val_prev": 255}, "SwitchBinary": {"addr": "SwitchBinary", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "hash": {"addr": "hash", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "String", "val": "0x0000013C00110001", "val_pend": "0x0000013C00110001", "val_prev": "0x0000013C00110001"}, "health": {"addr": "health", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}, "lastComms": {"addr": "lastComms", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 1572621625, "val_pend": 0, "val_prev": 1572621625}, "location": {"addr": "location", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "String", "val": "WiFi Repeater", "val_pend": "", "val_prev": "WiFi Repeater"}, "manfID": {"addr": "manfID", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "String", "val": "316/1/17", "val_pend": "316/1/17", "val_prev": "316/1/17"}, "powerLevel": {"addr": "powerLevel", "confirmedValue": false, "lastUpdate": 0, "path": "site/0xE1351ECB/6", "type": "Int", "val": 0, "val_pend": 0, "val_prev": 0}}, "type": ""}], "objTimer": [{"fSP": 0.0, "iDay": 0, "iTm": -1}, {"fSP": 1.0, "iDay": 0, "iTm": 0}, {"fSP": 0.0, "iDay": 0, "iTm": 86400}, {"fSP": 0.0, "iDay": 1, "iTm": -1}, {"fSP": 1.0, "iDay": 1, "iTm": 0}, {"fSP": 0.0, "iDay": 1, "iTm": 86400}, {"fSP": 0.0, "iDay": 2, "iTm": -1}, {"fSP": 1.0, "iDay": 2, "iTm": 0}, {"fSP": 0.0, "iDay": 2, "iTm": 86400}, {"fSP": 0.0, "iDay": 3, "iTm": -1}, {"fSP": 1.0, "iDay": 3, "iTm": 0}, {"fSP": 0.0, "iDay": 3, "iTm": 86400}, {"fSP": 0.0, "iDay": 4, "iTm": -1}, {"fSP": 1.0, "iDay": 4, "iTm": 0}, {"fSP": 0.0, "iDay": 4, "iTm": 86400}, {"fSP": 0.0, "iDay": 5, "iTm": -1}, {"fSP": 1.0, "iDay": 5, "iTm": 0}, {"fSP": 0.0, "iDay": 5, "iTm": 86400}, {"fSP": 0.0, "iDay": 6, "iTm": -1}, {"fSP": 1.0, "iDay": 6, "iTm": 0}, {"fSP": 0.0, "iDay": 6, "iTm": 86400}], "strName": "WiFi Repeater", "trigger": {"boost": 0, "linkChildActive": 0, "linkChildOutput": 0, "output": 0, "preheat": 0, "reactive": 1, "setpoint": 1, "test": 0}, "zoneReactive": {"bTriggerOff": true, "bTriggerOn": false, "fActivityLevel": 0.0, "fThreshold": 1.0, "iReactiveMinutesTriggerOff": 20, "iReactiveMinutesTriggerOn": 2, "iSensitivity": 80, "iTimeTillOff": 0, "iTimeTillOn": 2, "tmLastActivity": 0}, "zoneSubType": 0}

Note that my on/off zone has two smart plugs (SwitchBinary).

To be clear, I believe the code is behaving as expected.

I mean.. the light isnt on - genius hub reports : Override: Off, with a timer.. so to me its not behaving as I'd want it to.. I will test via HA

Hmmm... if the light doesn't turn on, then that's pretty damning evidence, isn't it!

Well, I have to admit that I am not in the same house as my GH system, so I am only going off the JSON (which is telling me what I expect to hear).

Further testing will require me to physically pop over there, which might take a few days.

Can you execute the about script, with 15 secs between each step, and send me the v1/v3 JSON?

The v1 JSON from your reports is presumably the json data after taking the v3 pile of cram, and converting to v1? My assumption was therefore that somehow the conversion was incorrect with respect to the on/off states.. Correct me if wrong..

I could also try using it via v1 and see if that helps - I am currently using host/username/pass to talk to the hub directly via v3

Hmm, I was also assuming that "setpoint" was only about the temperature request stuff, was that incorrect?

Anyhoo I will try debuggingv1/v3 (not using vscode here, so have added more json dumps in the request call) - standby...

Btw, any more direct ways of chatting? (telegram, messenger, discord etc..)

python3 ./ghclient.py hotstuff.local --user=xx pass=yy -z9 -v
(light starts off)

{"id": 9,
 "name": "basement light",
 "type": "on / off",
 "mode": "off",
 "setpoint": false,
 "override": 
  {"duration": 0,
   "setpoint": true
 }
}

python3 ./ghclient.py hotstuff.local --user=xx --pass=yy0 -z9 -t0 -s3600
(turn it on? at least thats what I was assuming this would do)
retest:

python3 ./ghclient.py hotstuff.local --user=xx pass=yy -z9 -v

{"id": 9,
 "name": "basement light",
 "type": "on / off",
 "mode": "override",
 "setpoint": false,
 "override": 
 {"duration": 3579,
  "setpoint": false
 }
}

.. light not on

.. now Im wondering if Im getting the right command, how do we specify on / off using -tX -s X ?

yup, I'm a nitwit.. I just read your patch to HA... t0 for off, t1 for on? thats where I had lost the plot!

t0 for off, t1 for on

Yeah, sorry for not making that clear. And -s3600 if not explicitly specified.

(I just read your initial messages, sorry I didn't pick it up then!)