Binding for Robonect not working with Examples from Binding Site

The Robonect Binding has in its examples a channel for job.

{ channel="robonect:mower:automover:job", "remoteStart=REMOTE_1", "afterMode=AUTO", "duration=60" }

First: This channel trows an Error:

mismatched input '"remoteStart=REMOTE_1"' expecting RULE_ID
mismatched input '"afterMode=AUTO"' expecting RULE_ID
mismatched input '"duration=60"' expecting RULE_ID

If trying to Link Item in PaperUI the duration is limited to 60
The robonect can take jobs with much more minutes, for example 180 (cutting gras ca. 90 Minutes, reloading an hour, cutting again für 90 Minutes, reloading, then during reloading stopping job)

Any idea whats wrong with the channel if configured like in example?
Can anyone change to new API Version?

Find another Error: While uninstall and reinstall robonect Binding Snapshot Build 1544 openhab.log shows warning:

2019-03-02 21:55:52.905 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NoSuchFieldError: SECOND
	at org.openhab.binding.robonect.internal.handler.RobonectHandler.refreshMowerInfo(RobonectHandler.java:253) ~[?:?]
	at org.openhab.binding.robonect.internal.handler.RobonectHandler.access$1(RobonectHandler.java:241) ~[?:?]
	at org.openhab.binding.robonect.internal.handler.RobonectHandler$MowerChannelPoller.run(RobonectHandler.java:411) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:?]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[?:?]
	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) [?:?]

Some Items got actualized, some others don’t.

According to the docs your channel definition has the wrong syntax:

{channel="robonect:mower:automower:job",remoteStart=REMOTE_1,afterMode=AUTO,duration=60}

Mismatched Input expecting rule string.

I tried that before, should have say that

Unfortunately I cannot help but confirm that I got the same problem. Tested both options and none of them is working.

did you found a solution? I’m having the same issue with the mowerOneHourJob Example

Try { channel="robonect:mower:automover:job", remoteStart="REMOTE_1", afterMode="AUTO", duration="60" }

exactly what i have. but this leads to the following error:

2020-03-30 11:23:38.559 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.robonect.internal.handler.RobonectHandler@58b5976c': Name is null
java.lang.NullPointerException: Name is null
	at java.lang.Enum.valueOf(Enum.java:236) ~[?:1.8.0_232]
	at org.openhab.binding.robonect.internal.model.cmd.ModeCommand$Mode.valueOf(ModeCommand.java:1) ~[?:?]
	at org.openhab.binding.robonect.internal.handler.RobonectHandler.handleJobCommand(RobonectHandler.java:140) ~[?:?]
	at org.openhab.binding.robonect.internal.handler.RobonectHandler.sendCommand(RobonectHandler.java:127) ~[?:?]
	at org.openhab.binding.robonect.internal.handler.RobonectHandler.handleCommand(RobonectHandler.java:87) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_232]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_232]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
	at com.sun.proxy.$Proxy796.handleCommand(Unknown Source) [?:?]
	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74) [bundleFile:?]
	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_232]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_232]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_232]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_232]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_232]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]

Hi, I have exactly the same problem with the mowerOneHourJob example. Can someone please tell me how to trigger the mower to the end-of-day mode?

I do completely without binding Robonect:

// Job Items
Switch    Basis            "go Home (dauerhaft)"                     (gR40)  { http=">[ON:GET:http://<IP>/xml?cmd=mode&mode=home&user=<User>&pass=<password>]" }
Switch    Auto             "nach Zeitplan mähen (auto)"              (gR40)  { http=">[ON:GET:http://<IP>/xml?cmd=mode&mode=auto&user=<User>&pass=<password>]" }
Switch    Eod              "Feierabend (für heute)"                  (gR40)  { http=">[ON:GET:http://<IP>/xml?cmd=mode&mode=eod&user=<User>&pass=<password>]" }
Switch    Job1             "Job 1x mähen (90 Min."                   (gR40)  { http=">[ON:GET:http://<IP>/xml?cmd=mode&mode=job&duration=110&user=<User>&pass=<password>]" }
Switch    Job2             "Job 2x mähen (ca 4 Std.)"                (gR40)  { http=">[ON:GET:http://<IP>/xml?cmd=mode&mode=job&duration=270&user=<User>&pass=<password>]" }
Switch    Error_Reset      "Fehler zurücksetzen"                     (gR40)  { http=">[ON:GET:http://<IP>/xml?cmd=error&reset&user=<User>&pass=<password>]" }

