I’m new here, having looking at different automation softawre the last month and decided to give openhab a try.
It seems everything i need exists or is possible, but i could not find any Waze add-on.
The purpose of this is to have a tile on the dashboard that shows the travetime to work ie.
It uses Waze API, and based on 2 locations (coordinates) is calcutes the travel time.
Hoe assistant and Jeedom have this pugin, it seems very handy…
I know of no one working on this but integration would be very simple. Looking at the Home Assistant code it looks like it depends on WaxeRouteCalculator.
You could do it also using the executeCommandLine Action in a Rule but I don’t think that is necessary in this case.
Changing the Thing and the Python script so you can pass in the start and end destination is an exercise left to the student, but it is not challenging.
Someone with some time and ambition could probably look at the Python library code and implement something using just the HTTP binding or create a native binding. It doesn’t look hard.
Thank you for your fast reply and detailled information.
Unfortunatly, i just installed Openhab and trying to understand how it works. I’m not a programmer so your post i already a little to complicated for me (at the moment at least).
I think it could be a nice addition to the already large add-on library of Openhab if someone could make a plugin for this.
I hope some experienced people will read this post and try to figure out.
Maybe i will be able to help in the coming weeks/months…
After you get a bit of experience with OH under your belt, come back here and have a new look. It is actually really easy to get working with the above once you know the difference between a Thing and an Item in OH and all the important little details like that.
This script peeked my interest so I wanted to see if I could tie it into my dashboard.
I’m running OH on a Windows Platform and when I save my THINGS file I receive the following errors in the OH log.
018-10-11 15:48:19.584 [ERROR] [hab.binding.exec.handler.ExecHandler] - An exception occurred while executing 'C://PROGRA~1//Python37//Lib//site-packages//WazeRouteCalculator//BYPRoute.py' : 'Cannot run program "C://PROGRA~1//Python37//Lib//site-packages//WazeRouteCalculator//BYPRoute.py": CreateProcess error=193, %1 is not a valid Win32 application'
I can execute the script if I go to the directory, it will run and report back the correct time and distance of the route.
In trying to debug the issue, I ran across a post on Stack Overflow which seems to offer the answer for the problem..
The file you are attempting to load is not an executable file. CreateProcess requires you to provide an executable file. If you wish to be able to open any file with its associated application then you need ShellExecute rather than CreateProcess .
So the question is…how to I do a ShellExecute in the Exec Thing or do I need to do it another way???
So I changed the items type to NUMBER and my items look like this..
Number BYPRoute_Data "Travel Time To BYP [%.0f Minutes]" { channel="exec:command:BYPRoute:output" }
Number HomeRoute_Data "Travel Time Home [%.0f Minutes]" { channel="exec:command:HomeRoute:output" }
If I look at the items in HabPanel they display correctly…
My OH installation is on Windows so I needed to show a full path to the executable first, depending on your OS you may need to adust.
waze.items
Number BYPRoute_Data "Travel Time To BYP [%.0f Minutes]" { channel="exec:command:BYPRoute:output" }
Number HomeRoute_Data "Travel Time Home [%.0f Minutes]" { channel="exec:command:HomeRoute:output" }
Please note I am still having an issue with the time displaying on my sitemap…it is working fine in HABPabnel.
@KidSquid - you have Number Items there. Does this work for you? You’re using Windows? I am on RPi and Number Items do not work. String - OK. Numbers - all null.
I’m having an issue with BasicUI, but the data displays in HabPanel. If you look up a couple of posts you’ll see I mentioned this and was wondering why it worked in one and not in the other.
Originally it was a String item, but I wanted more formatting flexibility so Rick suggested that o switch it to a Number item. I’m hoping someone can offer some insight.