Closed reneposthumus closed 8 months ago
It looks like Rova might've changed their json format:
{
"id": 311447,
"date": "2024-02-21T00:00:00Z",
"wasteType": {
"id": 2,
"code": "GFT",
"title": "Gft",
"icon": "gft",
"notificationTitle": "Herinnering gft",
"notificationText": "Morgen komen we bij je langs om jouw gft op te halen. ",
"notificationTitleSameDay": "Herinnering gft",
"notificationTextSameDay": "Vandaag komen we bij je langs om jouw gft op te halen. "
},
"isIrregular": false
},
{
"id": 311448,
"date": "2024-03-06T00:00:00Z",
"wasteType": {
"id": 2,
"code": "GFT",
"title": "Gft",
"icon": "gft",
"notificationTitle": "Herinnering gft",
"notificationText": "Morgen komen we bij je langs om jouw gft op te halen. ",
"notificationTitleSameDay": "Herinnering gft",
"notificationTextSameDay": "Vandaag komen we bij je langs om jouw gft op te halen. "
},
"isIrregular": false
},
{
"id": 311472,
"date": "2024-03-12T00:00:00Z",
"wasteType": {
"id": 6,
"code": "PMD",
"title": "Pmd",
"icon": "pmd",
"notificationTitle": "Herinnering pmd",
"notificationText": "Morgen komen we bij je langs om jouw pmd op te halen. ",
"notificationTitleSameDay": "Herinnering pmd",
"notificationTextSameDay": "Vandaag komen we bij je langs om jouw pmd op te halen. "
},
"isIrregular": false
}
]
I'm not sure what the old format was and I'm not a python coder, but perhaps instead of item["garbageTypeCode"]
we need to look for something like item["wasteType"]["code"]
around this line?
Happy to look into this if I have a zipcode and house number I can use
Hi Luke, it indeed seems like it. I know the API is not supported by Rova at all but I think the creator of the Rova HA integration can easily change the code to match the new API response. Hopefully he is willing to do so.
Happy to look into this if I have a zipcode and house number I can use
That would be great, this is a random zipcode and housenumber: 8381BE, 13
There is a pull request that fixes this in the python library for the ROVA API, used by this integration (https://pypi.org/project/rova/): https://github.com/GidoHakvoort/rova/pull/7
I have updateted Home assistant but I have still the same error with the same log as above. Is there something else I have to do to get it working again?
It was released yesterday as part of 2024.3 (it is in the release notes), since then it's working again for me.
The dependency update in 2024.3 did fix it!
I was working on some other features for this integration and therefore used a custom version where i didn't update the rova
package 😅
Working again. Thank you!
Unfortunately it doesn't seem to be working for Residual yet. Bio and plastic/PMD works fine but residual is still set to Unknown.
My config:
- platform: rova
zip_code: <redacted>
house_number: <redacted>
monitored_conditions:
- bio
- plastic
- residual
Example JSON for residual:
"id": 446804,
"date": "2024-03-08T00:00:00Z",
"wasteType": {
"id": 1,
"code": "RST",
"title": "Restafval",
"icon": "restafval",
"notificationTitle": "Herinnering restafval",
"notificationText": "Morgen komen we bij je langs om jouw restafval op te halen.",
"notificationTitleSameDay": "Herinnering restafval",
"notificationTextSameDay": "Vandaag komen we bij je langs om jouw restafval op te halen."
},
"isIrregular": false
}
We probably need to add another line like this one: https://github.com/GidoHakvoort/rova/blob/master/rova/rova.py#L83 for RST. Also created https://github.com/GidoHakvoort/rova/issues/9 for consistency.
I made a PR for Rova with a fix (https://github.com/GidoHakvoort/rova/pull/10), and got it merged into Home Assistant (https://github.com/home-assistant/core/pull/113066). The fix should be in 2024.3.1, and already is in the current dev docker image, and it's working again for residual trash here:
Can confirm, Home Assistant 2024.3.1 is released and it is now working for residual trash too. :tada:
The problem
Hi, it seems that the Rova integration stopped working since the latest update, but I cannot put my finger on it exactly. It comes back with an error in the logs and the sensors are gone:
`rova: Error on device update! Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 599, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1261, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/rova/sensor.py", line 116, in update self.data_service.update() File "/usr/src/homeassistant/homeassistant/util/init.py", line 190, in wrapper result = method(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/rova/sensor.py", line 135, in update items = self.api.get_calendar_items() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/rova/rova.py", line 80, in get_calendar_items garbage_type = item["garbageTypeCode"].upper()