HS3 MQTT Plugin

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

Moderator: Willem4ever

Post Reply
geert-jan
Member
Member
Posts: 126
Joined: Sat Nov 27, 2010 7:23 pm

HS3 MQTT Plugin

Post by geert-jan »

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 3:43 pm, edited 1 time in total.
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: HS3 MQTT Plugin

Post by raymonvdm »

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
geert-jan
Member
Member
Posts: 126
Joined: Sat Nov 27, 2010 7:23 pm

Re: HS3 MQTT Plugin

Post by geert-jan »

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 1067 times
Jeffrey
Member
Member
Posts: 136
Joined: Tue Jun 09, 2009 3:34 pm
Location: Netherlands

Re: HS3 MQTT Plugin

Post by Jeffrey »

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!
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: HS3 MQTT Plugin

Post by raymonvdm »

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
bpm32
Starting Member
Starting Member
Posts: 6
Joined: Fri Aug 28, 2015 4:06 am

Re: HS3 MQTT Plugin

Post by bpm32 »

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
geert-jan
Member
Member
Posts: 126
Joined: Sat Nov 27, 2010 7:23 pm

Re: HS3 MQTT Plugin

Post by geert-jan »

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: 126
Joined: Sat Nov 27, 2010 7:23 pm

Re: HS3 MQTT Plugin

Post by geert-jan »

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
bpm32
Starting Member
Starting Member
Posts: 6
Joined: Fri Aug 28, 2015 4:06 am

Re: HS3 MQTT Plugin

Post by bpm32 »

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
geert-jan
Member
Member
Posts: 126
Joined: Sat Nov 27, 2010 7:23 pm

Re: HS3 MQTT Plugin

Post by geert-jan »

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 1036 times
geert-jan
Member
Member
Posts: 126
Joined: Sat Nov 27, 2010 7:23 pm

Re: HS3 MQTT Plugin

Post by geert-jan »

... 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 916 times
dad
Starting Member
Starting Member
Posts: 30
Joined: Thu Jun 13, 2013 10:20 pm

Re: HS3 MQTT Plugin

Post by dad »

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.
geert-jan
Member
Member
Posts: 126
Joined: Sat Nov 27, 2010 7:23 pm

Re: HS3 MQTT Plugin

Post by geert-jan »

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
dad
Starting Member
Starting Member
Posts: 30
Joined: Thu Jun 13, 2013 10:20 pm

Re: HS3 MQTT Plugin

Post by dad »

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
geert-jan
Member
Member
Posts: 126
Joined: Sat Nov 27, 2010 7:23 pm

Re: HS3 MQTT Plugin

Post by geert-jan »

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
Post Reply

Return to “Homeseer MQTT Plugin Forum”