I think your best bet will probably be to use the Exec binding to issue a curl command. If you search the forum for âcurlâ I think you will see several examples of people using curl in this way.
The HTTP binding can only do GET so it wonât work.
Although you may not need any of the X- headers or some others. If running that at a command line turns on your Volvoâs heater, you could then add it as an item using the exec binding:
Group Volvo
Location VolvoPosition (Volvo) { exec="<[/home/openhab/volvoposition.sh:60000:JS(volvoposition.js)]" }
Number VolvoDistanceFromHome "distance from home [%.0f m]" (Volvo)
In your sitemap, if you have Group item=Volvo, its contents will contain a map of the Volvoâs location on the Classic UI. Other clients can show a map and there is a wiki page about customizing your own.
You can also calculate the distance in meters from another point in a rule:
import org.openhab.core.library.types.*
rule DistanceFromHome
when
Item VolvoPosition changed
then
val PointType home = new PointType("xxxx,yyyy")
VolvoDistanceFromHome.postUpdate(home.distanceFrom(VolvoPosition.state as PointType))
end
Error during the execution of rule âDistanceFromHomeâ: Cannot cast org.openhab.core.library.types.StringType to org.openhab.core.library.types.PointType
I am interested as well, I found your post last Tuesday, then I could retrieve info from my car.
On Thursday I tried again but the site give a 500 error.
type: Status report
message: InvalidInputCriteria
description: The server encountered an internal error (InvalidInputCriteria) that prevented it from fulfilling this request.
I based on your post the site is still up, any idea what goes wrong?
I donât know how to use the API youâre interacting with. What do its API docs say? curl allows command-line parameters with user name and password, but whether the API youâre using accepts that form is a question in need of research.
I found a python repository that allows to easily query status. I tried adding the post into it, but couldnât get it to work. Anyone with Python experience? Any thoughts why using a simple post wonât work?
Not yet, I just created 6 different scripts (lock/unlock/climate on/climate off/blink/honk). My python is so bad, I couldnât create it myself - I therefore requested it from the original developer, but not sure whether he will implement it
@nikagl Hi there - Where you able to push the VOC a bit further? My wife is in the process of buying an XC90, and well, I have no saying in all of that except the integration bit with openHAB
@kgoderis Hi Karel, I donât do any OpenHAB development, I just responded to this thread because it contained some hints on how to use the vocapi⊠check out the github and try to use whatever you find to add things to openhab (and ask openhab developers to actually add it). In my case I use Homeseer and simply created a vbscript that calls the Python Script and parses the status to add the status to virtual devices in Homeseer⊠(or turn on the heater / lock the car based on events in homeseer)
@nikagl did you discover some more elements apart from what is published on the various webpages on the subject?
too bad it is not reporting the state of the gearbox. That would be very helpful in my case (I use that on my Tesla to control the open/close of the gate). Also, it the VOC a polling-only service, or is there a subscription mechanism to get events as they happen in the car?
Thereâs much more status you can get from the vocapi than communicated from the app, but I donât think Iâve seen something about gearbox. You could use the location parms (long/lat) to open the gate? I query the status periodically but havenât yet thought of some event that I could use depending on the status of something in the car (I donât have a gate - I could turn on the lights in the house though)⊠I donât think it works subscription based, although the app must do it somehow, maybe they use Google Firebase Cloud Messaging (FCM) and Apple Push Notification (APN) services?