HS3 MQTT Plugin

Alles m.b.t. de Homeseer MQTT Broker Plugin van Willem Eradus (Dutch Forum)

Moderator: Willem4ever

HS3 MQTT Plugin

Postby geert-jan » Thu May 21, 2015 7:23 pm

Hi,

some weeks ago my smart meter was installed. The data I wanted to expose using an Arduino, Ethernet shield and MQTT as protocol. I could not find a suitable plugin for HS3, so last week I started to build one myself. The initial version is attached.

The MQTT plugin:
In the config page you can select the IP address of the broker (I am using Mosquitto running an my Linux server).
Selecting 'Monitor Broker' will listen to ALL MQTT topics that the broker receives.

On the subscription page you are able to add/edit MQTT devices; both the discovered ones, but you can also add one manually.

On the publish page you can select which homeseer devices to publish when its data is changed.

Regards,
Geert-Jan
Last edited by geert-jan on Wed Feb 24, 2016 2:43 pm, edited 1 time in total.
geert-jan
Member
Member
 
Posts: 125
Joined: November 2010

Re: HS3 MQTT Plugin

Postby raymonvdm » Wed May 27, 2015 6:51 am

I just installed the plugin and it looks to be working although i found the following "bugs/wishes"

- There is no link to the config pages when u look on the plugins page
- It is not possible to use a hostname.domain.nl for the mqtt broker (data is not store as it seems)
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1145
Joined: December 2011

Re: HS3 MQTT Plugin

Postby geert-jan » Sun May 31, 2015 12:00 pm

Hi,

hereby an updated version of the HS3 MQTT plugin:
- Link on config page added
- MQTT broker address can be hostname and IP address
- added control page, so that you can manually publish topics. The topics+message are saved
- added navigation buttons on the 'subscribe' page

Regards,
Geert-Jan
Attachments
HSPI_MQTT_v0.5.zip
(35.63 KiB) Downloaded 252 times
geert-jan
Member
Member
 
Posts: 125
Joined: November 2010

Re: HS3 MQTT Plugin

Postby Jeffrey » Mon Jun 01, 2015 8:14 am

Hi Geert-Jan,

Just wanted to thank you for the plugin. I have this plugin running for integration of NFC tags to HS3. It's still early to say much about stability of the plugin, but I've noticed that the "Monitor MQTT broker" checkbox was empty for two times already within one week.

I will upgrade to the new version and monitor the plugin to see if it stays stable.

Thanks again for the great plugin!
Jeffrey
Member
Member
 
Posts: 135
Joined: June 2009
Location: Netherlands

Re: HS3 MQTT Plugin

Postby raymonvdm » Mon Jun 01, 2015 9:15 am

I tried the new version but it is not working yet. (Note: I never tested the old version with my Mosquitto server since it was not running :D )

This is my mosquitto logfile on the server

Code: Select all

Jun  1 10:13:29 kleinesmurf mosquitto[16475]: New connection from 192.168.xxx.57.
Jun  1 10:13:29 kleinesmurf mosquitto[16475]: New client connected from 192.168.xxx.57 as mosq_pub_25517_woonkam.
Jun  1 10:13:39 kleinesmurf mosquitto[16475]: New connection from 192.168.xxx.35.
Jun  1 10:13:39 kleinesmurf mosquitto[16475]: Invalid protocol "MQTT" in CONNECT from 192.168.xxx.35.
Jun  1 10:13:39 kleinesmurf mosquitto[16475]: Socket read error on client (null), disconnecting.
Jun  1 10:14:09 kleinesmurf mosquitto[16475]: New connection from 192.168.xxx.35.
Jun  1 10:14:09 kleinesmurf mosquitto[16475]: Invalid protocol "MQTT" in CONNECT from 192.168.xxx.35.
Jun  1 10:14:09 kleinesmurf mosquitto[16475]: Socket read error on client (null), disconnecting.
Jun  1 10:14:09 kleinesmurf mosquitto[16475]: New connection from 192.168.xxx.35.
Jun  1 10:14:09 kleinesmurf mosquitto[16475]: Invalid protocol "MQTT" in CONNECT from 192.168.xxx.35.
Jun  1 10:14:09 kleinesmurf mosquitto[16475]: Socket read error on client (null), disconnecting.
Jun  1 10:18:00 kleinesmurf mosquitto[16475]: New connection from 192.168.120.249.
Jun  1 10:18:00 kleinesmurf mosquitto[16475]: New client connected from 192.168.120.249 as Laptop.



