Lyft Sensor - Help with Template Creation & Multiple End Latitude/Longitude Coordinates

My Current Lyft Sensor Configuration

- platform: lyft
  client_id: !secret lyftclientid
  client_secret: !secret lyftclientsecret
  start_latitude: !secret lyftstartlatitude
  start_longitude: !secret lyftstartlongitude
  end_latitude: !secret endlatitudelyft
  end_longitude: !secret endlongitudelyft
  product_ids:
    - 'lyft'

My Configuration Repository

What I’d like to do

  • How can I have more than 1 dropoff (end_latitude & end_longitude)? I’d like to have both my work & my fiancée’s office locations available, both starting from our apartment.
  • Instead of showing as two line items I’d like it to display something along the lines of Lyft to Brian's Work - 2 Minutes, $16 or something similar.

Any tips to achieve either of these items?

Thanks!

This is a great idea. The Google Maps Travel Time component accepts dynamic inputs (zones, lat/lon, device locations, etc): https://home-assistant.io/components/sensor.google_travel_time/

I don’t think it’s possible through the config - the component will need to be modified. I can’t imagine it would be too difficult - you could give it a shot or message the author and request it.

Ok, trying to jump back into the creation of this template to combine the two Lyft sensors into a single sensor display.

As things stand right now it displays like this which is far from ideal:

I’d prefer it to show something like this:

Lyft From Home to Work - 16 USD, available in 2 minutes, estimated duration 20 minutes.

When I view the sensor.lyft_price entity the state displayed is 16.28, the price in dollars. However, there are all of the attributes I really need in the sensor.lyft_price if I include the sensors state attributes seen below.

I started to try to try and produce a template and check it in the template editor in Home Assistant and am having trouble getting to what I want to display as the template editor is showing me all of the state attributes, not just the price and time until a vehicle is available using the template below.

TEMPLATE

- platform: template
  sensors:
    lyft_home_to_kinna_work:
      friendly_name: "Lyft From Home to Kinna's Work"
      value_template: "{{ states.state.sensor.lyft_price }}, {{ states.sensor.lyft_time }}"

TEMPLATE EDITOR OUTPUT

- platform: template
  sensors:
    lyft_home_to_kinna_work:
      friendly_name: "Lyft From Home to Kinna's Work"
      value_template: ", <template state sensor.lyft_time=2; Pickup time estimate (in seconds)=120, Trip distance (in miles)=8.16, icon=mdi:taxi, Trip duration (in seconds)=1628, Cost per minute=20, Prime Time percentage=0%, Service fee=160, Product display name=Lyft, Low price estimate (in cents)=1656, Minimum price=300, Vehicle Capacity=4, friendly_name=Lyft time, High price estimate (in cents)=1656, Cost per mile=95, Price currency code=USD, unit_of_measurement=min, Cancellation fee=500, Base price=170, Product ID=lyft @ 2017-11-10T14:24:45.433956-06:00>"

If someone can provide some guidance as to how I can achieve my goal of displaying the information together it would be greatly appreciated!

GOAL DISPLAY

Lyft From Home to Work - 16 USD, available in 2 minutes, estimated duration 20 minutes.

Thank you for your help!

Solved with some help from @skalavala & @briancribbs on Discord!

image

Still need to cleanup the duration display a bit, however, this is 99.9% of the way there.

Thanks!

1 Like