Closed justinmaiuto closed 4 months ago
Here is the notification in the app which I've not seen before, suggesting recent changes on iaqualink side
Do you have experience with API's?
you can use postman.
you should first do a login and then with the IdToken returned call the get device status, you also need the device id in the url in case you don't have that you need first to call the get devices to get your serial_number.
I'll need the return of your getdevicestatus to make sure the code works for you. It still runs here.
So, the "19" temperature value has been the same for 2 days, regardless of whether the robot is running or not. Seems something wrong on the iAqualink side around updating temperature value given this response seems fine.
{
"state": {
"reported": {
"aws": {
"status": "connected",
"timestamp": 1711528456440,
"session_id": "3dc92331-129f-4042-b569-09540d4ff647"
},
"sn": "KD2100004952",
"dt": "vr",
"vr": "V32C41",
"eboxData": {
"controlBoxSn": "OMA2122910",
"controlBoxPn": "30121700",
"completeCleanerSn": "HLCA03011922211357",
"completeCleanerPn": "WR000386",
"powerSupplySn": "AP21070277",
"sensorBlockSn": "EL21011624",
"motorBlockSn": "EMB2117450"
},
"equipment": {
"robot": {
"vr": "V32E41",
"state": 0,
"liftControl": 0,
"prCyc": 2,
"cycleStartTime": 1711528462,
"canister": 0,
"equipmentId": "JZ21016289",
"rmt_ctrl": 0,
"logger": 0,
"firstSmrtFlag": 0,
"scanTimeDuration": 30,
"stepper": 0,
"stepperAdjTime": 15,
"errorState": 0,
"errorCode": 0,
"customCyc": 1,
"customIntensity": 0,
"totalHours": 1088,
"durations": {
"waterTim": 45,
"quickTim": 75,
"smartTim": 111,
"deepTim": 165,
"customTim": 150,
"firstSmartTim": 150
},
"sensors": {
"sns_1": {
"type": "temperature",
"state": 0,
"val": 19
},
"sns_2": {
"type": "pressure",
"state": 0
},
"sns_3": {
"type": "compass",
"state": 0
}
},
"schConf1Enable": 1,
"schConf1Prt": 2,
"schConf1Hour": 21,
"schConf1Min": 30,
"schConf1WDay": 0,
"schConf2Enable": 1,
"schConf2Prt": 2,
"schConf2Hour": 21,
"schConf2Min": 30,
"schConf2WDay": 1,
"schConf3Enable": 1,
"schConf3Prt": 3,
"schConf3Hour": 21,
"schConf3Min": 0,
"schConf3WDay": 2,
"schConf4Enable": 1,
"schConf4Prt": 2,
"schConf4Hour": 21,
"schConf4Min": 30,
"schConf4WDay": 3,
"schConf5Enable": 1,
"schConf5Prt": 2,
"schConf5Hour": 21,
"schConf5Min": 30,
"schConf5WDay": 4,
"schConf6Enable": 1,
"schConf6Prt": 3,
"schConf6Hour": 21,
"schConf6Min": 0,
"schConf6WDay": 5,
"schConf0Enable": 1,
"schConf0Prt": 2,
"schConf0Hour": 21,
"schConf0Min": 30,
"schConf0WDay": 6,
"repeat": 0
}
}
}
},
"deviceId": "KD2100004952",
"ts": 1711538173
}
How is the polling for this integration working? It seems that maybe it fails once and then stops polling for anything? For example, although the temperature is not changing from 19 degrees when using postman, the hours count of run time is increasing each time I use the robot. But in HA it is not reflecting the updated hours count (at least not straight away as far as I can see)
it is polling every 30 seconds:
SCAN_INTERVAL = timedelta(seconds=30)
for me its non stop updating, but it could be that due to it crashing its not updating after it.
the data also still appears to be on the same location:
#temperature seems to depend on robot model and has 2 possible locations:
try:
self._temperature = data["state"]["reported"]["equipment"]["robot"]["sensors"]["sns_1"]["val"]
except:
try:
self._temperature = data["state"]["reported"]["equipment"]["robot"]["sensors"]["sns_1"]["state"]
except:
self._temperature = '0' #Zodiac XA 5095 iQ does not support temp for example see https://github.com/galletn/iaqualink/issues/9
self._attributes['temperature'] = self._temperature
Ok how do we stop it crashing. Looks like a cast from string to float error as per my first post
can you test https://github.com/galletn/iaqualink/pull/15
I gave it a fix value 0 at initial run already.
The only thing that I find strange is that it freaks out at a line that is not referring to the code.
Did you create template sensors based on it ?
Yep i have a template sensor for it
I think that is the one blocking it ... so please can you remove it for a second and then restart and see if it runs? Also with this code it should be fixed at runtime already. But 99% chance its your template sensor.
Hi, I've tried with the code you updated and also with removing the template sensors. Neither seems to have made a difference. Seems to me like some bigger problems at play here - the integration is no longer receiving/capturing updates related for when the robot is running vs. not running. This used to work fine also. Seems to be stuck on whatever values it retrieves on HA startup and nothing post that until next startup.
@justinmaiuto I think you are right there was an very crucial update missing towards the data factory class.
Can you check again now? (branch version not main release yet)
I did not notice as I just pulled out my robot just last week.
tested and worked for me now
Yep seems sorted!
Ok, so the updates seem to be working now for everything.....except for the temperature updates. which was the original issue I raised. After a couple of days of running, the temperature has not updated once. I have other sensors in the pool and the report as expected (ie the pool is heatig up in the day and cooling down over night). But the pool robot has been stuck on 16 degrees Celsius the whole time.
For me the temperature is still updating, I also do not have the popup you have in the app about the temperature.
Does it update when you have the app opened while running?
Also code wise there is no difference between any other of the values (like running hours or last start time), so it must be that the API of your robot remains sending that value.
Not a lot that I can do about that I'm afraid.
This has been working for a while, but stopped seemingly when I updated to 480e9cd.
Something weird happened where it created a new robot entity, not sure if it is related. I have since uninstalled via HACS, deleted all robot entities, reinstalled and now have just the 1 entity. But the temperature value is not updating. Normally this would only update when the robot is running which is fine, but it's now no longer updating regardless of whether the robot is running or not.
Interestingly, in the iAqualink app there is a new notification saying that the robot temperature only updates when the robot is running which I don't recall seeing before, but either way I can't find anywhere which actually shows the temperature value in the app. Why is this relevant - suggests perhaps iAqualink may have made some recent changes to the temperature functionality.
These are the relevant errors in the logs: