Items/Lights are switching when restarting openhab or changing configuration

  • Platform information:
    • Hardware: Raspi3
    • OS: openhabian raspian 10
    • Java Runtime Environment: openjdk version “1.8.0_222”
    • openHAB version: 2.4.0

Hi all,

my name is Denis I’m from Germany and I’m new with OpenHAB. I’m running a small SmartHome installation since about two years now. In the past with homebridge, but after this didn’t run very stable and I was frustrated from configuring all that rules and stuff with the  Home App, I did a switch to OpenHAB 2.4 and I’m really happy with that decision. I already intergrated a lot of Hue items, wheater, netatmo, logitech harmony, my 3D printer and a lot of other stuff and I’m just playing with ESP8266 MCU to get some other funny things working.

One thing which is really confusing me, that OpenHAB switches some items when I restart OpenHAB or also when I’m just changing Things- or Items configuration. At the moment I should restart my Instance because I changed my MQTT configuration, but I can’t do that, because my family is already in the beds and if I restart OH now, a lot of lights in there rooms will change their state :wink:

Can somebody tell my why OH is doing that? And is there a way to prevent that?

Thanks!
Denis

openHAB would not send commands when starting up itself. There are some options, why that could happen to you, but there is not enough information yet.

You don’t need to restart openHAB when changing things viy a things file, instead you have to restart the corresponding addon via openHAB console (Karaf console)

Did you know about the two german forums? http://knx-user-forum.de/forum/supportforen/openhab (official german forum) and https://openhabforum.de/ (inofficial german forum - get’s a lot more traffic than the official one :wink: )

I don’t think that I use any rule which could trigger that lights. How to find out what is triggering that lights if OH should not do that?

The MQTT binding currently has a big which is fixed in 2.5 which needs a restart of OH after changing the things file.

Thanks for the info with the German forums. No I didn’t know them

No, that’s not correct. The easy-peasy way to work around this issue is to restart openHAB, but that’s not necessary. To restart the bundle would suffice. Afaik the issue is not fixed completely (at least there is an active issue in github about that).

Are there specific rules in how the switches are changed (e.g. every restart light1 is switched ON, light2 is always switched OFF) or is this a random issue (so you can’t predict the switching at all)?

I already tried to restart the bundle only. That didn’t work…

Im not sure. I should check that at the next restarts. But I think that their behavior is everytime the same.

EDIT: You were right! I restarted

234 │ Active │ 80 │ 0.10.0.oh240 │ Eclipse SmartHome MQTT Binding
235 │ Active │ 80 │ 0.10.0.oh240 │ Eclipse SmartHome MQTT Thing Binding
236 │ Active │ 80 │ 0.10.0.oh240 │ Eclipse SmartHome MQTT Transport Bundle

and after them it worked :slight_smile:

Thanks for giving that hint again. I think the last time I only restarted the first of them.

I will check the switch light behavior the next time when I’m able to restart without irritating someone :slight_smile:

You might want to share some detail about the configuration - Item, channel, Thing - of your offending Item.

Don’t you have some rules which has a ‘System started’ trigger or a trigger which is made by one of the lights (like lights01 changed, etc…). If you are sure that there are 0 rules which sends command (sendCommand) to the lights then it must be something else.

Do you just only restart openHAB or your whole server? What MQTT broker are you using? If you restart your whole Raspberry then it might be some misconfiguration in MQTT, especially using retain flag. That can cause issues like this…