Robonect binding / Automower WLAN Module

I’m using the Robonect Binding in the curent Version 2.3.
I have a feature request to this Binding

It would be great to see the status of all 14 timers (status: ON|OFF)
And it would be great to have the possiblility to switch all Times ON | OFF (by the Rule Engine)

Just for the record, this works after I upgraded to snapshot. I’ve got v1.0 beta 3 running on the AM and now everything works like a charm (I’m just using few channels though haven’t tried the rest). Thanks for good work!

Oh. Just because I was so happy, now I discovered something extremely annoying. It seems that in the last betas of Robonect, the AM beeps every time the binding poll it. So once every minut it makes this annoying “bipp bipp” sound. I guess that’s the same problem that @thokl is mentioning in the github merge ticket. I guess there’s not much the binding can do about this, right?

How can i enable/ disable a reobonect-timer in the openhab-rule-engine?
I’ve tried it with “execute a given script” in the openhab-rule-engine, but without success.

How do i have to scipt this?
http://192.168.xxx.xx/xml?cmd=timer&timer=1&enable=0

Thanks 4 help

I created an issue for this (https://github.com/reyem/openhab2-addons/issues/16) to work on after the binding PR got officially accepted and merged to OH.

In the mean time you may use the HTTP Binding

https://docs.openhab.org/addons/bindings/http1/readme.html

something like:

Switch Timer1{ http=">[ON:POST:[http://192.168.xxx.xxx/cmd=timer&timer=1&enable=1](http://192.168.xxx.xxx/cmd=timer&timer=1&enable=1)] >[OFF:POST:[http://192.168.xxx.xxx/cmd=timer&timer=1&enable=0](http://192.168.xxx.xxx/cmd=timer&timer=1&enable=0)]" }

should do the job. If you enabled Authentication you may have to add the header like described here:

https://docs.openhab.org/addons/bindings/http1/readme.html#authorization-header

Although I’m not sure on how reliable the status is. So to get it more or less reliable you may have to parse the response as well as described here:

https://docs.openhab.org/addons/bindings/http1/readme.html#handling-json

Just as a warning, I haven’t used the http binding. So this is all just theory, but may help in finding a solution for short term :wink:

After some Tests and some Errors i got it running.

Switch Robonect_Timer1 { http=">[ON:POST:http://192.168.xxx.xx/xml?cmd=timer&timer=1&enable=1] >[OFF:POST:http://192.168.xxx.xx/xml?cmd=timer&timer=1&enable=0]" }

Attention on the Blanks! If there is a blank between > and [ it does not work

A tiny bit off topic here, but I guess this could interest people hanging in this thread: I haven’t found any documentation of the push service (in Robonect beta) so I’ve been trying on my own. Turns out what you choose in the Robonect settings is just when the call occurs. The call itself is always the same, it takes your url and appends some arguments:

?id=075BCE&name=AM&signal=-65&status=17&stopped=0&duration=0&mode=0&battery=100&hours=1319

I’m mainly interested in the status, ie changing the value of my status item in OH, so I did a little PHP for Robonect to call, which in turn calls the OH API to change the value. Just to get you an idea of how it works :slight_smile:

<?php

$itemname = "Automower_Status";
$status = $_GET["status"];
$url = "http://localhost:8080/rest/items/".$itemname;

$options = array(
    'http' => array(
        'header'  => "Content-type: text/plain",
        'method'  => 'POST',
        'content' => $status
    )
);
$context = stream_context_create($options);
file_get_contents($url, false, $context);

?>

1 Like

@reyem: I know there was discussion in the PR about how to do the lists in the readme. Seems it didn’t go really well anyway in the end, when I look at https://docs.openhab.org/addons/bindings/robonect/readme.html now I see kinda ugly html code.

And while I’m barking at the readme, my AM 310 isn’t mentioned in the supported mowers. It’s got 1.0 beta4 now, working like a charm :wink:

Hello @reyem,

thanks for this great plugin! I am using the current Robonect FW 1.0 beta 5 and Openhab 2.3. The robot is a Gargdena Sileno+ and everything works perfect beside one little thing. When I try to set the mowerMode to “MAN” I receive the following error:

2018-06-26 12:02:13.650 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.robonect.handler.RobonectHandler@303c75e7': No enum constant org.openhab.binding.robonect.internal.model.cmd.ModeCommand.Mode.MAN
java.lang.IllegalArgumentException: No enum constant org.openhab.binding.robonect.internal.model.cmd.ModeCommand.Mode.MAN
        at java.lang.Enum.valueOf(Enum.java:238) [?:?]
        at org.openhab.binding.robonect.internal.model.cmd.ModeCommand$Mode.valueOf(ModeCommand.java:1) [220:org.openhab.binding.robonect:2.3.0]
        at org.openhab.binding.robonect.handler.RobonectHandler.setMowerMode(RobonectHandler.java:193) [220:org.openhab.binding.robonect:2.3.0]
        at org.openhab.binding.robonect.handler.RobonectHandler.sendCommand(RobonectHandler.java:126) [220:org.openhab.binding.robonect:2.3.0]
        at org.openhab.binding.robonect.handler.RobonectHandler.handleCommand(RobonectHandler.java:104) [220:org.openhab.binding.robonect:2.3.0]
        at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source) ~[?:?]
        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.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [101:org.eclipse.smarthome.core:0.10.0.oh230]
        at com.sun.proxy.$Proxy149.handleCommand(Unknown Source) [220:org.openhab.binding.robonect:2.3.0]
        at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [108:org.eclipse.smarthome.core.thing:0.10.0.oh230]
        at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [108:org.eclipse.smarthome.core.thing:0.10.0.oh230]
        at sun.reflect.GeneratedMethodAccessor76.invoke(Unknown Source) ~[?:?]
        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) [?:?]

