Switch state randomly changing to on

  • Platform information:
    • Hardware: RPi 3
    • OS: Raspbian Lite
    • Java Runtime Environment: oracle jdk 1.8
    • openHAB version: 2.2.0
  • Issue of the topic: I have openhab set up with homekit and a simple sonoff switch controlling a lamp, and it can send commands etc. without any issue, however when the lamp is switched off, after a few seconds the state changes to on for seemingly no reason (the lamp itself doesn’t switch on, just the switch shows as on, and events.log shows [vent.ItemStateChangedEvent] - Lamp_Light changed from OFF to ON with no command being sent)
  • Please post configurations (if applicable):
    • the item (sonoff.items) is as follows:

      Switch Lamp_Light "Lamp" <light> (Light) { mqtt=">[flat:cmnd/sonoff/POWER:command:OFF:0],>[flat:cmnd/sonoff/POWER:command:ON:1],<[flat:stat/sonoff/POWER:state:MAP(binary.map)]", autoupdate="false" }

And home.items looks like this:

Switch Lamp_Light "Lamp" <light> (Light) [ "Lighting" ] { mqtt=">flat:cmnd/sonoff/POWER:command:OFF:0],>[flat:cmnd/sonoff/POWER:command:ON:1],<[flat:stat/sonoff/POWER:state:MAP(binary.map)]", autoupdate="false" }

Switch LEDstrip_power "LED Power" <light> [ "Lighting" ] {channel="wifiled:wifiled:600194859FAC:power"}
Dimmer LEDstrip_white "LED White" <dimmablelight> (Light) [ "Lighting"}{channel="wifiled:wifiled:600194859FAC:white"}
Color LEDstrip_colour "LED Colour" <colorpicker> (Light) [ "Lighting" ] {channel="wifiled:wifiled:600194859FAC:power"}

(the LED strip works fine)

If I’ve left out any details that could help solve this please let me know and I’ll post them, it’s been days of fruitless google searching at this point, so any help would be greatly appreciated.

what’s the content of binary.map?

Hi, binary.map looks like this:

1=ON
0=OFF
On=ON
Off=OFF
ON=ON
OFF=OFF
NULL=OFF

Thanks