Page 6 of 6

Re: Traffic with waze in Domoticz

Posted: Friday 28 July 2017 17:52
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 :(

Re: Traffic with waze in Domoticz

Posted: Thursday 10 August 2017 9:34
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

Re: Traffic with waze in Domoticz

Posted: Thursday 10 August 2017 13:58
by Podarcis
+1! Great find. Now my lua script is working again!

Thanks!

Re: Traffic with waze in Domoticz

Posted: Wednesday 13 September 2017 13:53
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

Re: Traffic with waze in Domoticz

Posted: Wednesday 13 September 2017 17:10
by JuanUil
great adonn

Re: Traffic with waze in Domoticz

Posted: Wednesday 26 September 2018 15:25
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

Re: Traffic with waze in Domoticz

Posted: Saturday 26 October 2019 10:17
by krizzz
Sae request here, nobody using the script anymore?

Re: Traffic with waze in Domoticz

Posted: Tuesday 05 October 2021 14:38
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

Re: Traffic with waze in Domoticz

Posted: Tuesday 05 October 2021 20:37
by zicht
looks like the json/api is changed, but no clue how to correct the script yet

Re: Traffic with waze in Domoticz

Posted: Wednesday 06 October 2021 19:41
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'];

Re: Traffic with waze in Domoticz

Posted: Thursday 07 October 2021 21:04
by zicht
I don't know which script you are using but in my PHP script I had to change:
thank you !