I also tried to set mowerMode to “MANUAL”, it seems the Mode is acceptet but immediately turns back to the state before the change:

2018-06-26 12:04:00.670 [ome.event.ItemCommandEvent] - Item 'mowerMode' received command MANUAL
2018-06-26 12:04:00.683 [vent.ItemStateChangedEvent] - mowerMode changed from HOME to MANUAL
2018-06-26 12:04:00.790 [vent.ItemStateChangedEvent] - mowerDuration changed from 90 to 101
2018-06-26 12:04:00.792 [vent.ItemStateChangedEvent] - robonect_mower_5b61a31e_status_duration changed from 90 s to 101 s
2018-06-26 12:04:00.793 [vent.ItemStateChangedEvent] - mowerMode changed from MANUAL to HOME

All other modes “AUTO”, “HOME” and “EOD” are working perfectly.

Any idea?

Best regards,
Flip

@Flip MANUAL is the proper Mode. MAN will not work as your case shows.

I also tried to set mowerMode to “MANUAL”, it seems the Mode is accepted but immediately turns back to the state before the change:

Did you do this while the mower is in charging station? I did not check, but I think my AM105 does not allow to set MANUAL while it is in the charging station. If you want to let your mower mow the gras in times the timer is inactive, the job command might help.

The Job parameters can be configured using channel configurations. That way you can set up in your OH config some default jobs (like mow now for 60 minutes starting on REMOTE_1 etc.) and configure switches to let the job start.

Unfortunately the documentation is not updated on these last minute refactorings. The examples seem to be wrong in this case and also the MANUAL mode seems to be wrongly documented. I will try to fix them together with the formatting issues @DanielMalmgren mentions.

Hi @reyem,

thanks for the quick reply. Yes, I tried to set the mode to “MANUAL” while the mower is in the charging station. But this is like it should be. I don’t know on Automower but as Automower 310 and Gardena Sileno+ are almost identical, the “MANUAL”-mode is used to fully charge the mower. After it has been charged, the mower will leave the charging station as indication that he is ready to place him to a side area. There he will mow until the battery is empty…

Regards,
Flip

PS: If I set the mower to MANUAL-Mode via the Robonect-Webinterface, it works without changing back the mode

:face_with_raised_eyebrow:

I think I found the issue. The latest review points about names in the UI for these modes resulted in a bug as they are translated 1:1. So instead of the correct

http:///json?cmd=mode&mode=MAN

the binding sends now

http:///json?cmd=mode&mode=MANUAL

which is not supported by the API :frowning:

so I create this issue:

for the documentation I created this issue:

Hi @reyem

thanks for the quick reply again! So when if I understand correctly, the only thing which need to be changed is to introduce the constant MAN and give it 1:1 to the API?

Best regards,
Flip

more or less correct…

Simply fix the method org.openhab.binding.robonect.internal.model.cmd.ModeCommand#toCommandURL to translate enum org.openhab.binding.robonect.internal.model.cmd.ModeCommand.Mode#MANUAL to “MAN”

When I find some time I can look into the issue and create a PR. Feel free to be faster than me :wink: As it is now in the official OH repo, anybody might create PRs

Hi @reyem,

I tried to fix it but I’m not fit in Git and Java. Couldn’t get it to work :frowning:

Regards,
Flip

OK, found finally time to do this small fix. It’s now a PR for OH. This build should already work:

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

I also get that “beep beep” every time openhab tries to get some status of the mower (R70li)
Did you find a solution to skip the “beep”?
So, at the moment my polling intervall is quite long…

Did you use the latest snapshot?

I have the same issue…

I don’t know how exactly it came up as I was updating the firmware on the mower at the same time as I was upgrading to a new binding.

It seems like it’s waking up the mower when something is pulled by triggering some command. In the logs I see that the state of the mower changes from sleeping to parking when it beeps…

I have the same behavior for the latest 2.3 and 2.4 snapshots.

Can you post the logs please? Thx

I’m currently tracing the binding, but today it did not happen yet.

I usually experienced the behavior while the mower was in auto mode but sleeping. (so practically during night… :slight_smile: ) As I’m currently not at home i set the mower to home mode so it goes to sleep mode and I see when it “beeps” as it would wake up. (but maybe in that case it does not happen…)

Anyways, wanted to let you know that I’m on it and will let you know once i figured out more.