I have recently started an openHAB project, I already had MQTT enabled devices installed with custom apps written for control etc but wanted to try openHAB as well.
The problem I have is that several lamps report their status by sending a MQTT message from a common topic with different payloads to indicate the source of the data. When I use this data in openHAB I use several java scripts (one for each lamp) to detect the payloads and return ON or OFF which works OK. So for example lamp1 might send a payload of lamp1=1 for on and lamp1=0 for off, the java script is a simple if (i=“lamp1=0”) return “OFF”; and similarly for the on state. The issue is that because the lamps all publish on the same topic each java script might handle payloads from other lamps, so if lamp2’s payload is processed by lamp1’s java script neither if statement is true so I try to return null (or some other value) to indicate to openHAB that it should ignore this status update. Which sort of works but I get lots of warning messages logged.
So my question is is there a value I can return from the java scripts which will make openHAB silently ignore the status update ?
I have tried several values that I have seen in MAPs like “unknown” “undefined” etc.