Hi,
I have a working OH2.0 installation on Raspberry Pi.
Mosquitto installed on the pi as well and tested working with my device that’s subscribed via mqtt.
I can do the following in order to switch the light on and off:
Turn on: mosquitto_pub -t “/switch/Sonoff01AF” -m “1”
Turn off: mosquitto_pub -t “/switch/Sonoff01AF” -m “0”
in Paper UI I installed via Add-ons:
BINDINGS → MQTT Bindings (1.9.0.b5)
PERSISTENCE → MQTT Persistence (1.9.0.b5)
ACTIONS → MQTT Actions (1.9.0.b5)
Contents of /etc/openhab2/services/mqtt.cfg:
mosquitto.url=tcp://OH2IPAddress:1883
mosquitto.clientId=OpenHAB2
All other entries in this files are commented out with #.
My /etc/openhab2/sitemaps/demo.sitemaps contains:
Group item=gTFloor label=“Top Floor” icon=“secondfloor”
My demo.items file contains the following lines that were added to the demo content which was there already:
Group gTFloor “Top Floor”
Switch Light_Desktop “Amir_Study” (gTFloor) {mqtt=“>[mymosquitto:/switch/Sonoff01AF:command:ON:1],>[mymosquitto:/switch/Sonoff01AF:command:OFF:0]”}
I have installed the network bindings and can confirm I can see the mqtt device on the network (using its IP Address).
I now go to http://OH2IPAddress:8080/basicui/app
I can see in the top section Top Floor, when I click I see:
Study Room > followed by a switch.
It shows the status of the light as Online and the icon is green.
clicking on the switch turns the light to red but my mqtt device doesn’t change.
When I look at the log file /var/log/openhab2/openhab.log I see this entries:
2017-01-21 15:37:02.720 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id ‘mqtt’
2017-01-21 15:37:02.732 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Error during the execution of startup rule ‘ut’: cannot invoke method public abstract org.eclipse.smarthome.core.types.State org.eclipse.smarthome.core.persistence.HistoricItem.getState() on null
2017-01-21 16:00:04.246 [INFO ] [penhab.io.transport.mqtt.MqttService] - MQTT Service initialization completed.
2017-01-21 16:00:04.251 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection ‘mymosquitto’
2017-01-21 16:00:04.318 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection ‘mosquitto’
2017-01-21 16:00:04.323 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection ‘’
2017-01-21 16:00:04.444 [ERROR] [org.apache.felix.configadmin ] - Cannot use configuration org.openhab.mqtt for [org.openhab.core.scriptengine.action.ActionService, org.osgi.service.cm.ManagedService, id=279, bundle=182/mvn:org.openhab.action/org.openhab.action.mqtt/1.9.0.b5]: No visibility to configuration bound to mvn:org.openhab.io/org.openhab.io.transport.mqtt/1.9.0.b5
2017-01-21 16:02:46.827 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model ‘demo.sitemap’
2017-01-21 16:05:14.619 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model ‘demo.items’
2017-01-21 16:07:13.344 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id ‘mqtt’
2017-01-21 16:07:13.354 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Error during the execution of startup rule ‘ut’: cannot invoke method public abstract org.eclipse.smarthome.core.types.State org.eclipse.smarthome.core.persistence.HistoricItem.getState() on null
Can anyone point me in the correct direction of how I can troubleshoot this or find out what’s not setup correctly? (and tell me what other information can be provided to assist in the troubleshooting)
The mqtt device is a sonoff with a custom arduino script, but I don’t think this has any importance. It’s a working mqtt device.
Thanks in advance
Amir