Du ser en gammel version af denne side. Se den nuværende version.

Sammenlign med nuværende Vis sidehistorik

« Forrige Version 10 Næste »

Java Application as Bridge

Github Source: https://github.com/jobu279/zensehome

Compile the source code.

Samples below are referenced from /home/bnp/production/zensehome/zensemqtt

You need to create a "/home/bnp/production/zensehome/zensemqtt/logs" directory; - then execute the application

root@robin:~/production/zensehome/zensemqtt# java -Dfile.encoding=UTF-8 -classpath /home/bnp/production/zensehome:/home/bnp/production/zensehome/zensemqtt/mqtt-client-0.4.0.jar zensemqtt.ZenseMQTT
Jan 09, 2019 8:14:01 PM zensemqtt.Log logging
INFO: Starting ZenseHome MQTT listener


I have added compiled code here (out.zip)

The supporting lib for MQTT is mqtt-client-0.4.0.jar.

Setup a light source

I have defined a Thing for the ZenseHome box:

And are adding each light as a channel:


With the Topics according to https://github.com/jobu279/zensehome


Visible and testing in Paper UI - Controls

You should be able to see the Channels  and test them:

Logging

Watch the Log in /home/bnp/production/zensehome/zensemqtt/logs

root@robin:~/production/zensehome/zensemqtt/logs# cat 2019-1_ZenseLog.log
Jan 09, 2019 7:44:53 PM zensemqtt.Log logging
INFO: Starting ZenseHome MQTT listener
Jan 09, 2019 7:46:35 PM zensemqtt.Log logging
INFO: New message with topic: zense/execute/10604, Message: ON
Jan 09, 2019 7:46:37 PM zensemqtt.Log logging
INFO: New message with topic: zense/execute/10604, Message: OFF
Jan 09, 2019 7:46:43 PM zensemqtt.Log logging
INFO: New message with topic: zense/execute/10604, Message: ON
Jan 09, 2019 7:46:44 PM zensemqtt.Log logging
SEVERE: Error in socket creation: java.net.SocketException
Jan 09, 2019 7:46:54 PM zensemqtt.Log logging
INFO: New message with topic: zense/execute/10604, Message: OFF
Jan 09, 2019 7:46:55 PM zensemqtt.Log logging
SEVERE: Error in socket creation: java.net.SocketException
Jan 09, 2019 7:47:00 PM zensemqtt.Log logging
INFO: New message with topic: zense/execute/10604, Message: ON


Notice the "SEVERE: Error in socket creation: java.net.SocketException" - this means the ZenseHome box is non-respondig

  • Ingen etiketter