Jumbo.com integration (Dutch Supermarket)

That’s strange. I need to check that

@MikeBrink created an excellent Picnic plugin which you can find here; https://github.com/mikebrink/home-assistant-picnic

@ptnijssen Please let me know if there is anything I can do for you to help you resolve this issue.

Sorry for the delay. You can enable debugging as noted in the github repository. Please do so and check if you get a log indicating that Jumbo got updated.

If it’s updating properly, then there is maybe something wrong in how I mark orders that have been picked up. Will need to check that then.

Looks like a nice integration, unfortunately I only use Albert Heijn. I have tried finding information about a similar integration for AH, but it appears nonexistent…
Do you know if an AH integration exists? If not would you be willing to take a look? I wish I could help on the programming side, but I know very little about this. I would off course be willing to test things!

I am not aware of any AH version. As I don’t use AH as a delivery service, I just can’t easily build an integration. I would need access to an account that actively uses the delivery / pick-up service.

Thanks for your answer, sharing my account is a bit too much :smiley: They don’t have an API as far as I know, so maybe somebody else will make something in the future.

Thanks for making this plugin, looks good!

What is the refresh rate or can you set it somewhere?

They have something the mobile app communicates with I guess. You just find to have a tech person who can reverse engineer the app.

Refresh rate is set to 15 min. Not sure if I correctly implemented it that you can change the scan interval like other integrations.

Reason for 15 minutes was because that was sufficient for me and I didn’t want to kill their API :wink:

When I look in the log I see that updates are continuously being requested.


But status is not updated.

After the state flips from Open to Proccessing, it will never get Ready for pickup status.

Just to verify; Within the Jumbo app you do see it as completed or whatever the status is, right? Because the status you are seeing is coming straight from Jumbo without me altering it.

I did one pick up 1-2 months ago and that is marked as “afgerond” and doesn’t appear anymore within my HA instance.

If it’s marked as “completed” in the Jumbo app itself, it could mean that updating somehow doesn’t work correctly.

Yes, changing statuses correctly in the Jumbo app. After the pickup on December 30, the status in HA has not been changed. My next pickup was on January 2nd. The following messages now appear in the log:





Before the restart of HA
image
after a restart of HA:
image
All previous error messages have now disappeared from the log

Very strange. This shouldn’t happen, but it does :frowning:

Can you do the following?

  1. Change 0.6.1 to 0.6.2 in the manifest.json file in the custom component directory. This is the file; https://github.com/peternijssen/home-assistant-jumbo/blob/d9a5224c24c3bcb625decc9fef730f125493282e/custom_components/jumbo/manifest.json
  2. Enable debugging for the component and library like described here:https://github.com/peternijssen/home-assistant-jumbo#debugging

You will get something like this in the logs;

2021-01-04 22:37:13 DEBUG (SyncWorker_4) [jumbo_api.jumbo_api] Processing homeDelivery with id 2056134451 and status PROCESSING
2021-01-04 22:37:14 DEBUG (SyncWorker_4) [jumbo_api.jumbo_api] Processing homeDelivery with id 2056524180 and status OPEN
2021-01-04 22:37:14 DEBUG (SyncWorker_4) [jumbo_api.jumbo_api] Processing homeDelivery with id 2057480333 and status OPEN
2021-01-04 22:37:14 DEBUG (SyncWorker_4) [jumbo_api.jumbo_api] Processing homeDelivery with id 2057480390 and status OPEN
2021-01-04 22:37:16 DEBUG (SyncWorker_4) [jumbo_api.jumbo_api] Refresh of data performed at 2021-01-04 22:37:16
2021-01-04 22:37:16 DEBUG (SyncWorker_4) [custom_components.jumbo.sensor] Updated data from Jumbo

Furthermore if you get the error codes 5001 and 9004 again, please check if there is a next line including the reason. It should first log the error code followed by the reason for the error. I don’t know what 5001 and 9004 means.

Sorry for all the actions, I am unable to reproduce your problem locally :frowning:

Pickup time was today at 18:00. Status was before correct changed tot Processing.
After 18:00 the was a error in the log:

