Send switch refresh via Remote openHAB item doesn't work

I am running OH 2.5 and OH 3.3 with the Remote openHAB binding and I am switching over to OH 3.3 step by step. As of the current icloud-binding-problem, I disabled it on OH 2.5 and installed the fixed version on OH 3.3. But my setup is based on the basic UI from OH 2.5… So what I did is to create items on OH 3.3 for all the icloud channels. Additionally, I linked the those items against the old items in OH 2.5 with profile=follow.

So at the moment, I get all updates from the binding in OH 3.3 reflected to my items in OH 2.5 => works great!

But now comes the other way round. In OH 2.5 my setup looks like:

# sitemap
Switch item=iPhone_Refresh  mappings=[ REFRESH='Refresh now' ]

# old item configuration in OH 2.5
Switch iPhone_Refresh  "Force iPhone Refresh"  (giCloud)  { channel="icloud:device:xxx:location", autoupdate="false" }

So basically - when I click on REFRESH in the sitemap, the switch send REFRESH to the icloud-location-channel. This worked before in OH 2.5 and it works in OH 3.3. But it seems, REFRESH doesn’t work via the remote binding.

The allowed values of a switch are:
OnOffType: ON OFF
RefreshType: REFRESH

ON/OFF works perfectly but REFRESH doesn’t work…

Any idea what I do wrong here?

Note that I am very surprised it is possible to send a REFRESH command using this sitemap syntax…

I took a look to the remote openHAB binding to see what I implemented for the REFRESH command. You expect that the REFRESH command to be sent to the remote server and your expectation looks reasonable to me. Unfortunately, this is not the choice I did when I implemented this binding few years ago. The REFRESH command is caught by the main server and the item state (main server) is then updated with the last item state from the remote server. The REFRESH command is handled on the main server, rather than being sent to the remote server.

Today, I agree with you that the REFRESH command should rather be handled like any other command and so should just be sent to the remote server. I will probably prepare a fix.

2 Likes

Hi @Lolodomo - thanks for investigating. Actually I got the syntax for the sitemap from the original binding documentation! Currently I am “abusing” the openhab-remote binding to work in the opposite direction. Most of my rules/scripts etc. are still on OH 2.5 but as bindings are not fixed / updated for 2.5 anymore, I install them on OH 3.3 and update the items in OH 2.5.

For example: In OH 3.3 I define the item like this:

Number VAC_Ap_statusBat "Battery Level [%1.0f%%]" <battery> { channel="miio:vacuum:8cxxxxxxxx:status#battery", channel="remoteopenhab:server:192_168_100_3:VAC_Ap_statusBat" [profile="system:follow"] }

This works fine! The only difference is that OH 2.5 receives the updates as a “sendcommand” instead as a “postupdate” - but this just means some more event.log-entries which doesn’t bother me