Traffic with waze in Domoticz

Moderator: leecollings

DomoHouse
Posts: 7
Joined: Thursday 03 November 2016 11:53
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Netherlands
Contact:

Re: Traffic with waze in Domoticz

Post by DomoHouse »

Yes, I have got exactly the same issue. Not sure whether Waze is blocking my IP address or that they have disallowed the usage of this feature :(
MarceldeJongNL
Posts: 43
Joined: Tuesday 03 May 2016 10:07
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.5108
Location: Barendrecht
Contact:

Re: Traffic with waze in Domoticz

Post by MarceldeJongNL »

DomoHouse wrote: Friday 28 July 2017 17:52 Yes, I have got exactly the same issue. Not sure whether Waze is blocking my IP address or that they have disallowed the usage of this feature :(
Just found out they made an extra check for the ""api""

I fixed my problem with information from here

You have to fake the referer url. I changed the row:

Code: Select all

local waze=assert(io.popen('curl  "https://www.waze.com/r...".')

to:

Code: Select all

local waze=assert(io.popen('curl --referer https://www.waze.com "https://www.waze.com/r...."')
And all is fine again
Hardware: Raspberry Pi 2B | RFXCOM RFXtrx433E v1 | Synology DS213+ | KaKu Clones | Conrad RSL switches | KAKu Doorbell Clone | USB Webcam | ICY Thermostat | Resol DL2 | Imatic Relay Board | Eminent 6230 | Eminent 6220 | iMatic 16 ports Relay Board
Podarcis
Posts: 7
Joined: Sunday 26 April 2015 18:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Traffic with waze in Domoticz

Post by Podarcis »

+1! Great find. Now my lua script is working again!

Thanks!
pimseb
Posts: 42
Joined: Wednesday 13 September 2017 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: France
Contact:

Re: Traffic with waze in Domoticz

Post by pimseb »

Hello,

I'm sorry I've followed the howto of lemassykoi but I'm getting this error :

2017-09-13 13:42:30.717 LUA: >> Monitoring Traveltimes
2017-09-13 13:42:30.718 LUA: >> Debug is set to: Y
2017-09-13 13:42:30.718 LUA: >> Update timeout: 600
2017-09-13 13:42:30.718 LUA: >> Lastupdate Home to Work : 5934
2017-09-13 13:42:30.718 LUA: >> Lastupdate Work to Home : 5922
2017-09-13 13:42:31.033 LUA: ========================================================================================================
2017-09-13 13:42:31.033 LUA: { "error" : "Internal Error"}
2017-09-13 13:42:31.033 LUA: ========================================================================================================
2017-09-13 13:42:31.034 Error: EventSystem: in script_time_Waze.lua: [string "-- script_time_Waze.lua..."]:99: attempt to index field 'response' (a nil value)

EDIT :

I changed the value work to home to their french translations and forgot to change the value in the script
JuanUil
Posts: 497
Joined: Friday 22 May 2015 12:21
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.11083
Location: Asten NB Nederland
Contact:

Re: Traffic with waze in Domoticz

Post by JuanUil »

great adonn
Your mind is like a parachute,
It only works when it is opened!

RPI4 several Fibaro, KaKu, Neocoolcam switches, Z-Wave, Zigbee2Mqtt, Ikea bulbs and remote, Zigbee temp nodes
pimseb
Posts: 42
Joined: Wednesday 13 September 2017 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: France
Contact:

Re: Traffic with waze in Domoticz

Post by pimseb »

Hello
I've reinstalled domoticz and lost all my files.
Is there still somebody here still using this script ? I've tried the bash script but I can't make it work.
I have a forbidden error
Thank you
krizzz
Posts: 200
Joined: Wednesday 20 November 2013 20:36
Target OS: Linux
Domoticz version:
Location: The Netherlands
Contact:

Re: Traffic with waze in Domoticz

Post by krizzz »

Sae request here, nobody using the script anymore?
Kangooroo42
Posts: 8
Joined: Wednesday 23 October 2019 8:41
Target OS: Windows
Domoticz version:
Contact:

Re: Traffic with waze in Domoticz

Post by Kangooroo42 »

Hello,
I got this error since 2 days:
Error: EventSystem: in Waze: [string "..."]:38: bad argument #1 to 'for iterator' (table expected, got nil)

it seems to be a problem on line 38
for response,results in pairs(route) do

anyone has an idea ?
thx
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Traffic with waze in Domoticz

Post by zicht »

looks like the json/api is changed, but no clue how to correct the script yet
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
Joep123
Posts: 56
Joined: Monday 26 March 2018 18:44
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Traffic with waze in Domoticz

Post by Joep123 »

zicht wrote: Tuesday 05 October 2021 20:37 looks like the json/api is changed, but no clue how to correct the script yet
I don't know which script you are using but in my PHP script I had to change:

Code: Select all

foreach($traffic['response']['results'] as $street) {
into

Code: Select all

foreach($traffic['response'][0]['result'] as $street) {
and

Code: Select all

$time = $time + $street['crossTime'];
into

Code: Select all

$time = $time + $street['cross_time'];
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Traffic with waze in Domoticz

Post by zicht »

I don't know which script you are using but in my PHP script I had to change:
thank you !
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest