RFXCOM - sending repeated commands to cure unreliabilty

I suffer from a lot of activity on the single 433MHz radio channel which means that commands sent by the RFXCOM binding don’t always get through. To get around this I have created a virtual item and a physical item for each of my switched sockets, and I connect the 2 with a rule. It seems to work reliably.

Item file

Switch MyVirtualSocket
Switch MyPhysicalSocket  {autoupdate="false"}

Rules file

rule "Operate MySocket"
when Item MyVirtualSocket changed then
if (MyVirtualSocket.state == ON)  {
    MyPhysicalSocket.sendCommand(ON)
    Thread::sleep(250)
    MyPhysicalSocket.sendCommand(ON)
    MyPhysicalSocket.postUpdate(ON)
   }  else  {
    MyPhysicalSocket.sendCommand(OFF)
    Thread::sleep(250)
    MyPhysicalSocket.sendCommand(OFF)
    MyPhysicalSocket.postUpdate(OFF)
   }
end

Using the autoupdate=“false” setting allows the item MyPhysicalSocket to have the same command sent to it more than once, and it doesn’t reflect the changed state until it receives a postUpdate.

I couldn’t find any mention of using autoupdate as a stand alone command in OH2 so thought I’d write this guide for anyone suffering with the same problem.

I’ve moved all the incoming 433MHz items onto ESP8266 WiFi devices to get around the sensor part of the problem

2 Likes