Hi Guyz,
Tried searching the forum around this area but could not find anything.
I am trying to work on a reliable message delivery to an actuator. My actuator is currently a MySensor Kitchen Light but I want to have a mechanism for reliable message sent out from controller to at any type of critical actuators like boilers etc.
I am currently using mqtt broker for my messages to and from actuator. I setup my item with autoupdate=“false” and changes state when I receive message from actuator directly and wrote below rule for automatically retry.
I have two items UnderCounterLight switch and UnderCounterLightRetry as number to keep count of retries and stop retries if for example sensor is switched off.
rule "Kitchen lights switch retry"
when Item UnderCounterLight received command
then
createTimer(now.plusSeconds(2)) [|
if(UnderCounterLight.state != receivedCommand){
var Number retries = UnderCounterLightRetry.state as Number;
if(retries < 50){
UnderCounterLight.sendCommand(receivedCommand);
}
retries = retries + 1;
UnderCounterLightRetry.postUpdate(retries);
}
]
end
The count is reset everynight and I know if this reaches 50 that I might have some failed messages.
My plan is to convert this rule to a group rule where I would attache a gReliable group to an Item which needs reliable delivery. Will think about retry item.
Now I want to know from all those experienced folks here if I am going in the right direction or if there is something similar already available. This is by no means replacement to ignore the transmission unreliability rather a mechanism to ensure absolute reliability and transmission health analysis.