So I’ve done some digging into the lock issue that @slappy has been having. The reason why it isn’t working properly is because pyhs3 expects certain responses from the HomeSeer API and these locks aren’t providing the expected data for a lock - I’m not sure if it’s because of the model of lock, or just a quirk with these specific devices, but it’s definitely on the HomeSeer side.
Every device in HomeSeer has associated “Control Pairs” that tell HomeSeer what value to send to the device to get it to operate the way you want. This data is required when making an API request from outside of HomeSeer; in a request you need to pass the value associated with the operation you want. Most devices have a pair of values for off and on. Locks are supposed to have a pair of values for lock and unlock. These are identified in the HomeSeer API response as follows for your lock that works:
{
"ref": 563,
"name": "Door Lock",
"location": "Workshop",
"location2": "Locks",
"voice_command": "",
"ControlPairs": [{
"Do_Update": true,
"SingleRangeEntry": true,
"ControlButtonType": 0,
"ControlButtonCustom": "",
"CCIndex": 0,
"Range": null,
"Ref": 563,
"Label": "Unlock",
"ControlType": 5,
"ControlLocation": {
"Row": 0,
"Column": 0,
"ColumnSpan": 0
},
"ControlLoc_Row": 0,
"ControlLoc_Column": 0,
"ControlLoc_ColumnSpan": 0,
"ControlUse": 19,
"ControlValue": 0,
"ControlString": "",
"ControlStringList": null,
"ControlStringSelected": null,
"ControlFlag": false
}, {
"Do_Update": true,
"SingleRangeEntry": true,
"ControlButtonType": 0,
"ControlButtonCustom": "",
"CCIndex": 1,
"Range": null,
"Ref": 563,
"Label": "Lock",
"ControlType": 5,
"ControlLocation": {
"Row": 0,
"Column": 0,
"ColumnSpan": 0
},
"ControlLoc_Row": 0,
"ControlLoc_Column": 0,
"ControlLoc_ColumnSpan": 0,
"ControlUse": 18,
"ControlValue": 255,
"ControlString": "",
"ControlStringList": null,
"ControlStringSelected": null,
"ControlFlag": false
}]
}
Drilling down into the response we can see that there is one control pair for ControlUse 18 (which corresponds to “lock” in the HS API documentation), with a ControlValue of 255, and one for ControlUse 19 (corresponding to “unlock”) with ControlValue 0. pyhs3 reads this on the startup of HA, creates a device, and stores 255 as the lock value and 0 as the unlock value. When you toggle the lock in HA, pysh3 makes an API request to HomeSeer and passes the appropriate value depending on the operation requested.
Here’s the control data for the locks that don’t work:
{
"ref": 366,
"name": "Door Lock",
"location": "Detached Movie Room",
"location2": "Locks",
"voice_command": "",
"ControlPairs": [{
"Do_Update": true,
"SingleRangeEntry": true,
"ControlButtonType": 0,
"ControlButtonCustom": "",
"CCIndex": 0,
"Range": null,
"Ref": 366,
"Label": "Unlock",
"ControlType": 5,
"ControlLocation": {
"Row": 0,
"Column": 0,
"ColumnSpan": 0
},
"ControlLoc_Row": 0,
"ControlLoc_Column": 0,
"ControlLoc_ColumnSpan": 0,
"ControlUse": 0,
"ControlValue": 0,
"ControlString": "",
"ControlStringList": null,
"ControlStringSelected": null,
"ControlFlag": false
}, {
"Do_Update": true,
"SingleRangeEntry": true,
"ControlButtonType": 0,
"ControlButtonCustom": "",
"CCIndex": 1,
"Range": null,
"Ref": 366,
"Label": "Lock",
"ControlType": 5,
"ControlLocation": {
"Row": 0,
"Column": 0,
"ColumnSpan": 0
},
"ControlLoc_Row": 0,
"ControlLoc_Column": 0,
"ControlLoc_ColumnSpan": 0,
"ControlUse": 0,
"ControlValue": 255,
"ControlString": "",
"ControlStringList": null,
"ControlStringSelected": null,
"ControlFlag": false
}]
}
You can see that the ControlUse for both pairs is 0, with different values of 0 and 255! ControlUse 0 is defined in the HSAPI documentation as “Not_Specified” which is unhelpful. However, the “Label” for each control pair is helpful here - “Lock” and “Unlock”.
I’ve updated pyhs3 to 0.12 including this fix, and bumped the custom component also (to 0.7). Please delete and reinstall the custom component and you should be good to go!