HS3 MQTT Plugin

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

Moderator: Willem4ever

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

Re: HS3 MQTT Plugin

Post by geert-jan »

@glshomeseer; which version of the plugin are you using? The one in the Homeseer updater? I verified the issue on Windows 7 (IE, Chrome, Firefox) and Windows 10 (IE), but could not reproduce the issue.
What OS and browser are you using?

Currently I am implementing scripting capabilities for the MQTT plugin; the publish function is currently under test.

Are more script functions requested? I am in doubt on supporting a subscribe function; subscribing on a single topic and trigger an event (e.g. a script) on value update/change is already supported. Just forwarding all MQTT topics to a script may lead to a performance hit.

Regards,
Geert-Jan
AllanMar
Starting Member
Starting Member
Posts: 4
Joined: Sat Dec 12, 2015 9:34 pm

Re: HS3 MQTT Plugin

Post by AllanMar »

geert-jan wrote: Currently I am implementing scripting capabilities for the MQTT plugin; the publish function is currently under test.

Are more script functions requested? I am in doubt on supporting a subscribe function; subscribing on a single topic and trigger an event (e.g. a script) on value update/change is already supported. Just forwarding all MQTT topics to a script may lead to a performance hit.
I was thinking I would need some sort of subscribe/callback/event scripting method as I was looking to subscribe to wildcard topics. I don't think I can do this with the current setup, and would have to create individual devices/subscription for each item. I would also need to know the topic AND value in the script.
Eman
Starting Member
Starting Member
Posts: 6
Joined: Tue Nov 29, 2016 10:41 am

Re: HS3 MQTT Plugin

Post by Eman »

Hello geert-jan,

Would you please add an option to publish a topic in the HomeSeer event options, say if you pressed a button in HSTouch you show show a screen by itself but also publish a topic. Why? It would make the scripting function less needed but also have other mqtt clients sub to those topics. Example is the EventGhost plugin for HomeSeer and its MQTT client :http://board.homeseer.com/forumdisplay.php?f=1517

EventGhost: http://plugins.krambriw.net/index.html

Reason:
The option to publish from HomeSeer Web guide doesn't want to "play game"
=====> The job would be made easier for participants to subscribe to topics.
Another good example if you had speak time event/Google calendar event/Motion detected event/Door Bird (door bell event)/Alarm Event. .......... etc. Participants would decide what to do with the topics.

I tried out a topic of Tasker plugin (Phone busy) and it appears in EventGhost!
So think of the possibilities! Say ALARM ===> Google calendar ===> Pop up HSTouch screens ===>Show weather Show who is at the door and the list goes on...........=====>

Note:I tried to start a thread at the HomeSeer message board and they pushed me off topic to herehttp://board.homeseer.com/showthread.php?p=1277463#post1277463



Regards.


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

Re: HS3 MQTT Plugin

Post by geert-jan »

Hi,

I added your request to the feature list for the next release.
Do you want to publish a device value, or a custom topic/value?

Regards,
Geert-Jan
Eman
Starting Member
Starting Member
Posts: 6
Joined: Tue Nov 29, 2016 10:41 am

Re: HS3 MQTT Plugin

Post by Eman »

Nice!

The custom topic/value would be the best. Take a look at this: Kodi2mqtt https://github.com/owagner/kodi2mqtt. It steams topics to MQTT and plus you can also control with custom topics. If only HSTouch would also be able to sub to topics it would make HomeSeer leap to the next level but they are stuck in the past resisting change.
Now what is so wrong with being able to have this: developers.sensetecnic.com/article/a-no ... ontrib-ui/ inside HSTouch? I don't even know if you can import your own graphics. Then..............====> Think about NOW PLAYING and where, Showing status of devices inside HSTouch like who is at the door and may be a link to the video.

These two links: https://github.com/hobbyquaker/awesome-mqtt and github.com/mqtt-smarthome/mqtt-smarthom ... oftware.md I have found to be complehensive and need time to explore!

Anyway thank so much for the hard work.



Eman.
mrqnapper
Member
Member
Posts: 234
Joined: Sat Jun 25, 2011 1:08 pm

Re: HS3 MQTT Plugin

Post by mrqnapper »

I'm using the Mqtt-plugin reading mc-Things IoT sensors from Mosquitto MQTT and I have some questions.

I tried to create some subscriptions and now have this:
mqtt.tiff
mqtt.tiff (69.18 KiB) Viewed 12522 times

But I do not get any I do not get any updates.

Also if I delete some of the created devices than they still appear in the subscriptions list? How to get rid of them?
mqtt2.tiff
mqtt2.tiff (67.74 KiB) Viewed 12522 times
When I start the mqtt I can see that the plugin is connected. So any of you using also Mosquitto (mcThings?) and can help me out here :)

I restarted te plugin an now I get the test/topic form the mqtt mosquitto broker so that works.
mosquitto.tiff
mosquitto.tiff (104.93 KiB) Viewed 12517 times
Eman
Starting Member
Starting Member
Posts: 6
Joined: Tue Nov 29, 2016 10:41 am

Re: HS3 MQTT Plugin

Post by Eman »

Hi mrqnapper,

This happened to me too hence my suggestions in those posts above yours. When I delete the subscribed devices, they don't go away! (I had to uninstall the plugin and also delete the INI file to clear them). And if you try to add from within HomeSeer the UI fails and you have to open it up again to see what you just added. And also the auto additions (SUBs) don't work anymore since the update but you can add manually.
Eman.
geert-jan
Member
Member
Posts: 126
Joined: Sat Nov 27, 2010 7:23 pm

