HS3 MQTT Plugin

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

Moderator: Willem4ever

Sparkman
Starting Member
Starting Member
Posts: 29
Joined: Wed Sep 09, 2015 5:57 am

HS3 MQTT Plugin

Post by Sparkman »

The system.core message will be displayed if there's any kind of compilation error. Can you post the contents of the K1.vb file? Also, did you put an & in front of the hs. Command in the immediate script field?


Sent from my Phone using Tapatalk
Doug Meredith
Starting Member
Starting Member
Posts: 6
Joined: Tue Feb 28, 2017 6:33 pm

Re: HS3 MQTT Plugin

Post by Doug Meredith »

Thanks, sparkman.

I just double checked, and there is an ampersand at the beginning of the immediate script. The contents of /tmp/K1.vb are as follows:

Code: Select all

Function Main(parm as object)
dim result as object
result=hs.PluginFunction("MQTT", "", "publish", {"homeseer/something", "1234"})
return(result)
I can't see how this could be a compilation error, but maybe there is something I am missing.

As another data point, my original attempt was a script that compiled and executed just fine using tenScripting3, and it correctly published the MQTT message. When I moved the script to HomeSeer itself, I got the error I mentioned earlier. The immediate script was just a stripped-down example to illustrate the problem.
Sparkman
Starting Member
Starting Member
Posts: 29
Joined: Wed Sep 09, 2015 5:57 am

Re: HS3 MQTT Plugin

Post by Sparkman »

I just tried it on my system and got this error message when running the immediate script command:

Code: Select all

Mar-13 6:12:49 PM	 	System	Control Panel Immediate Script: &hs.PluginFunction("MQTT","","publish",{"homeseer/something","1234"})
Mar-13 6:12:49 PM	 	Error	Running script(1) &hs.PluginFunction("MQTT","","publish",{"homeseer/something","1234"}), init error: Invalid character
When I ran it as &nhs.PluginFunction, then it ran fine.

Code: Select all

Mar-13 6:13:03 PM	 	System	Control Panel Immediate Script: &nhs.PluginFunction("MQTT","","publish",{"homeseer/something","1234"})
Mar-13 6:13:03 PM	 	Info	Running immediate script: C:\Program Files (x86)\HomeSeer HS3\Temp\K2.vb
What version of HS3 are you running and on what OS?

Cheers
Al
Doug Meredith
Starting Member
Starting Member
Posts: 6
Joined: Tue Feb 28, 2017 6:33 pm

Re: HS3 MQTT Plugin

Post by Doug Meredith »

I get the same error with either of the immediate scripts you posted. What is the difference between "hs" and "nhs"?

I'm using a Hometroller Zee 2 (so Linux), with HomeSeer 3.0.0.312 and version 1.4.0.0 of the MQTT plugin.
Sparkman
Starting Member
Starting Member
Posts: 29
Joined: Wed Sep 09, 2015 5:57 am

Re: HS3 MQTT Plugin

Post by Sparkman »

nhs forces the script command to run as vb.net whereas on Windows, using hs will run it as vbscript. Since the Zee does not support vbscript, the nhs and hs commands likely do exactly the same thing on a Zee. Since it works under Windows/.NET, I'm guessing its an issue with Mono on the Zee 2. You could try upgrading mono (search the HS board), but I would do an image of the SD card in the Zee first.

Cheers
Al
Scott
Starting Member
Starting Member
Posts: 1
Joined: Sun Mar 26, 2017 4:33 am

Re: HS3 MQTT Plugin

Post by Scott »

seanwill2 wrote:geert-jan,

Can I create a device that can subscribe and publish? When I try to setup a HS device to allow for any input to a subscribed device it will not allow any controls to be created.
This is literally the only thing missing that's keeping me from buying a whole ton of MQTT devices. I'd rather have a single device in Homeseer that can control and update status. Right now I have a work around using a handful of events that's cumbersome.

Just need to set a subscribe topic and a publish topic on the same device.
Yazzcat1
Starting Member
Starting Member
Posts: 2
Joined: Mon Mar 27, 2017 12:31 pm

Re: HS3 MQTT Plugin

Post by Yazzcat1 »

With the latest update of HS3, the option of 'Linked Device' is introduced. If you would create 2 devices, one for subscribing to a status and one for controlling it, from the first device, you can link it to the second. That way, if the status is updated, the control device is updated as well. No need anymore for a special event.
Yazzcat1
Starting Member
Starting Member
Posts: 2
Joined: Mon Mar 27, 2017 12:31 pm