2021-01-08 17:27:03 DEBUG (SyncWorker_1) [jumbo_api.jumbo_api] Refresh of data performed at 2021-01-08 17:27:03
2021-01-08 17:27:03 DEBUG (SyncWorker_1) [custom_components.jumbo.sensor] Updated data from Jumbo
2021-01-08 17:42:00 DEBUG (SyncWorker_5) [jumbo_api.jumbo_api] Processing collection with id 2056489574 and status PROCESSING
2021-01-08 17:42:00 DEBUG (SyncWorker_5) [jumbo_api.jumbo_api] Processing collection with id 2057288058 and status OPEN
2021-01-08 17:42:00 DEBUG (SyncWorker_5) [jumbo_api.jumbo_api] Processing collection with id 2058275880 and status OPEN
2021-01-08 17:42:02 DEBUG (SyncWorker_5) [jumbo_api.jumbo_api] Refresh of data performed at 2021-01-08 17:42:02
2021-01-08 17:42:02 DEBUG (SyncWorker_5) [custom_components.jumbo.sensor] Updated data from Jumbo
2021-01-08 17:59:11 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.jumbo_pick_up fails
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 96, in create_connection
raise err
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 86, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 353, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f5a7205e880>: Failed to establish a new connection: [Errno 110] Operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 573, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='mobileapi.jumbo.com', port=443): Max retries exceeded with url: /v12/users/me (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f5a7205e880>: Failed to establish a new connection: [Errno 110] Operation timed out'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 482, in async_device_update
await task
File "/config/custom_components/jumbo/sensor.py", line 216, in async_update
await self._data.async_update()
File "/config/custom_components/jumbo/sensor.py", line 91, in async_update
await self.hass.async_add_executor_job(self._get_data)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/jumbo/sensor.py", line 95, in _get_data
self.basket = self._api.get_basket()
File "/usr/local/lib/python3.8/site-packages/jumbo_api/jumbo_api.py", line 196, in get_basket
self._update()
File "/usr/local/lib/python3.8/site-packages/jumbo_api/jumbo_api.py", line 62, in _update
self._update_profile()
File "/usr/local/lib/python3.8/site-packages/jumbo_api/jumbo_api.py", line 71, in _update_profile
response = self._request_update(PROFILE_URL)
File "/usr/local/lib/python3.8/site-packages/jumbo_api/jumbo_api.py", line 228, in _request_update
response = requests.request("GET", url, headers={**headers, **DEFAULT_HEADERS})
File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='mobileapi.jumbo.com', port=443): Max retries exceeded with url: /v12/users/me (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f5a7205e880>: Failed to establish a new connection: [Errno 110] Operation timed out'))
2021-01-08 18:12:00 DEBUG (SyncWorker_8) [jumbo_api.jumbo_api] Processing collection with id 2057288058 and status OPEN
2021-01-08 18:12:01 DEBUG (SyncWorker_8) [jumbo_api.jumbo_api] Processing collection with id 2058275880 and status OPEN
2021-01-08 18:12:02 DEBUG (SyncWorker_8) [jumbo_api.jumbo_api] Refresh of data performed at 2021-01-08 18:12:02
2021-01-08 18:12:02 DEBUG (SyncWorker_8) [custom_components.jumbo.sensor] Updated data from Jumbo
2021-01-08 18:27:00 DEBUG (SyncWorker_2) [jumbo_api.jumbo_api] Processing collection with id 2057288058 and status OPEN
2021-01-08 18:27:00 DEBUG (SyncWorker_2) [jumbo_api.jumbo_api] Processing collection with id 2058275880 and status OPEN
2021-01-08 18:27:02 DEBUG (SyncWorker_2) [jumbo_api.jumbo_api] Refresh of data performed at 2021-01-08 18:27:02
2021-01-08 18:27:02 DEBUG (SyncWorker_2) [custom_components.jumbo.sensor] Updated data from Jumbo
2021-01-08 18:42:00 DEBUG (SyncWorker_7) [jumbo_api.jumbo_api] Processing collection with id 2057288058 and status OPEN
2021-01-08 18:42:00 DEBUG (SyncWorker_7) [jumbo_api.jumbo_api] Processing collection with id 2058275880 and status OPEN
2021-01-08 18:42:02 DEBUG (SyncWorker_7) [jumbo_api.jumbo_api] Refresh of data performed at 2021-01-08 18:42:02
2021-01-08 18:42:02 DEBUG (SyncWorker_7) [custom_components.jumbo.sensor] Updated data from Jumbo

The log showed no errors for the past two weeks. Pickup was at 6:00 pm.


But when I look at the sensor now, I see that the update is at 2:03 PM. The time now is 9:00 PM.

Can you do something with this?

Sorry for the enormous delay. Life came in between. I made some changes which hopefully resolves your issue, although the last issue seems to be connection related.

0.7.0

I’ve released 0.7.0 today, which should pull in the ETA information when your order is close. The Jumbo app currently displays in which hour block they expect to come and when you get close to that moment, it gives an actual ETA when to arrive. @Jasper8472 I think this solves your request.

I’ve updated the README how to use it in automations and in the potential markdown card. I’ve to wait till Monday to see if it actually all works as expected.

That’s cool!

I’ve added the following line to my markdown card and will see what happens this Thursday / Friday:

{% if states('sensor.jumbo_delivery') == 'closed' %}
  De Jumbo verwacht tussen **{{ state_attr('sensor.jumbo_delivery', 'deliveries')[0].eta_start }}**(ETA Start) en **{{ state_attr('sensor.jumbo_delivery', 'deliveries')[0].eta_end }}**(ETA End), **{{ state_attr('sensor.jumbo_delivery', 'deliveries')[0].eta_live }}**(ETA Live) bij je te zijn!
  {% endif %}

I can guess what the eta_start and eta_end are but I don’t know what the eta_live will show. Curious what happens.

It’s never in a “closed” state, so probably won’t work :wink:
Correct state is “ready_to_deliver”. I will make sure to note all states in the readme file.

In regards to the ETAs. If you picked for example the time slot between 10:00 and 13:00, then start could be 11:00, end could be 12:00 and live could be 11:19. Live is updated regularly.

I only had a single experience with the app myself, so no clue yet if it works as expected in HA. Next Monday is my next delivery, so then I can debug. I also don’t know yet when the actual ETAs are communicated by Jumbo and if it’s rolled out in the entire Netherlands already.

Doh! Couldn’t find that state in my history, I corrected it. :slight_smile:

Ah that explains live.

We began to receive the ETA when our town shifted to distribution centre’s. Before the delivery was made by a local Jumbo. Orders where brought in from a central distribution centre and filled up by the local Jumbo. They then used their own car to deliver.

Eindhoven and area have now switched to a large distribution centre with the sole purpose of providing orders for deliveries. So ‘not local’ drivers now deliver the goods and the status updates now come from their main distribution centre, which is a different system.