Item file
Number Pir_sensor_E1 “PIR [%d]” (E1,Lights) {mqtt="<[broker:/testpub:state:default]"}
Sitemap
Frame {
Group item=E1 label=“Entrance” icon=“firstfloor”
{
Text item=Pir_sensor_E1
}
from mqttfx i am able to receive sensor output as 0 and 1 from the topic /testpub
i am receiving the below message
2016-06-16 12:50:01.930 [WARN ] [.c.i.events.EventPublisherImpl] - given new state is NULL, couldn’t post update for ‘Pir_sensor_E1’
My first idea is to test, whether MQTT is actually working, by opening two terminals…
In the first terminal type: mosquitto_sub -d -t hello/world
In the second type: mosquitto_pub -d -t hello/world -m "Greetings from Terminal window 2"
you should see on terminal 1: Client mosqsub/6179-rpiautomat received PUBLISH (d0, q0, r0, m0, 'hello/world', ... (32 bytes)) Greetings from Terminal window 2
if you get: no such command, the MQTT service is not installed on your machine
Install on rPi Jessie with: sudo wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key sudo apt-key add mosquitto-repo.gpg.key sudo rm mosquitto-repo.gpg.key
Then make the mosquitto repository available to apt: sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list sudo apt-get update
install the core packages (server & clients): sudo apt-get install mosquitto mosquitto-clients
Then check, whether you installed the MQTT binding for OH, by looking at /addons for org.openhab.binding.mqtt-1.8.3.jar
Sorry, just realised you can see 0 | 1 in mqtt…
Another thing could be the / in front of testpub, remove it and see what happens.
From {mqtt="<[broker:/testpub:state:default]"}
to {mqtt="<[broker:testpub:state:default]"}
It looks to me that you are receiving a message, but OH doesn’t understand it. Can you post the contents of the message, from the output of mosquitto_sub, so we can see what OH needs to decode?
Hi gpbenton,
ya you were right,i was receiving some blank spaces in between 0 and 1, now i rectified it and able to get the status values 0 and 1. But in my mobile openhab app it not upadating status where as in the browser it will update according to the change.how to overcome this issue.