Re: HS3 MQTT Plugin

Post by Yazzcat1 »

Can you help me on this one. Maybe it was covered before, but I could not find it. I need to change the MQTT topic for quite a lot of devices that have subscribed to specific MQTT topics. I know I can change the publish topics, but I cannot find a way to change the topics of the subscriptions. I see the topic is stated in the Technology Address, but I cannot seem to change this.

Also, could not find any .ini file that is storing these topics...

Any ideas?

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

Re: HS3 MQTT Plugin

Post by geert-jan »

Hi,

when creating a new MQTT 'subscription' a Homeseer device is created where the MQTT topic is used as Technology Address. After creating the Homeseer device it is not possible to change the Technology Address. At the moment I cannot offer a mechanism to update the MQTT topic, besides creating a new device and delete the old one.

Regards,
Geert-Jan
pklijnjan
Member
Member
Posts: 61
Joined: Mon Aug 31, 2009 11:49 am
Location: Netherlands

Re: HS3 MQTT Plugin

Post by pklijnjan »

Hi I like to use this plugin with happy-bubbels recievers.
I now work with ibeacons and a mqtt reciever from china. (also works nice)
Is there a way to recieve the posts by using subscription like happy-bubbles/ble/livingroom/ibeacon/# ?
The reciever send the signals of the beacons like happy-bubbles/ble/<the-hostname>/ibeacon/<the-iBeacon-UUID>
in a json format. Even beter if I can recieve the json fields as devices value/strings:)!

thanks for the plugin it works great when you cab supsribe to one subsription.
geert-jan
Member
Member
Posts: 126
Joined: Sat Nov 27, 2010 7:23 pm

Re: HS3 MQTT Plugin

Post by geert-jan »

Hi,

JSON payload is currently not supported in the MQTT plugin. JSON support is on my feature list.

Regards,
Geert-Jan
pklijnjan
Member
Member
Posts: 61
Joined: Mon Aug 31, 2009 11:49 am
Location: Netherlands

Re: HS3 MQTT Plugin

Post by pklijnjan »

Ok I hope you can make the JSON soon:)

And the other question on subscripe to en topic with a wildcard like /# ?
Doug Meredith
Starting Member
Starting Member
Posts: 6
Joined: Tue Feb 28, 2017 6:33 pm

Re: HS3 MQTT Plugin

Post by Doug Meredith »

There are lots of JSON libraries out there, so it's quite possible to do JSON payloads already. It's your plugin, but you might want to consider keeping your focus on true MQTT functionality, rather than peripheral things like that.
critical_
Starting Member
Starting Member
Posts: 3
Joined: Tue May 16, 2017 12:13 pm

Re: HS3 MQTT Plugin

Post by critical_ »

geert-jan wrote:Hi,

adding controls for is not yet supported. I added your request to the feature list.

Regards,
Geert-Jan
Any chance we could get this item bumped up on the feature list? Being able to create a device that can subscribe and publish is what I am waiting for. Thanks for an awesome plugin.
EmilySmith1
Starting Member
Starting Member
Posts: 3
Joined: Mon Jul 17, 2017 7:28 am

Re: HS3 MQTT Plugin

Post by EmilySmith1 »

Hi guys
I want to integrate my HS3 with sonoff relay using MQTT protocol
https://www.itead.cc/sonoff-wifi-wireless-switch.html

I have flashed sonoff with Tasmota and currently connected with my local network
https://github.com/arendst/Sonoff-Tasmota

HS3 and mosquito broker is installed on same computer running windows 7 with IP 192.168.1.102


kindly Help me for setting up sonoff device
Emi

Images are attached
Attachments
MQTT Page
MQTT Page
MQTT.PNG (51.54 KiB) Viewed 20659 times
Network Settings
Network Settings
Setting.PNG (220.76 KiB) Viewed 20659 times
Main Page
Main Page
Homeseer.PNG (82.34 KiB) Viewed 20659 times
Tasmota Command
Tasmota Command
Command.PNG (298.71 KiB) Viewed 20659 times
MQTT Config
MQTT Config
Config.PNG (95.68 KiB) Viewed 20659 times
Post Reply

Return to “Homeseer MQTT Plugin Forum”