Refreshing mqtt.items fires system_started rules

Any change in mqtt.items file causing adding or remove links triggers rules with “System started” Is it correct behaviour ? Tried restarting OH, removing/changing rules and items and it happens even with this simple config:

mqtt.items

String swiatloWarsztat_Reachable 		"Aktywny: [%s]"     <contactable>   (gT_lwt) 		{ channel="mqtt:topic:swiatloWarsztat:reachable" }
Number swiatloWarsztat_RSSI      		"WiFi [%d %%]"      <wifi>          (gT_rssi)		{ channel="mqtt:topic:swiatloWarsztat:rssi" }
Switch swiatloWarsztat                  "Warsztat"		    <light>         (g_swiatla) 	{ channel="mqtt:topic:swiatloWarsztat:power", channel="mqtt:topic:swiatloWarsztat:state_power" }

system_started.rule

rule "test rule"
	when 
		System started
	then

		logInfo("RULE","system_started rule triggered after mqtt.items reload")
end

Then i changed swiatloWarsztat to swiatloWarsztat1

logs:

==> /logs/openhab.log <==

2020-09-23 10:21:09.281 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'mqtt.items'

==> /logs/events.log <==

2020-09-23 10:21:09.283 [.ItemChannelLinkAddedEvent] - Link 'swiatloWarsztat1-mqtt:topic:swiatloWarsztat:power' has been added.

2020-09-23 10:21:09.283 [.ItemChannelLinkAddedEvent] - Link 'swiatloWarsztat1-mqtt:topic:swiatloWarsztat:state_power' has been added.

2020-09-23 10:21:09.283 [temChannelLinkRemovedEvent] - Link 'swiatloWarsztat => mqtt:topic:swiatloWarsztat:power' has been removed.

2020-09-23 10:21:09.284 [temChannelLinkRemovedEvent] - Link 'swiatloWarsztat => mqtt:topic:swiatloWarsztat:state_power' has been removed.

==> /logs/openhab.log <==

2020-09-23 10:21:16.514 [INFO ] [.eclipse.smarthome.model.script.RULE] - system_started rule triggered after mqtt.items reload

That is what is always does.
It seems OK to me. If you lose the data you should use persistence.

Yes. Well, “expected behaviour” anyway.
It is difficult to draw a line to please everyone about how far to go in re-initializing stuff where you have edited parts of a running system.

You will also see Items re-initialized, the visible effect of which is NULL state.

When you consider that “System started” rules are often used to initialize Items to known states, you can see the purpose here.

Thanks for explanation.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.