Closed andrew-kennedy closed 1 month ago
Where are you looking at the data? You may need to switch the target entity.
One of the recent changes may have caused your home assistant to create a new entity. Looking at the old one will show unknown data. See if there is a different entity with valid data.
I may have misunderstood your question to mean that you couldn't see any attributes. I'm seeing bed state as Unknown as well. All the other sensors like bed temperature and HRV are working for me.
Bed State is still updating for me. @andrew-kennedy, I'm curious if your account is being served a different version of the API
Hmm, can you remind me which endpoints are in use for that state so I can audit them? I'll take another traffic capture.
@andrew-kennedy It's pulling from the heating_level: `@property def heating_level(self) -> int | None: """Return heating/cooling level.""" level = self.device.device_data.get(f"{self.side}HeatingLevel")
if level is not None and level < self.observed_low:
self.observed_low = level
return level`
This boils down to being the first dictionary in the list returned from the url f"{CLIENT_API_URL}/devices/{self.device_id}"
The key for this dictionary that is being used here is f"{self.side}HeatingLevel"
{
"result": {
"deviceId": "redacted",
"ownerId": "<redacted>",
"leftUserId": "<redacted>",
"leftHeatingLevel": -33,
"leftTargetHeatingLevel": 0,
"leftNowHeating": false,
"leftHeatingDuration": 0,
"leftSchedule": {
"daysUTC": {
"sunday": false,
"monday": false,
"tuesday": false,
"wednesday": false,
"thursday": false,
"friday": false,
"saturday": false
},
"enabled": false
},
"rightUserId": "redacted",
"rightHeatingLevel": -33,
"rightTargetHeatingLevel": 0,
"rightNowHeating": false,
"rightHeatingDuration": 0,
"rightSchedule": {
"daysUTC": {
"sunday": false,
"monday": false,
"tuesday": false,
"wednesday": false,
"thursday": false,
"friday": false,
"saturday": false
},
"enabled": false
},
"priming": false,
"lastLowWater": "2024-07-26T20:38:51.800Z",
"needsPriming": false,
"hasWater": true,
"ledBrightnessLevel": 15,
"sensorInfo": {
"label": "20600-0003-F00-00012C1D",
"partNumber": "20600",
"sku": "0003",
"hwRevision": "F00",
"serialNumber": "redacted",
"lastConnected": "2024-09-17T08:04:02.423Z",
"skuName": "caking",
"connected": true
},
"timezone": "America/Los_Angeles",
"mattressInfo": {
"firstUsedDate": null,
"eightMattress": null,
"brand": null
},
"firmwareCommit": "026334eb083095a6450edbf3d7c046b802b4280b",
"firmwareVersion": "026334e",
"firmwareUpdated": true,
"firmwareUpdating": false,
"lastFirmwareUpdateStart": "1970-01-01T00:00:00.000+00:00",
"lastHeard": "2024-09-17T08:05:45.244Z",
"online": true,
"encasementType": null,
"leftKelvin": {
"targetLevels": [
-21,
-21,
-21
],
"alarms": [],
"scheduleProfiles": [],
"phases": [],
"level": 0,
"currentTargetLevel": 0,
"active": false,
"currentActivity": "off"
},
"rightKelvin": {
"targetLevels": [
-21,
-21,
-21
],
"alarms": [],
"scheduleProfiles": [],
"phases": [],
"level": 0,
"currentTargetLevel": 0,
"active": false,
"currentActivity": "off"
},
"features": [
"warming",
"cooling",
"vibration",
"alarms"
],
"leftUserInvitationPending": false,
"rightUserInvitationPending": false,
"modelString": "Pod 3",
"lastPrime": "2024-04-24T21:03:33.000Z",
"isTemperatureAvailable": true,
"deactivated": {}
}
}
This is what I see returned from that API when I do a traffic capture.
I'm wondering if the side names are somehow wrong and being interpolated into incorrect keys or something...
So looking at the code, if you setup the integration while your bed was in away mode the self.side key wouldn't ever update when you assigned yourself to a bed side. This could cause the key for the json data to be misformatted. Creating a release to fix this, which I'm guessing may be your issue.
Closing this, since I believe the latest releases fixed the issue.
As of 1.0.15, I've noticed my Bed State, and all its attributes, are always unknown. This means I have no way to read the target heating level of the bed, though I'm still able to set it. Not seeing any error messages, but I haven't had time to go enable debug logging.