[SOLVED] Help with sending Command

Great.
Thank you!
I will give it a try soon.

The link does not work
:frowning:

By the way.
Do you know if itā€™s possible to request the latest trip from VOC only instead of the entire history of trips?

No, Iā€™ve not looked at this right now, Iā€™m working on implementing actions toward the API

Weird, it was present :frowning: and is no more

Alright, thanks for your response.
Just lerne know if you have a new version ready to be tested.

Found it.
I just started testing your binding yesterday and could get back to you with my feedback, if you like.

Cool. Iā€™m currently extending it to add trip logs and actions (open, closeā€¦)
Will be ready quite soon. So if youā€™ve got feed-backs, youā€™re welcome.

trip information would be great!
I currently request the voc trips response and itā€™s running into timeout, because I just did too many trips :wink:

Let me know, when itā€™s ready.
I will keep you posted on my findings while testing.

Yes, this request is quite long. I suppose there exist a way to restrict the number of answers, but did not find it at the time

Hi,

I actually do not get all of the items updated:
It does work for some:

2018-09-12 08:47:41.429 [vent.ItemStateChangedEvent] - CarEngine changed from ON to OFF
2018-09-12 08:47:41.484 [vent.ItemStateChangedEvent] - CarOdometer changed from 26991059 to 27000098
2018-09-12 08:47:41.493 [vent.ItemStateChangedEvent] - CarTrip1 changed from 6958100 to 6967200
2018-09-12 08:47:41.503 [vent.ItemStateChangedEvent] - CarTrip2 changed from 7597800 to 7606900
2018-09-12 08:47:41.515 [vent.ItemStateChangedEvent] - CarFuelLeft changed from 450 to 405
2018-09-12 08:47:41.538 [vent.ItemStateChangedEvent] - Location_Car changed from 

The door and window contacts donā€™t update even though they are obviously linked correctly according to PaperUI.

My items are:

Contact CarDrHood 			"Motorhaube"                                (G_CarDoors)    {channel="volvooncall:vehicle:XXXXXXXXXXXXXXXXXX:doors#hood"}
Contact CarDrFrLeft			"TĆ¼r VL"   				                    (G_CarDoors)    {channel="volvooncall:vehicle:XXXXXXXXXXXXXXXXXX:doors#frontLeft"}
Contact CarDrFrRght			"TĆ¼r VR"   					                (G_CarDoors)    {channel="volvooncall:vehicle:XXXXXXXXXXXXXXXXXX:doors#frontRight"}
Contact CarDrReLeft			"TĆ¼r HL"   				                    (G_CarDoors)    {channel="volvooncall:vehicle:XXXXXXXXXXXXXXXXXX:doors#rearLeft"}
Contact CarDrReRght			"TĆ¼r HR"                                    (G_CarDoors)    {channel="volvooncall:vehicle:XXXXXXXXXXXXXXXXXX:doors#rearRight"}
Contact CarDrTrunk 			"Kofferraum"                                (G_CarDoors)    {channel="volvooncall:vehicle:XXXXXXXXXXXXXXXXXX:doors#tailgate"}

I suspect the problem to come from the usage of Contact items instead of switches - or - API to not report the actual value.
I saw that on your side, you previously used molobrakos volvooncall script to access this. Where door status correctly reported ?

Iā€™ve nearly finished the integration of trips (need a pass of code cleaning) and will be able to push an updated PR very soon.

You might be right.
I used switches and switched them in rules depending on the state of the doors in the Json response.

I guess you use contacts, because thatā€™s the typical item type for doors!?

Yes, I thought it would be better, but Iā€™m always troubled with contacts.
Will investigate.
PR updated a few minutes ago with trips and actions.
Action on the car are planned to be used via the new rule engine.

Bad bet, I made a test modifying API response for door opening and contacts works fine :frowning:
Have you checked if they render correctly in PaperUI with autogenerated items ?

Thanks for your prompt reply on this.
So, there must be something wrong here.

Whatā€™s weird is, that there seem to be no update in the eventlog.

What Do you exactly mean with autogenerated items?
I added the VOC Thing using Paper UI and used the channel addresses from this.
They seem to be linked correctly:

I guess a restart of the binding might be helpful.
But I will try your new one to check out the trip stuff and such.

Thanks for all your efforts you put into this.

I am trying to use your newly pulled version:

https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/binding/org.openhab.binding.volvooncall/2.4.0-SNAPSHOT/org.openhab.binding.volvooncall-2.4.0-SNAPSHOT.jar

But I am not able to start it:

I did not have issues with the previous one.

I suppose this comes because I introduced actions as Experimental Rules Engine elements. I does work in the dev environment, maybe I must change the target package. Iā€™ll have a look at this.

Thanks a lot.

Now I messed it up completely:
After retoring the previous VOC binding which used to work properly (except the contact / switch issues mentioned above), I get:

2018-09-13 09:54:10.077 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.volvooncall.handler.VolvoOnCallBridgeHandler@1bc5a10': java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:224) [22:com.google.gson:2.7.0]
        at com.google.gson.Gson.fromJson(Gson.java:887) [22:com.google.gson:2.7.0]
        at com.google.gson.Gson.fromJson(Gson.java:852) [22:com.google.gson:2.7.0]
        at com.google.gson.Gson.fromJson(Gson.java:801) [22:com.google.gson:2.7.0]
        at com.google.gson.Gson.fromJson(Gson.java:773) [22:com.google.gson:2.7.0]
        at org.openhab.binding.volvooncall.handler.VolvoOnCallBridgeHandler.getURL(VolvoOnCallBridgeHandler.java:140) [247:org.openhab.binding.volvooncall:2.4.0.201808261138]
        at org.openhab.binding.volvooncall.handler.VolvoOnCallBridgeHandler.initialize(VolvoOnCallBridgeHandler.java:98) [247:org.openhab.binding.volvooncall:2.4.0.201808261138]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
        at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [101:org.eclipse.smarthome.core:0.10.0.oh230]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [101:org.eclipse.smarthome.core:0.10.0.oh230]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
        at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
        at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385) ~[?:?]
        at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:213) ~[?:?]
        ... 16 more

I did a complete restart and reboot - but the error is still the same.

I also removed the Things API and the vehicle and created them new in PaperUI.
No change either.

EDIT:
I cannot even connect to the server using the voc from github:

/usr/local/bin/voc -u 'xxx' -p 'xxx' status

ā€“>

Could not connect to the server.

EDIT 2:
I deleted the Things (API & Car), uninstalled the VOC binding, did a restart of OH, copied back the VOC binding and created the Things again.
Both issues were solved (I can connect to the server by the voc script and am able to get the API in OH online.)

I donā€™t have a clue why the script connection did not work thoughā€¦