Okay, I hate doing this, but can someone explain how we pull multiple rows/destinations out of the waze component? the waze sensor only contains a single origin and destination. But this card pulls multiple locations out of the waze component? I’ve spent a while trying figure out exactly how to do this, (and read a ton), but I just can’t wrap my head around how the waze sensor gets to the love-lace ui and populates multiple fields in that card.
So im thinking that the waze platform can’t apply to 2+ routes, because it already has the origin/destination in it. Which would mean that I’d need to create multiple platforms, like _waze_travel_time_home, or something like that? but I thought the platform was somehting called on, not just created out of thin air. I guess i’m just looking for some clarification if possible? I’ve looked through all of the lovelace docs and HA docs I could find, and I honestly just cannot figure out how this works. I’m seriously lost, and this would appreciate any advice/guidance/tips I can get. Thanks!
Waze component template is this:
# Example entry for configuration.yaml
sensor:
- platform: waze_travel_time
origin: Montréal, QC
destination: Québec, QC
region: 'US'
You can add multiple waze components to your configuration.yaml file: The sensor name will be “sensor.commute_to_home” and “sensor.commute_to_work” based on the example below. Hope this helps.
sensor:
- platform: waze_travel_time
name: Commute to Home
origin: zone.work
destination: zone.home
region: 'US'
- platform: waze_travel_time
name: Commute to Work
origin: zone.home
destination: zone.work
region: 'US'
What about the “zone” that’s required for each entity in lovelace? It says “The zone to map the route with”. But each entity in the configuration file already has an origin and destination. I don’t understand why anything further in terms of location is needed if we already have a beginning and end-point? What should I put there?
Quick question. I think I know the answer, but should this open waze on an iPhone? It does go to waze on a PC running chrome, when I click on the directions, but not on iPhone.
I’m also a little confused about the zone requirement. My waze sensors have a starting and ending zone already. Actually for me I use a device tracker for the starting zone. I’ve changed the zone a bit, and it does not change the time, route or distance, but it does change where waze map opens up to when I click on the directions link in a browser.
I live in the UK and here we are still a little conflicted about units of measurement. Yes we are metric in most things so my config specifies that but for distances or in fact anything to do with our roads we are still stubbornly very much Imperial.
Is it possible to include an option in your card to specify unit of measurement as I’d like the distances in miles?
Secondly, I also wonder what the zone parameter is actually for?
EDIT: Ah! Is it used for when you click a route and go to the Waze app?
This is a great card - thanks.
Hmm, on Chrome on a PC it opens waze, on my Iphone 8s (current os), it does nothing, well it seems to acknowlede that I clicked, but nothing opens. I even changed the card to just a single route to be sure. Here is my lovelace
I did put the js in a different folder, but have the correct path
In the HA iOS app, in settings and General Settings, do you have Open links in a chrome turned on? I just turned it on and the Waze card stop responding. Turning it off and the card started working again opening up the Waze app.
Glad it’s working. I don’t use Chrome much, so I have turned that option off long ago and forgot about it, and for some reason it popped in my head so I thought I’d try and see.
Sometimes it’s the simplest little thing that has you going insane pulling your hair out.
I just noticed that all of my distances are in km, vs miles. The waze sensor shows km too, but I never noticed until I started using this card.
Looking at the java script
/**
* computes the distance for a route for metric/imperial system
* @param {Object} state the card state
* @return {string} the formatted distance
*/
computeDistance(state){
let distance = state.attributes && state.attributes.distance || 0;
if(this._hass.config.unit_system.length !== 'mi') distance = distance * 1.60934;
distance = parseFloat(Math.round(distance * 100) / 100).toFixed(2);
distance = `${distance}${this._hass.config.unit_system.length}`;
return distance;
}
It looks like it should have converted to miles, right? I’m no programmer, but the logic seems sound. Am I missing something in my config. I’m set up for imperial
I am in the US, and I agree, my waze sensor is showing km. It was not until I put this into the waze card where I really noticed. I was going to look at the .js and see if I could just do some math on the distance, but then it looked like it was already going to do that for me, but did not for some reason.
I see some confusion on the zone config option. This is to enable click to open waze functionality as the waze sensor doesn’t give me the coordinates needed to generate the URL to open waze automatically. I updated the card to make zone option optional and updated the read me to make the config clearer.
I also tried updating some distance stuff. I think the waze sensor isn’t giving a consistent measurement unit but I can’t tell what makes the waze sensor change units. I’ve reached out to the developer to see if he knows.
That means the waze card is not finding one of the zones you set in the config. I’ll have to update these error messages so it can be easier to debug. Make sure you have the correct zone name and they are working in the states table.
I am having an odd issue. Im not sure if its related to the card or the component itself, but of the 5 routes I have set up, only one or two will show information at a time. Sometimes one works, and another doesnt, and then it just magically switches to where a different one works and the one that was previously working has stopped. Any ideas?