Google Maps widget with traffic

Fantastic widget !

Would love to see it done with WAZE - though I’m struggling a bit to get there. I’m a total noob in coding and fully relying on other people’s work witch I then try to convert- the trial and error road, is a bit like Tour de France :upside_down_face:

WAZE have an advantage in “right now “ happening on the roads due to other users on the road who can send “as is “ messages to the server/ other users. Where maps seems to depend on statistics… funny since they are both in the google family…

Google maps depends on statistics but is also “real time” and has far more real time data going into it than waze.

You could probably just display the live map in an iframe. More info

I’m aware of that google maps also use real-time data. The thing is that the so-called real time at maps is depending on many users where one single wazer who report at stand still or any other incidents, that report will show up on my map… That feature is second to none when dealing with rush hour traffic. So where I now check the app when in car I would love to get an update with coffee in hand in the kitchen. :wink:

wahay… that would be the thing…
can’t be that hard to find a widget that could be modified-or maybe it’s now where I try starting from scratch … thanks for the heads up !

Exactly; see here:

Great contribution, thanks.
Made me go grab a new Google Maps API key. They implemented a new policy where you have to give your CC details… They say no payment is required for normal personal use.
Will see.

Hi Guys,

Mine just stopped working the other day and I didn’t change a thing.
Do you know if you will have to agree with some new policies in order for the api key to work again?
I can see that @ngalfas mentions something about credit card information?

Hi guys,

after some hours of troubleshooting I have no idea why it is not working.

2018-08-27 16:43:54.661 [WARN ] [ab.binding.http.internal.HttpBinding] - Transformation 'JSONPATH($.rows[0].elements[0].duration_in_traffic.text)' threw an exception. [response={

   "destination_addresses" : [],

   "error_message" : "This API project is not authorized to use this API.",

   "origin_addresses" : [],

   "rows" : [],

   "status" : "REQUEST_DENIED"

}

]

org.openhab.core.transform.TransformationException: Invalid path '$.rows[0].elements[0].duration_in_traffic.text' in '{

   "destination_addresses" : [],

   "error_message" : "This API project is not authorized to use this API.",

   "origin_addresses" : [],

   "rows" : [],

   "status" : "REQUEST_DENIED"

Did everything as per manual, also got a google cloud platform account with the API Key for Google Maps JavaScript API and checked that everything is correct. Any ideas?

Many thanks,
Henning

Oh btw I “Authorized” it from my point of view by enabling the API in GCP and also there are no restrictions in place.

How is your API Usage with the new pricing model?

Do you overstep the free credit?

Thanks this works great for me!
However, it only worked with exact coordinates for me, I couldn’t enter specific postal address.

Do you exceed the free API calls? How often does this refreshes?

Ps.: In the widget the labels (where in your screenshot there is avg duration, etc seen), for me only shows false… The values are seen just the labels not…

You have to be a biut carefull not to go over the free tier for Maps API calls. I had 4 routes being polled with the 30000 refresh interval and that resulted in over 30000 API calls which is above the 20000 free threshold (was still temporary free because of some free credit). So to keep it safe I would limit it to two routes or adjust the polling interval. (I might even adjust it depending on the time of day).

I haven’t started using the HABPanel on a daily basis, I’m just started building it (and the wall tablet for it), but the main idea for me was to have a morning dashboard which will be only displayed in the morning. It seems when you don’t have it running in the foreground, it won’t do any api call

No, the items defined http request will run 24x7. So be carefull how you set the interval.

Where I can set the interval?

In the items file definition file. Please read the first post @ ’ Travel time widget’. You will see an explination of the interval. In the example its set to 300000, which is in miliseconds. (5 minutes).

ohh sorry :slight_smile: I’m talking about the actual widget and that seems that don’t really use the API if you don’t display the actual dashboard with the map

Ah ok, yes thats correct. The browser retrieves that, so when browser sleeps no requests are made.

However I’m still has this ‘false’ labels on the map. Maybe it somehow connected to regional things or I don’t know, maybe someone could help me with this?
Screenshot%20(51)