homebridge-lutron-caseta-leap icon indicating copy to clipboard operation
homebridge-lutron-caseta-leap copied to clipboard

Add support for battery state

Open thenewwazoo opened this issue 2 years ago • 1 comments

BatteryState is included in DeviceStatus:

{
  "CommuniqueType": "ReadResponse",
  "Header": {
    "MessageBodyType": "OneDeviceStatus",
    "StatusCode": "200 OK",
    "Url": "/device/37/status"
  },
  "Body": {
    "DeviceStatus": {
      "href": "/device/37/status",
      "Device": {
        "href": "/device/37"
      },
      "FailedTransfers": {
        "Count": 0
      },
      "ConfigurationTransferStatus": "NotRequired",
      "Availability": "Available",
      "BatteryStatus": {
        "LevelState": "Good"
      }
    }
  }
}

thenewwazoo avatar Feb 11 '22 05:02 thenewwazoo

Cannot directly subscribe to device status:

DEBUG:pylutron_caseta.leap:sending b'{"CommuniqueType": "SubscribeRequest", "Header": {"ClientTag": "b6b0c9c2-d5c2-4666-8e48-d2c57b40c0a2", "Url": "/device/37/status"}}'
DEBUG:pylutron_caseta.leap:received: {'CommuniqueType': 'ExceptionResponse', 'Header': {'MessageBodyType': 'ExceptionDetail', 'StatusCode': '405 MethodNotAllowed', 'Url': '/device/37/status'}, 'Body': {'Message': 'This request is not supported'}}

Could possibly recv battery status updates by subscribing to the bulk device status endpoint /device/status.

thenewwazoo avatar Feb 11 '22 05:02 thenewwazoo