[SOLVED] Hello i m working on home automation using openhab

Dear All,

Pls help out to resolve my below problem.

  1. I could trigger hardware using my mqtt apps but not able to trigger thru openhab2.

  2. Demo.items file as below

Group All
Group E1 (All)
//Entrance topic is /HAS1 group is E1
Switch Light1_E1 “Light1” (E1,Lights) {mqtt=">[broker:/HAS1:command:on:R1_ON],>[broker:/HAS1:command:off:R1_OFF]"}

  1. Demo.sitemap

sitemap demo label=" Home Automation HAS1"
{
Frame {
Group item=E1 label=“Entrance” icon=“Living Room”
{
Switch item=Light1_E1 label=“Light1”
Video item=IP_Camera url=“http://192.168.0.103:7778/videostream.cgi?user=xxxx&pwd=xxxx@” encoding=“mjpeg”
}
}
}

/etc/ openhab2/services/ mqtt.cfg

broker.url=tcp://192.168.0.201:1883

/var/lib/openhab2/config/org/openhab/ mqtt.cfg

broker.url=“tcp://192.168.0.201:1883”
service.pid=“org.openhab.mqtt”

My problem is i m able to view live video in web browser 192.168.0.201:8080

http://192.168.0.201:8080/paperui/index.html#/extensions

Add-ons under action MQTT action shows uninstall ( Because it is installed )

Add-ons under binding MQTT binding shows uninstall ( Because it is installed )

Open ----------- Openhab2 using http://192.168.0.201:8080/start/index

When we will click on basic ui …
Welcome!
Available sitemaps
 Demo

Able to view live video but not able to trigger… hardware…

1 Like

Wher do you see, if it’s installed.
Try to install please.

1 Like

It shows as uninstall that means it is installed because reset of the binding shows as Install
As it is install the MQTT binding thats way it shows MQTT binding ------------ uninstall

I hope do you understood my explainations…

OK, I have overlocked

1 Like

Can you see the button?

1 Like

Yes… But not trigger hardware …

Regards,

Thale

Then ceck the mqtt-configuration. My example

{mqtt=">[mosquitto:esp16256864/rs0:command:*:default],
       <[mosquitto:openHAB/esp16256864/rs0:state:default]"}

Use a tool to show the communication.
Check the mqtt.cfg

1 Like

As suggested on the Tasmota Wiki for openHAB the use of mqtt-spy would help to identify wether a mqtt message is sent correctly.

Stil my problem is not resolved… pls any body can help to resolve the problem

Did you try to use mqtt-spy or any other software to show MQTT Messages from/to your Broker? (as mentioned from @Opus)

  • Check the logs at start-up of openhab if the MQTT Broker is connected (you did not specify a client-ID nor user/Password (optional) in services/mqtt.cfg)
  • Check if there are any errors loading your demo.items file
  • Check with mqtt-spy the name of the topic (the leading slash is worrying me: normally not necessary)
  • Check with mqtt-spy what is sent from openhab when switching Light1_E1

Andreas

I m able to trigger hardware using my mqtt apps broker is raspberry pi and client esp12 and i able to trigger hardware without any problem…

Services / mqtt.cfg contain following …

/etc/ openhab2/services/ mqtt.cfg

broker.url=tcp://192.168.0.201:1883

Similarly

/var/lib/openhab2/config/org/openhab/ mqtt.cfg

broker.url=“tcp://192.168.0.201:1883”
service.pid=“org.openhab.mqtt”

How do i use mqtt-spy to check as per your suggestion i m using win 10 laptop pls help

Regards,

Thale

I did download the mqtt-spy .jar file, dobleclicked on the file and it started (on Windows 10).

In mqtt-spy connect to your broker with your credential and subscribe to Messages ("#" for all topics).

Could you explain what and where broker ( raspberry pi details to be filed ) and also other relevant…details so i can check pls explain me with the help of example pls thanks

I’m not at my system now, so I can only give hints oui of my memory.
You are using mqtt-spy to connect to your broker from another system, in order to connect you need the IP of the system where the broker runs and the credentials (username and Password, the same you have in your mqtt.cfg). Using those inputs mqtt-spy should be able to make the Connection (shown with a green tab).

Server url ------------------- IP address of raspberry broker :1883

What is Client ID just below the server url ???

Adove that connection name ???

Configuration mode ???

Pls help

Regards,

Thale

Server url ------------------- IP address of raspberry broker :1883

What is Client ID just below the server url ???

Adove that connection name ???

Configuration mode ???

Pls help

Regards,

Thale

Mqtt-spy ----------------- Server URL as given IP address of Raspberry pi i m able to trigger the hardware …

Thanks but can u help why it is not working with opnehab2

Regards,

Thale

Mqtt-spy ----------------- Server URL as given IP address of Raspberry pi i m able to trigger the hardware …

Thanks but can u help why it is not working with opnehab2

Regards,

Thale

Please answer only once (it seems you are replying to the email and posting the same text directly into the Forum).

Did you get mqtt-spy to connect to your mqrtt-broker?? If so, please try to sent a mqtt via OH and post what you are receiving in mqtt-spy.
Additionally, please post the message you are receiving in mqtt-spy (using that, we could verify the Syntax used in your .tems file)

Yes i am able to trigger hardware …

But not able to trigger thru OH2