Shelly Switch not working properly

Hi have a shelly switch in HA which works perfectly from the shelly app on ios.
When I go in to developer / states
An set the state from ‘on’ to ‘off’ the state changes to off and then after about 5 seconds switches back to ‘on’ (Image 1)
Also the state in the actual device (shelly app) does not change during that 5 seconds.
If I however click on the ‘!’ button on the entity list it brings up a switch (image 2) and allows me to change the state to ‘off’. This works and the device turns off (and stays off ) as expected.
Can anyone tell me what may be causing this.
I have about 10 of these devices and the other 9 all work as expected. I don’t have any automations that could change this that I can see. Any ideas would be appreciated.
Have re booted the device and restared HA. I am also running the lasted firmware on both


I’ve sorted it - it was an automation the switch was set as a deviceId = ‘xxx’ and should have been an entityId =‘xxx’

Thanks