Uber arrival automation

I would love to be able to create automations based on an Uber that is soon to arrive. I have noticed that IFTTT has options for it using particular devices such as Hue, but I don’t have Hue and would prefer direct HA integration anyway. Preferably an expansion of the current Uber component.

Is this a possibility? Has anyone done something similar ? A search on here didn’t give me anything.

I second this, support for uber eats would be handy too,

eg. turns on external lights when food is arriving

I added the Uber sensor, just so i could turn on lights when uber arrived and send to google_say. This would be an awesome feature.

Hopefully a Guru can add this option.

I’ve managed to cobble together a working Uber Eats sensor! I’ll eventually post in “Share Your Projects” once I make it less hacky and brittle. (Though I’m a bit worried about UE catching wind and changing their underlying API).

But in the meantime, I have Alexa telling me when the order is being prepared, when it’s being picked up, out for delivery, almost there, and completed! Along with a neat little (also hacky) lovelace card showing me the restaurant thumbnail, courier photo, and ETA.

5 Likes

could you release this rough version anyway ? i’d appreciate to know how you implemented it!
thanks

Here you go! Let me know if you get it working or experience any issues.

2 Likes

My Uber Eats Orders Sensor (pre-alpha rough cut).

(Apologies to @sparkydave for hijacking the thread. This doesn’t solve your Uber driver arrival problem. But I’m sure it could be modified easily to support that platform as well).

Feel free to try out my pre-alpha Uber Eats Sensor here. Let me know if you get it working or experience any issues.

2 Likes

Hey @donkawechico,
I haven’t been able to test it yet (haven’t ordered anything!), but I was reading the code that decides between AM/PM for the timestamp, and I think there’ll be issues with lunch time orders.

The decision to offset 12 hours is based on the current time, not the delivery time. This will be an issue when for example, it’s 11:50 am, and the ETA is 12:05 pm. Your value template won’t add the 12 hours, and will instead return 12:05 am.

Would a better solution be to compare the two times (now and ETA)? If assuming the ETA is am would result in a time before now (or say earlier than 1 hour before now, to allow for late deliveries), then assume it should be PM.

I wonder if there’s also a similar issue for midnight/after midnight ETAs? I guess in that case you’d want to add 24 hours?

Ha, yes. I knew about the bug… and yet did nothing. This is my shame. :weary: (also had such a hard time figuring out how to work with timestamps at all that I just kinda stopped at the 98% case)

I’ll see if I can fix that edge case. In the meantime, if you figure it out first please post your solution on the gist and I’ll add!

Happy 2021!

I still haven’t managed to get this working successfully (I only just had another go, but adding the userUID to the cookie today). Is it still working for everybody else as is?

I find that it just never seems to return any data to the sensors, and I haven’t known how to debug the process. I found out how to issue a POST today and get the result, which is something. But by the time I got it working my delivery had arrived, and it just returned an empty array or orders. Hopefully adding the UUID did the trick, and I’ll see some data next time we put an order in.

FWIW, mine hasn’t worked for awhile now (and I made the danged thing :stuck_out_tongue: ). I also tried adding the uuid and it didn’t immediately work.

But I haven’t devoted any serious time to getting it working again, maybe 10 minutes tops. I think the next time I work on this, it will be to make a formal core integration.

1 Like

If you do ever get back to it, I’m happy to act as beta tester.

Same, I’m gonna try setting this up this week and see if it works soon.

1 Like

Update, I followed the docs and I can’t restart my home assistant now because receiving this error:

And here is the file, just like the docs:
This is the error as you can see: “Property uber_eats_has_new_order is not allowed.”

And my configuration.yaml:

Screen Shot 2022-03-22 at 8.33.36 PM

Great. Used it as a base to get this going.

Delivery was done so no active info when I made the screenshot. Still last location was up on map.

- platform: rest
  name: Uber Eats Orders JSON
  json_attributes:
    - uuid
    - feedCards
    - backgroundFeedCards
    - activeOrderOverview
    - contacts
  json_attributes_path: "$.data.orders[0]"
  resource: https://www.ubereats.com/api/getActiveOrdersV1?localeCode=nl-en
  method: POST
  headers:
    Content-Type: application/json
    X-CSRF-Token: x
    Cookie: '_userUuid=YOUR__USERUUID_HERE; sid=YOUR_SID_HERE'
  payload: '{"timezone": "Europe/Amsterdam"}'
  force_update: true
  value_template: '{{ value_json.data.orders[0].feedCards[0].status.currentProgress }}'

and then add these to your sensor.uber_eats_order Text

        latitude: >-
          {{ state_attr("sensor.uber_eats_orders_json", "backgroundFeedCards")[0].mapEntity[0].latitude if not is_state("sensor.uber_eats_orders_json", "unknown") else "N/A" }}
        longitude: >-
          {{ state_attr("sensor.uber_eats_orders_json", "backgroundFeedCards")[0].mapEntity[0].longitude if not is_state("sensor.uber_eats_orders_json", "unknown") else "N/A" }}

That will give you location of your current order in the sensor.uber_eats_order

4 Likes

Nice work!
Could you please post your functioning code?

As you can see, above a few of us had issues with the original code generating errors.

This is incredible! Would love a full blog post on this if you’re down

1 Like

Done! :+1:

1 Like

How did you create a camera that changes based on the courier? I think that is awesome