Re: HS3 MQTT Plugin

Post by geert-jan »

All,

I just submitted version v1.3 of the MQTT plugin to homeseer. The new version should be available in the homeseer updater within a couple of days.

Release notes v1.3.0.0:

New features:

General: MQTT plugin supports script capabilities
Supported script functions: publish a MQTT topic
Parameters: object array containing 2 parameters; topic, value
Function name: publish
Example: hs.PluginFunction("MQTT", "", "publish", {"/tmp/myTopic", "1234"})
where "/tmp/topic" is the topic to publish, and "1234" is the value.

General: Added event actions
Description: 2 actions are introduced
- publish device value
- publish custom topic and message

Bug fixes:
- A device value update resulted in logging a 'publish' message, even if no mqtt publish setings have been defined. Now only a 'publish' message is logged, when there is really something published.
- Ignore exceptions when publishing and there is no MQTT publish configuration defined.

Regards,
Geert-Jan
Mario from Spain
Member
Member
Posts: 66
Joined: Wed Dec 04, 2013 11:06 am

Re: HS3 MQTT Plugin

Post by Mario from Spain »

Great! Thank you very much.

Waiting to try it... :-)
noebl1
Starting Member
Starting Member
Posts: 12
Joined: Mon Apr 04, 2016 4:51 pm

Re: HS3 MQTT Plugin

Post by noebl1 »

Looking forward to this as well; Thanks Geert-Jan!
Eman
Starting Member
Starting Member
Posts: 6
Joined: Tue Nov 29, 2016 10:41 am

Re: HS3 MQTT Plugin

Post by Eman »

geert-jan wrote:All,

I just submitted version v1.3 of the MQTT plugin to homeseer. The new version should be available in the homeseer updater within a couple of days.

Release notes v1.3.0.0:

New features:

General: MQTT plugin supports script capabilities
Supported script functions: publish a MQTT topic
Parameters: object array containing 2 parameters; topic, value
Function name: publish
Example: hs.PluginFunction("MQTT", "", "publish", {"/tmp/myTopic", "1234"})
where "/tmp/topic" is the topic to publish, and "1234" is the value.

General: Added event actions
Description: 2 actions are introduced
- publish device value
- publish custom topic and message

Bug fixes:
- A device value update resulted in logging a 'publish' message, even if no mqtt publish setings have been defined. Now only a 'publish' message is logged, when there is really something published.
- Ignore exceptions when publishing and there is no MQTT publish configuration defined.

Regards,
Geert-Jan


B for brilliant! :lol:

Man, you have done it this time. I for one I say thank you so much. You have unlocked the power of the HomeSeer system to the new era of IoT. I will let others define this.
This unlocks the system to tasks which could have taken alot of time scripting and/or creating complex events. Now, and I mean now :mrgreen: you just create/publish a topic and send it out to all the subscribed systems on the network and boy!, watch the magic happen.
When MQTT was presented to the HomeSeer forums, most of the posts were about sensors and much to do about the weather and the like. But think again! .........................


Need we say more?


Best of regards and merry xmass!


Eman.
khriss75
Starting Member
Starting Member
Posts: 6
Joined: Sat Nov 05, 2011 8:01 pm

Re: HS3 MQTT Plugin

Post by khriss75 »

Is it possible to use adafruit online MQTT broker? (io.adafruit.com)

I'd like to use it for the first test but no connection.

IP Address MQTT Broker = io.adafruit.com
MQTT Client Name = blank? or?
Monitor MQTT Broker
Connect anonymous to MQTT broker
MQTT Broker Username = my adafruit username
MQTT Broker Password = my adafruit AIO KEY

Thanks

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

Re: HS3 MQTT Plugin

Post by geert-jan »

Hi,

you can connect to online MQTT brokers.
I verified it with "http://test.mosquitto.org/", with the following settings:
MQTT Client Name: choose any unique name, do not leave empty
Connect anonymous to MQTT broker: Checked

If you have an account try the following settings:
Connect anonymous to MQTT broker: Not checked
and use your adafruit username/password

To verify if the connection is successfull:
Monitor MQTT Broker: Checked
In the logging you will see all MQTT messages from the MQTT broker.

Regards,
Geert-Jan
Fischi
Member
Member
Posts: 76
Joined: Sun Mar 25, 2012 1:06 am

Re: HS3 MQTT Plugin

Post by Fischi »

Hi,
is it possible to use the MQTT plugin to send the RPi's CPU temperature to HomeSeerHS3 and how to do this in detail ?

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

Re: HS3 MQTT Plugin

Post by geert-jan »

Hi,

of course it is possible to send the RPi temperature as MQTT message.
I monitor my UPS status using a python script which is triggered by cron every 5 minutes. Adapt the subprocess.check_output() and re.split() to get the RPi temperature.
Replace the <> parts (MQTT client name, and IP address of your MQTT broker) with your actual configuration.

Code: Select all

#!/usr/bin/python

import subprocess
import re
import paho.mqtt.client as paho

def do_publish(topic, payload):
    topic = "/ups/eaton/" + topic
    client.publish(topic, payload)
    client.loop()

client = paho.Client(<MQTT client name>)
client.connect(<MQTT Broker IP address>)

result = subprocess.check_output(["/bin/upsc", "eaton"])

entries = re.split("\n+", result)

items = [re.split(":", entry, 2) for entry in entries]

for item in items:
    if item[0]:
      do_publish(item[0].strip(), item[1].strip())

client.disconnect()
Regards,
Geert-Jan
Post Reply

Return to “Homeseer MQTT Plugin Forum”