Please look to change IP, user and password

to your own values, without <> :wink:

Cool thanks a lot, sometimes it is so easy that you just don’t see it :wink:

Hi Jens, thanks a lot! I just checked out all commands which can be transformed using XPath depending on the needs:
battery
clock
door
error
exit
health
joystick (?)
mode
passage
portal
push
remote
status
timer
weather
wire

Can you give some more Information? I activated in Robonect to talk to openhab due to status change too (with an own API-Script), but I think you got a solution to get all values with jsonpath or Xpath?

I simply used the same xml interface you did. So if you send for example the first one of the mentioned commands to the interface, you will use a command like this:

http://192.168.0.xx/xml?user=username&pass=password&cmd=battery

Robonects answer would be something like this:

<robonect>
   <batteries>
      <battery>
         <id>0</id>
         <charge>100</charge>
         <voltage>21395</voltage>
         <current>6</current>
         <temperature>5</temperature>
         <capacity>
            <full>1200</full>
            <remaining>1200</remaining>
         </capacity>
      </battery>
   </batteries>
   <successful>true</successful>
</robonect>

So if you want to know the voltage you could use an item like:

String voltage "Current voltage [XPATH(/robonect/batteries/battery/voltage/text()):%s]" (gGroup)  { http=">[ON:GET:http://192.168.0.xx/xml?user=username&pass=password&cmd=battery]" }

I haven’t tested it with an item, but in a rule it works like this, where “url” is a string just as http://192.168.0.xx/xml?user=username&pass=password&cmd=battery
In my case I’m using the response for logging information.

var String response = transform("XPATH", "/robonect/successful/text()", sendHttpGetRequest(url))

Of course http Binding has to be installed to use this binding configuration and transformation xPath has to be installed. But that’s quite simple because you can do both in PaperUI or in addons.cfg file (my way).

Just FYI, JSON would work as well. You can test
http://192.168.x.xx/json&user=xxxxx&pass=xxxxx&cmd=status
and compare JSON results with XML results.

JSON values are easier to define in Items from my point of view, but on the other hand you need a .js file for each value in /configuration/transform according to http-binding definition. The only alternative is using JSONPath. See https://www.openhab.org/addons/bindings/http1/#handling-json

So my conclusion is, that the easiest way to get the results is usage of JSON in combination with JSONPath Transformation.

Finally I found the API-description: https://forum.robonect.de/viewtopic.php?f=10&t=2535&sid=e5a4f50fcf7f6afb78303c22bd61d345

Have fun!

I assume the channel must be configured as described here: https://www.openhab.org/docs/configuration/things.html#defining-channels

But at the moment I don’t have the possibility to test it…

@paphko

Why should it be like that?

That’s not what the binding says, according to binding description

Besides the binding ist working well in general. So an item should not depend on a channel configuration.

The NullPointerException “Name is null” at location RobonectHandler.java:140 indicates that the channel parameter is not loaded at all (it is null), no matter how the channel configuration is entered. I tried it myself. Did you find a working configuration for the job-channel yet?

I came accross the thing configuration pages and there I saw that custom channels can be configured with parameters, just like the Astro binding does it. I just thought this might be working. As soon as my Robonect is working again, I’ll test it…

Yes, I’m using JSON interface. Everything works well with that.