Openhabian switch in loop


(Stephen Butler) #1

Hi all, i’m having some issues i have installed Openhabian on my Raspberry pi 3b+ set up MQTT (tested working with mqtt.fx) i have a sonoff running tasmota also connected to the MQTT (tested working through MQTT.fx) but openHab seems to have this issue of going into a loop and crashing my tasmota and openhab.

demo.items

Switch livingroomlight "Living Room Light"
	{mqtt=">[fullcontrol:cmnd/livingroomlight/POWER:command:*:default],<[fullcontrol:stat/livingroomlight/POWER:state:default]"}

mqtt.cfg


fullcontrol.url=tcp://192.168.0.43:1883

fullcontrol.clientId=openhab

fullcontrol.user="openhabian"

fullcontrol.pwd="**********"

demo.sitemap

sitemap demo label="Welcome to the Butler Home"
{
    Frame label="Living Room" {
        Switch item=Livingroomlight label="Ceiling Light" icon="light" 
    }
}

I have looked though about 20 pages online and on here and everything says the issue is caused by sing command instead of state as the return but im using state so do not understand why it goes into a loop and crashed everything.

If someone could help that would be great ive been at the for a total on 10 hours and its giving me a headache.

Thanks in advance guys


(Vincent Regaud) #3

Do you have any rules related to that item?
If not, you’ll need to dig into your tasmota settings. The binding is not at fault here.


(Stephen Butler) #4

I’m not currently at home and haven’t made the connection available external so cannot check at the moment but I have no created a rules file yet as I wanted to get the switch functioning so I had a base to start from. Publishing commands from within mqtt.fx functions correctly and the logviewer in openhab shows the switch responding and my light does indeed change. If there is a rules file there that I do not remember creating would deleting it solve the problem?


(Vincent Regaud) #5

Possibly. If you have a rule affecting the switch and creating that loop.
The MQTT config you have for tasmota switched works for many users.
Maybe try adding spaces in the binding config before and after the {}, sometimes the items file parser can be picky.

Switch livingroomlight "Living Room Light" { mqtt=">[fullcontrol:cmnd/livingroomlight/POWER:command:*:default],<[fullcontrol:stat/livingroomlight/POWER:state:default]" }

(Stephen Butler) #6

Much appreciated I’ll will try this this evening when I get home. I’m glad you guys are helpful as I did my usual thing looked at it thought I’d be fine and dropped money on 10 sonoffs and a raspberry pi to do it with and been stuck since :slight_smile: thank you for your help I will update if it is working (or not)


(CM6.5 H102) #8

@Stephen_Butler As mentioned above, everything looks good but I recommend changing your item name to start with capitols, e.g. Livingroomlight.

While I doubt this will fix your issue, it’s something needed for highlighting if using VSCode with OH extension. If your not using VSCode for creating and editing OH files then I highly recommend taking a look at doing so. You can thank me later.:wink: