Page 12 of 16

HS3 MQTT Plugin

Posted: Sun Mar 12, 2017 11:46 pm
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

Re: HS3 MQTT Plugin

Posted: Mon Mar 13, 2017 3:38 am
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.

Re: HS3 MQTT Plugin

Posted: Tue Mar 14, 2017 2:17 am
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

Re: HS3 MQTT Plugin

Posted: Tue Mar 14, 2017 4:17 am
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.

Re: HS3 MQTT Plugin

Posted: Wed Mar 15, 2017 3:04 am
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

Re: HS3 MQTT Plugin

Posted: Sun Mar 26, 2017 4:36 am
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.

Re: HS3 MQTT Plugin

Posted: Tue Mar 28, 2017 10:01 am
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.

Re: HS3 MQTT Plugin

Posted: Tue Mar 28, 2017 10:04 am
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!

Re: HS3 MQTT Plugin

Posted: Mon Apr 03, 2017 8:24 am
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

Re: HS3 MQTT Plugin

Posted: Tue May 09, 2017 5:34 pm
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.

Re: HS3 MQTT Plugin

Posted: Wed May 10, 2017 7:08 am
by geert-jan
Hi,

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

Regards,
Geert-Jan

Re: HS3 MQTT Plugin

Posted: Wed May 10, 2017 11:16 am
by pklijnjan
Ok I hope you can make the JSON soon:)

And the other question on subscripe to en topic with a wildcard like /# ?

Re: HS3 MQTT Plugin

Posted: Wed May 10, 2017 2:03 pm
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.

Re: HS3 MQTT Plugin

Posted: Tue May 16, 2017 12:22 pm
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.

Re: HS3 MQTT Plugin

Posted: Mon Jul 17, 2017 8:02 am
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