The .57 is a RaspberryPi tellin me its local temperature. The .35 is the HomeSeer machine. On my laptop i`m using MQTT.fx


Update:

This issue seems to be related to the default Ubuntu Mosquitto package wich is too old. I have installed a new version using a PPA and now the broker seems to be working with the HS3 plugin.
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1145
Joined: December 2011

Re: HS3 MQTT Plugin

Postby bpm32 » Fri Aug 28, 2015 3:10 am

Thank you so much for creating this plugin. I would love to bring MQTT to my Homeseer system, but I'm having a bit of trouble. I have coped the two files (.exe and .dll) to the HomeSeer directory on my Raspberry Pi 2 and have enabled the plugin via the plugin manager. I'm getting this error message in the "Plugin status column":

WARNING: Failed getting InterfaceStatus from MQTT - the interface was not found in the list of active interfaces, the list may need to be refreshed.


The log shows the following:

Initializing plug-in(2): MQTT Instance::Object reference not set to an instance of an objectSTACK: at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (System.Runtime.Remoting.Proxies.RealProxy rp, IMessage msg, System.Exception& exc, System.Object[]& out_args) [0x00000] in :0

Any ideas on how I can fix this? I'm running the latest update on HS3Pro on my RPi2.

Many thanks for your time!

Brian
bpm32
Starting Member
Starting Member
 
Posts: 6
Joined: August 2015

Re: HS3 MQTT Plugin

Postby geert-jan » Mon Aug 31, 2015 7:54 am

Hi,

I have the plugin running in a Windows environment and do not recognize the issue.
I will check the plugin in a Linux environment tonight to see if I can reproduce the problem.

Regards,
Geert-Jan
geert-jan
Member
Member
 
Posts: 125
Joined: November 2010

Re: HS3 MQTT Plugin

Postby geert-jan » Mon Aug 31, 2015 7:16 pm

Hi,

status update: The good News is that I can reproduce the issue on a Raspberry.
The solution is known, but now I have to find some time to implement and test the changes.

Regards,
Geert-Jan
geert-jan
Member
Member
 
Posts: 125
Joined: November 2010

Re: HS3 MQTT Plugin

Postby bpm32 » Tue Sep 01, 2015 12:39 am

Thank you for taking the time to check into this - I really appreciate it. I'll check in periodically for any News. :)

Thanks again!

Brian
bpm32
Starting Member
Starting Member
 
Posts: 6
Joined: August 2015

Re: HS3 MQTT Plugin

Postby geert-jan » Tue Sep 01, 2015 6:05 pm

Hi,

hereby the HS3 MQTT plugin build for the HS3 on Raspberry Pi. It is build for the actual raspberry release (HS3 ZEE Edition 3.0.0.199)
The plugin is tested on the HS image for the RPi, I could not test it yet on the RPi 2, but I expect it to work.

Note that for the Raspberry Pi the plugin is a DLL, not an exe.

Features for v0.6:
- Offset/factor implemented. You can give begin an offset and correction factor for each device.
- the monitor string can be entered, so you can filter the MQTT messages you want to see instead of getting them all.
- page navigation improved.
- publish homeseer device value updates.
- raspberry pi support.


Regards,
Geert-Jan
Attachments
HSPI_MQTT.rpi.zip
HS3 MQTT plugin for RPi
(36.85 KiB) Downloaded 310 times
geert-jan
Member
Member
 
Posts: 125
Joined: November 2010

Re: HS3 MQTT Plugin

Postby geert-jan » Wed Sep 02, 2015 5:22 pm

... and hereby the HS3 MQTT plugin build for Windows/Linux.

See previous post for the features/fixes in this version.

Regards,
Geert-Jan
Attachments
HSPI_MQTT.zip
HS# MQTT plugin v0.6.1 (Windows / Linux)
(37.1 KiB) Downloaded 231 times
geert-jan
Member
Member
 
Posts: 125
Joined: November 2010

Re: HS3 MQTT Plugin

Postby dad » Fri Sep 04, 2015 1:58 pm

Hi Geert-Jan,

Trying your plugin with HS for Pi2 (HS3 ZEE S2 Edition 3.0.0.199 (Linux)). I have had the following results:

Installing the version for the Pi (ie the DLL) was not recognised.

But installing v0.61 for linux/windows was recognised. However, the logs show that the plugin is trying to connect to a broker on 127.0.0.1 and not the value entered into the IP Address MQTT Broker field on the config page.
dad
Starting Member
Starting Member
 
Posts: 30
Joined: June 2013

Re: HS3 MQTT Plugin

Postby geert-jan » Fri Sep 04, 2015 5:47 pm

Hi,

when starting the plugin connects to HS3, using the localhost address 127.0.0.1. That is the IP address visible in the logging.

Next the plugin connects to the MQTT broker using the address filled in at the MQTT configuration page, the default address is 192.168.1.2. If the plugin is able to connect to the mQTT broker the text 'Connected' is displayed next to the Broker address, if connection fails 'Not connected' is displayed.

Regards,
Geert-Jan
geert-jan
Member
Member
 
Posts: 125
Joined: November 2010

Re: HS3 MQTT Plugin

Postby dad » Fri Sep 04, 2015 6:21 pm

Hi Geert-Jan,

OK, I see - I am getting the Not Connected message.

I can ping the MQTT server IP address from the command line and other MQTT clients can connect to it so It is not a network issue.

Any thoughts?

thanks

Dad
dad
Starting Member
Starting Member
 
Posts: 30
Joined: June 2013

Re: HS3 MQTT Plugin

Postby geert-jan » Sat Sep 05, 2015 11:55 am

Hi,

can you check the MQTT broker version you are using?

I am running Mosquitto on Debian linux. The Mosquitto package supplied with debian is a very old version, which does not support the MQTT v3.x protocol. I installed Mosquitto 1.4.2, which is running ok. See also one of the posts above, Ubuntu also delivers an too old version of Mosquitto.

Regards,
Geert-Jan
geert-jan
Member
Member
 
Posts: 125
Joined: November 2010

Next

Return to Homeseer MQTT Plugin Forum

Who is online

Users browsing this forum: No registered users and 0 guests