I have a basic test environment, mysql persistance. Switch1 is set to resoreOnStartup.
Item Switch1 <–> mqtt (smarthome/room1/led) <–> espDevice <–> led
All works fine, Switch controls led and value is seen posting to the mysql database, if I shutdown and restart Openhab2, the Switch1 item restores in the Openhab2 UI from null to the last state in the database, but no MQTT message is sent to the broker, is this the expected behaviour or do I need something else to restore the external device?
–log extract
2018-11-04 22:11:33.210 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to ‘53.825613999999995,-1.8625439’.
2018-11-04 22:11:43.751 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘test.items’
2018-11-04 22:11:43.839 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘test1.items’
2018-11-04 22:11:44.415 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘mysql.persist’
2018-11-04 22:11:47.213 [INFO ] [thome.model.lsp.internal.ModelServer] - Started Language Server Protocol (LSP) service on port 5007
2018-11-04 22:11:48.363 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘test.sitemap’
2018-11-04 22:11:50.150 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at http://192.168.2.81:8080
2018-11-04 22:11:50.156 [INFO ] [.dashboard.internal.DashboardService] - Started Dashboard at https://192.168.2.81:8443
2018-11-04 22:11:50.655 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2018-11-04 22:11:51.498 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2018-11-04 22:11:51.709 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2018-11-04 22:11:51.718 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection ‘broker’
==> /var/log/openhab2/events.log <==
2018-11-04 22:11:52.828 [vent.ItemStateChangedEvent] - MQTT_Test changed from NULL to OFF
2018-11-04 22:11:52.845 [vent.ItemStateChangedEvent] - MQTT_Out changed from NULL to ON
==> /var/log/openhab2/openhab.log <==
2018-11-04 22:11:53.228 [INFO ] [panel.internal.HABPanelDashboardTile] - Started HABPanel at /habpanel