www.homeseer.com    
 

Go Back   HomeSeer Message Board > 3rd Party Plug-Ins/Scripts > Plug-ins by Author > Click Here for List of Author Forums > MCS Plug-Ins and Scripts > mcsMQTT (3P)

mcsMQTT (3P) Discussion of mcsMQTT plug-in

Reply
 
Thread Tools Display Modes
  #1  
Old December 13th, 2017, 11:40 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,706
mcsMQTT Plugin

I have become involved with low cost IoT devices with MQTT being the primary means for non-cloud (or cloud) communication and integration. To make it easy to fit into my existing Homeseer environment I have developed mcsMQTT.

This plugin retains HS as the central node in the automation environment and allows MQTT-literate devices to be utilized. While HS Events can be triggered based upon MQTT Topics and Event Actions can publish Topics, the primary integration is with the HS DeviceValue and DeviceString. Changes in HS devices or changes in MQTT Topic payloads are seamlessless reflected with the mcsMQTT bridge.

Change Log
PR 1 12/20/2017 3.0.1.0 Add optional payload specification in MQTT event trigger
PR 2 12/20/2017 3.0.1.0 Define payload OPEN/CLOSE, ON/OFF Device-Status-Graphics pairs for DeviceValue 1/0, map these payloads to 1/0 DeviceValue updates
PR 3 12/20/2017 3.0.1.0 Honor "SET_DOES_NOT_CHANGE_LAST_CHANGE" device property checkbox when updating DeviceLastChange
PR 4 12/21/2017 3.0.1.1 Device Value and String changes not being reflected in new MQTT messages
PR 5 12/21/2017 3.0.1.2 Add debug focused around HSEvent processing
PR 6 12/22/2017 3.0.2.0 Provide bidirectional status and control in single HS3 device
PR 7 12/29/2017 3.0.3.0 JSON parsing of MQTT payload results in exception and log message
PR 8 12/29/2017 3.0.3.0 "A"ccept set true on initialization based upon presence of HS device with the associated Device Ref property
PR 9 12/29/2017 3.0.3.0 Backup of database created on each plugin start, backup retained for 6 months
PR10 1/3/2018 3.0.4.0 Add info to HS3 Device PED and synchronize with database
PR11 1/3/2018 3.0.4.0 Improve initial creation of database so restart is not needed
PR12 1/3/2018 3.0.4.1 Change HS3 connection from 192.168.0.194 to localhost
PR13 1/3/2018 3.0.4.2 Protect Topic from single and double quote in database operations
PR14 1/7/2018 3.0.4.3 Parsing error with training JSON } not removed
PR15 1/8/2018 3.0.4.4 Parsing error reversion, broke earlier correct parsing
PR16 1/9/2018 3.0.5.0 Add ability to specify arbitrary subscription topics
PR17 1/9/2018 3.0.6.0 Parsing exception ala PR7
PR18 1/9/2018 3.0.6.0 Provide Regular Expression replacement on Payload to Device
PR19 1/9/2018 3.0.6.1 Subscription does not include both $SYS and # Topics
PR20 1/10/2018 3.0.7.0 Provide Extract vs. Replace option on regular expressions
PR21 1/18/2018 3.0.7.1 Numbers in payload exceeding 2^32 generate an Int32 exception
PR22 2/14/2018 3.0.8.0 Provided the option to reduce traffic with subscription to only accepted topics
PR23 2/14/2018 3.0.8.0 Fixed broker authentication and used *** for password on setup page
PR24 2/20/2018 3.0.8.1 Settings other than default sometimes not remembered
PR25 2/26/2018 3.0.9.0 Add option to publish button label or button value
PR26 3/5/2018 3.0.9.1 Correct version number (3 to 4 digits) showing in HS log at startup
PR27 3/5/2018 3.0.9.1 Split Topic and JSON filter into two rows to reduce column width
PR28 3/5/2018 3.0.9.1 Fix Install.txt vs. install.txt to allow updater on Linux to work correctly
PR29 3/8/2018 3.0.9.2 Plugin not connecting to HS (hardcoded IP used for testing)
PR30 3/13/2018 3.0.9.3 HS3 device changes on Linux not being published as MQTT topics
PR31 3/13/2018 3.0.9.3 RegEx boxes removed for non-plugin devices
PR31 3/13/2018 3.0.9.3 Debug adjusted to assist with timing measurements
PR32 3/13/2018 3.0.9.4 HS3 source devices auto accepted on startup
PR33 3/14/2018 3.0.10.0 Streamline HS Event callback CPU use
PR34 3/14/2018 3.0.10.0 Add tool tips for hover on browser page
PR35 3/14/2018 3.0.10.0 Change QOS radio style to traditional rendering
PR36 3/14/2018 3.0.10.0 Allow user to select value/status/string on non-plugin device publishing
PR37 3/14/2018 3.0.10.0 Allow user to specify the non-plugin device topics being published
PR38 3/15/2018 3.0.10.1 Add protection for reading null database fields caused by adding new fields in 3.0.10.0
PR39 3/16/2018 3.1.0.0 Revamped UI to improve understandability
PR40 3/16/2018 3.1.0.0 Added manual topic entry/edit
PR41 3/16/2018 3.1.0.0 Added options to manage HS device enumeration and subscription display
PR42 3/16/2018 3.1.0.0 Improved startup timing and page build timing
PR43 3/18/2018 3.1.1.0 Dynamic updates of UI based upon user interaction
PR44 3/20/2018 3.1.2.0 Provided tabbed setup page
PR45 3/20/2018 3.1.2.0 Add retain default and topic-specific user input
PR46 3/20/2018 3.1.2.0 Add default QOS user input
PR47 3/20/2018 3.1.2.0 Add message and connection statistics
PR48 3/20/2018 3.1.2.0 Add LWT provisions
PR49 3/20/2018 3.1.2.0 Robust reconnection on dropped connection
PR50 3/20/2018 3.1.2.0 Removed dual purpose of all Association table columns
PR51 3/20/2018 3.1.2.0 Made 0 & 1 Payloads default to Button Off/On devices
PR52 3/21/2018 3.1.3.0 Add Broker Connection Event Trigger
PR53 3/21/2018 3.1.3.0 Add option to create individual mcsMQTT Status Devices in HS
PR54 3/23/2018 3.1.4.0 Add History retention with display filtering
PR55 3/25/2018 3.2.0.0 Completed bidirectional parent/child status relationships
PR56 3/25/2018 3.2.0.0 Color coded table rows to show plugin vs non-plugin rows
PR57 3/25/2018 3.2.0.0 Rebuilt database on initial startup of this version
PR58 3/25/2018 3.2.0.0 Added ability to specify command topics for existing HS devices
PR59 3/25/2018 3.2.0.0 Modified cosmetics for improved understandability
PR60 3/25/2018 3.2.0.0 Included both Sub and Pub topics in pulldown filters
PR61 3/25/2018 3.2.0.0 Added option to prefix with INFO/ or STAT/ (Tasmota convention)
PR62 3/25/2018 3.2.0.0 Added periodic status reporting option
PR63 3/25/2018 3.2.0.0 Removed PED contents and no longer maintain redundancy of data
PR64 3/26/2018 3.2.1.0 Added debug to Event Trigger setup
PR65 3/26/2018 3.2.1.0 Optimized trigger process for received messages
PR66 3/26/2018 3.2.1.0 Added Association filter based upon HS device categories
PR67 3/26/2018 3.2.1.1-3 Debug added to assist in understand disconnect from HS\
PR68 3/27/2018 3.2.2.0 Added receive queue to buffer incoming rates from HS processing rates
PR69 3/27/2018 3.2.2.0 Made JSON payload decoding optional
PR70 3/27/2018 3.2.2.1 Console writes inserted in each HS API call to help debug disconnect
PR71 3/28/2018 3.2.2.2 Postback error when Association Table requested
PR72 3/28/2018 3.2.3.0 Misc cleanup as devices are associated between manual and Assoc tabs
PR73 3/28/2018 3.2.3.0 Added ability to structure JSON devices as parent/child
PR74 3/28/2018 3.2.3.1 Association table does not appear unless browser previously open to mcsMQTT page
PR75 3/28/2018 3.2.3.1 Improved robustness of Association filters being updated as content changes
PR76 3/28/2018 3.2.3.1 Added purple row color for non-plugin devices mapped directly to MQTT topics
PR77 3/28/2018 3.2.4.0 Provided option for parent/child associations on JSON payloads
PR78 3/29/2018 3.2.5.0 Provided ability to display multiple mcsMQTT browser pages at the same time
PR79 3/29/2018 3.2.5.1 Additional debug around SetIOMulti, HSEvent, Triggers, and message reception & action
PR80 3/30/2018 3.2.5.2 RegEx stopped working with 3.5.0.0 (Replace pattern not retained)
PR81 3/30/2018 3.2.5.3 Disconnect flag true does not persist restarts
PR82 3/30/2018 3.2.5.3 Association filter not cleared when topics no longer present
PR83 3/30/2018 3.2.5.3 Subscription to no topics and no discovery causes .net error traps
PR84 3/30/2018 3.2.5.3 Database non-plugin devices are overwritten when an Accept is done ... need to go back to prior database
PR85 4/1/2018 3.2.6.0 Association table does not render unless a receive message has been accepted
PR86 4/1/2018 3.2.6.0 Concurrent thread protection added while topic and dictionaries are being modified
PR87 4/1/2018 3.2.6.0 Feedback provided on table size for larger tables when Show button is pressed
PR88 4/1/2018 3.2.6.0 Database fix only worked for the 3.1.x.x to 3.2.0.0. Not for subsequent 3.2.x.x.
PR89 4/1/2018 3.2.6.0 Protected Topic text in database should quote or single quote happen to be in Topic
PR90 4/1/2018 3.2.6.1 Added debug to isolate object missing message on Build Association Table
PR91 4/2/2018 3.2.7.0 Added special keyword 'change' in Payload of MQTT Receive Trigger to cause trigger on change of payload
PR92 4/2/2018 3.2.7.0 Changed behavior of SetDeviceValueByRef to always trigger rather than only triggering on a change of value
PR93 4/2/2018 3.2.7.1 Debug data file in DatamcsMQTT_Debug.txt rather than Data\mcsMQTT_Debug.txt
PR94 4/2/2018 3.2.7.1 Locate the data files in \Data\mcsMQTT rather than \Data
PR95 4/3.2018 3.2.8.0 Add page scroll buttons on Association tab and limit table size to 20 rows
PR96 4/3/2018 3.2.9.0 Increment DeviceValue if String Payload received and it changed the DeviceString
PR97 4/3/2018 3.2.9.1 Association Page number of rows availalbe is not shown on initial page rendering
PR98 4/3/2018 3.2.9.2 Use same color scheme of pink/green on history as is used on Association and Manual tabs
PR99 4/3/2018 3.2.9.2 Update Manual to 3.2.9 capability
PR100 4/3/2018 3.2.9.3 Duplicate debug files with second at parent directory folder
PR100 4/5/2018 3.2.10.0 Add Config Link to Plugin Page
PR102 4/5/2018 3.2.10.0 Add List Status/Control Type and generalize text to value mapping
PR103 4/6/2018 3.2.11.0 Added "H"istory checkbox on Association tab (and General tab) to select topic to be included in History collection
PR104 4/6/2018 3.2.11.0 Fixed "R"eject button not being accepted on Association tab. Broke in 3.2.5.0
PR105 4/6/2018 3.2.12.0 Updated concurrency (thread protection) logic to allow nested/multilevel protections
PR106 4/6/2018 3.2.12.0 Numeric payloads are being treated as VSP list enumeration
PR107 4/6/2018 3.2.12.0 Add Echo option on General Tab to allow published topics to be seen as subscriptions
PR108 4/7/2018 3.2.12.1 Fix Echo enable
PR109 4/7/2018 3.2.12.1 Improve auto VSP logic when devcie accepted from Association tab
PR110 4/7/2018 3.2.12.1 Provide compatibility with earlier versions of Mono on Linux
PR111 4/7/2018 3.2.12.2 Use default QOS rather than Exactly for Event Publish Actions
PR112 4/7/2018 3.2.12.2 Update manual to 3.2.12 capability
PR113 4/8/2018 3.2.13.0 Provided same page scrolling for History as Association tab to avoid browser overload
PR114 4/8/2018 3.2.13.2 Event MQTT Receive Trigger fails if same topic used in multiple events
PR115 4/9/2018 3.2.14.0 Added substitution variables for use in templates for published topic and payload formats
PR116 4/10/2018 3.2.14.1 Statistics Accept counts incorrect and no History records for accepted topics
PR117 4/10/2018 3.2.14.2 History date range does not default to valid range so filtered records to not show
PR118 4/11/2018 3.2.14.3 Error trap during MQTTSubscribe does not properly manage sync flags
PR119 4/11/2018 3.2.15.0 Allow entry of Broker port other than 1883
PR120 4/11/2018 3.2.15.1 Text Status/Control type creates VSP so even when DeviceString is set it does not appear
PR121 4/12/2018 3.2.16.0 First segment of substitution template not include in topic or payload
PR122 4/12/2018 3.2.16.0 Encode topic reserved symbols per HTML %## convention
PR123 4/12/2018 3.2.16.0 Added SSL support, testing limited to UI
PR124 4/12/2018 3.2.16.1 Forced On/Open=1, Off/Closed=2 when these payloads are available
PR125 4/12/2018 3.2.16.2 Manual tab entry of Ref number will populate either plugin or nonplugin table
PR126 4/13/2018 3.2.17.0 Compiled with .NET 4.5 vs. prior .NET 4.0
PR127 4/13/2018 3.2.17.0 Added table at top of Manual tab to allow user to select either Ref or Sub Topic
PR128 4/13/2018 3.2.18.0 Made List control/status UI only manual user select, Text is now default
PR129 4/13/2018 3.2.18.0 Added Color Picker as Control UI option
PR130 4/14/2018 3.2.19.0 Converted Association Ref to a button that will populate Manual Tab
PR131 4/15/2018 3.2.19.1 Prefix Color Picker publish RGB payload with # (e.g. #AAFF20)
PR132 4/15/2018 3.2.19.1 Remove debug output for Name and InterfaceStatus calls
PR133 4/16/2018 3.2.19.4 Additional debug during storing payloads in HS devices
PR134 4/17/2018 3.2.20.0 Added MISC properties as user-settable
PR135 4/17/2018 3.2.20.0 Cleared MISC NO-STATUS_DISPLAY for most UI's
PR136 4/17/2018 3.2.20.0 Assured Association & History filters are not masked by prior selection that are no longer availalbe
PR137 4/24/2018 3.3.0.0 Added Chart tab
PR138 4/24/2018 3.3.0.0 removed Label/Number radio for publish, now use payload template with $$value: to publish number
PR139 4/24/2018 3.3.0.0 removed string, status, value publish checkboxes, now use payload template
PR140 4/26/2018 3.3.0.1 corrected tool tip typos and added tool tip reference to the manual
PR141 4/26/2018 3.3.0.2 Added DISARMED/ARMED and OFFLINE/ONLINE as additional special case two-state pairs
PR142 4/26/2018 3.3.0.2 fixed button type when transitioning from number to button and no VSP have yet been recorded
PR143 4/29/2018 3.3.0.3 Changed Manual tab to Edit tab nomenclature
PR144 4/29/2018 3.3.0.3 Added text and figures to Section 10 of manual for tool tip reference
PR145 5/4/2018 3.3.1.0 Added popup window for edit of association properties
PR146 5/5/2018 3.3.2.0 Added HTTP request for chart build with querystring parameters
PR147 5/8/2018 3.3.3.0 Added chart definition and expanded options for chart appearance
PR148 5/8/2018 3.3.3.0 Added ability to popup chart by clicking Association tab payload
PR149 5/9/2018 3.3.3.1 Publish topics not appearing on chart topic selector
PR150 5/11/2018 3.3.4.0 Added Expressions, Filter, Derivative and Integral numeric transforms
PR151 5/12/2018 3.3.4.1 Publish from HS device control no longer works
PR152 5/12/2018 3.3.4.2 Added debug around browser postback
PR153 5/14/2018 3.3.5.0 Added Publication List tab
PR154 5/14/2018 3.3.5.1 Removed debug for WebPage and Register events
PR155 5/15/2018 3.3.6.0 Populate Non-plugin devices from database when Enumerate with button is selected
PR156 5/15/2018 3.3.6.0 Add Time base option for rate device
PR157 5/15/2018 3.3.6.0 Add Delta from midnight option for accum device
PR158 5/16/2018 3.3.6.1 Protection for divide by zero does not exist in rate calculation
PR159 5/17/2018 3.3.7.0 Substitution variables added to publication list file
PR160 5/17/2018 3.3.7.0 Manual updated for Irrigation Control with mcsTasmota firmware
PR170 5/18/2018 3.3.8.0 Added plugin link to mcsMQTT Doc
PR171 5/18/2018 3.3.8.0 Improved alignment of HTML pages to match size of tab canvas
PR172 5/19/2018 3.4.0.0 VSP Topics protected from special database characters in the database
PR173 5/19/2018 3.4.0.0 Improved reliability of filter pulldowns on Association tab
PR174 5/19/2018 3.4.0.0 Added charting for HS Device Values ... including mcsMQTT rate and accum devices
PR175 5/20/2018 3.4.0.2 VSP edit broke for case of deleting VSP entries
PR176 5/20/2018 3.4.0.3 Transform table topics protected from special characters in the database
PR177 5/20/2018 3.4.0.4 Protect from access of objects for chart before chart objects created
PR178 5/20/2018 3.4.1.0 Add delete button on Edit tab to remove obsolete topics and devices from database
PR179 5/31/2018 3.4.2.0 Encrypted broker passwords in mcsMQTT.ini
PR180 5/31/2018 3.4.2.0 New SSL implementation provided by vasrc
PR181 6/17/2018 3.4.2.1 Association filter for second JSON position does not appear, but still used in filter
PR182 6/19/2018 3.4.3.0 Add clear button on the pulldown filters
PR183 6/19/2018 3.4.3.0 Don't publish is subscribe topic is same as publish topic and subscribe message received within 15 seconds.

Documentation/Manual http://mcsSprinklers.com/mcsMQTT.pdf
How-To Guides from post #250, #259 & #304 by taylormia attached
Attached Images
File Type: pdf HS3-S20-mcsMQTT-HowTo-v1.pdf (1.23 MB, 56 views)
File Type: pdf HS3-Sonoff4CHPro-GarageDoor-mcsMQTT-HowTo.pdf (1.55 MB, 31 views)
File Type: pdf RFLink-Weather-Node-Red-HS3-mcsMQTT-HowTo.pdf (1.70 MB, 10 views)

Last edited by Michael McSharry; June 19th, 2018 at 09:33 PM.
Reply With Quote
  #2  
Old December 14th, 2017, 03:07 AM
Summerguy's Avatar
Summerguy Summerguy is offline
Seer Deluxe
 
Join Date: Aug 2017
Location: Canada
Posts: 386
Hi,

how can we install this plugin?

thank you
Reply With Quote
  #3  
Old December 14th, 2017, 08:11 AM
vasrc's Avatar
vasrc vasrc is offline
Seer Master
 
Join Date: May 2003
Location: Locust Dale, VA
Posts: 1,214
Quote:
Originally Posted by Michael McSharry View Post
I have become involved with low cost IoT devices with MQTT being the primary means for non-cloud (or cloud) communication and integration. To make it easy to fit into my existing Homeseer environment I have developed mcsMQTT.

This plugin retains HS as the central node in the automation environment and allows MQTT-literate devices to be utilized. While HS Events can be triggered based upon MQTT Topics and Event Actions can publish Topics, the primary integration is with the HS DeviceValue and DeviceString. Changes in HS devices or changes in MQTT Topic payloads are seamlessless reflected with the mcsMQTT bridge.
Nice work, you can tell what you do for a living

I wasn't clear on whether the Broker connection will support port 8883/TLS? Will it support a CA cert?

Also, did you use the Event/script interfaces for processing pub/sub rather than using the plugin to map them directly to the HS3 device (or did I miss that?). Clearly the Event/script method gives you more flexibility (ie translating HS3 device/string values to/from field device payloads)

When do we get to play with it

Thanks,
Z
Reply With Quote
  #4  
Old December 14th, 2017, 09:48 AM
kideon kideon is offline
Seer Master
 
Join Date: May 2014
Location: virginia
Posts: 824
So what sort of applications would mqtt be useful for? I’ve been wanting to mess around with something new.
Reply With Quote
  #5  
Old December 14th, 2017, 10:05 AM
Fischi Fischi is offline
Seer Master
 
Join Date: Oct 2012
Location: Germany
Posts: 518
Hi,
Isn't it the same as this http://dzjee.xs4all.nl/hs3/mqtt/mqtt.html ?

Fischi
Reply With Quote
  #6  
Old December 14th, 2017, 03:40 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,706
Quote:
how can we install this plugin?
I have submitted the request to HST to include it in the updater. The install file that the updater will use is at http://mcsSprinklers.com/mcsMQTT_3_0_0_0.zip. You can manually installed now per guidance in the manual or wait for it to show up in the updater.

Quote:
I wasn't clear on whether the Broker connection will support port 8883/TLS? Will it support a CA cert?
I have not been concerned with security in my environment, but the underlying software does support it. If you are concerned then I can enable it. It is something we can pursue together if you are interested.

Quote:
Also, did you use the Event/script interfaces for processing pub/sub rather than using the plugin to map them directly to the HS3 device (or did I miss that?). Clearly the Event/script method gives you more flexibility (ie translating HS3 device/string values to/from field device payloads)
I have provided all options that best suits the user's orientation and environment. In my case I am Device and not Event oriented so I have mapped Topics to Devices and used Device Value/String to manage the Payload. Others that are Event oriented can trigger an Event on a Topic received or use the Event Action to publish a Topic/Payload.

Quote:
So what sort of applications would mqtt be useful for? I’ve been wanting to mess around with something new.
I have been using an xAP environment for distributed computing for many years. MQTT is a minor variation from xAP with respect to integrating many remote entities. This mcsMQTT plugin was a very easy port of mcsXap plugin.
What moved me to include MQTT is the ESP8266/Sonoff units that sell for under $5 and these include the power supply, Wifi, Relay, multiple discretes and a well supported software environment for hacking. Emulation for Wemo and Hue is included so Echo/Alexa voice control is built in. My first two applications are to provide intelligent Wifi Garage Door interface and a Wifi water meter counter to replace one that has sometimes given me problems on 1-Wire.

Quote:
Isn't it the same as this http://dzjee.xs4all.nl/hs3/mqtt/mqtt.html ?
Both understand MQTT protocol. It is the user interface, orientation and the degree of integration with HS that are different. If one has a distributed mind-set and HS3 is just one more node then a simple publish/subscribe works well. If one has a master/central mind-set then mcsMQTT should be easier to integrate MQTT with HS3.

Last edited by Michael McSharry; December 14th, 2017 at 06:19 PM.
Reply With Quote
  #7  
Old December 14th, 2017, 04:42 PM
snowboarder snowboarder is offline
Seer
 
Join Date: Oct 2002
Posts: 43
when i click the download link i get a 404 error ?

Quote:
Originally Posted by Michael McSharry View Post
I have submitted the request to HST to include it in the updater. The install file that the updater will use is at http://mcsSprinklers.com/mcsMQTT_3.0.0.0.zip. You can manually installed now per guidance in the manual or wait for it to show up in the updater.


I have not been concerned with security in my environment, but the underlying software does support it. If you are concerned then I can enable it. It is something we can pursue together if you are interested.


I have provided all options that best suits the user's orientation and environment. In my case I am Device and not Event oriented so I have mapped Topics to Devices and used Device Value/String to manage the Payload. Others that are Event oriented can trigger an Event on a Topic received or use the Event Action to publish a Topic/Payload.


I have been using an xAP environment for distributed computing for many years. MQTT is a minor variation from xAP with respect to integrating many remote entities. This mcsMQTT plugin was a very easy port of mcsXap plugin.
What moved me to include MQTT is the ESP8266/Sonoff units that sell for under $5 and these include the power supply, Wifi, Relay, multiple discretes and a well supported software environment for hacking. Emulation for Wemo and Hue is included so Echo/Alexa voice control is built in. My first two applications are to provide intelligent Wifi Garage Door interface and a Wifi water meter counter to replace one that has sometimes given me problems on 1-Wire.


Both understand MQTT protocol. It is the user interface, orientation and the degree of integration with HS that are different. If one has a distributed mind-set and HS3 is just one more node then a simple publish/subscribe works well. If one has a master/central mind-set then mcsMQTT should be easier to integrate MQTT with HS3.
Reply With Quote
  #8  
Old December 14th, 2017, 05:51 PM
vasrc's Avatar
vasrc vasrc is offline
Seer Master
 
Join Date: May 2003
Location: Locust Dale, VA
Posts: 1,214
Quote:
Originally Posted by snowboarder View Post
when i click the download link i get a 404 error ?
Try:
http://mcssprinklers.com/mcsMQTT_3_0_0_0.zip

Z
Reply With Quote
  #9  
Old December 14th, 2017, 08:20 PM
petez69's Avatar
petez69 petez69 is offline
Seer Master
 
Join Date: Oct 2005
Location: Alice Springs, Australia
Posts: 873
Michael

As you say the Sonoff devices are a no-brainer. I grabbed a few on the 11.11 Aliexpress sale and having fun with them. I've just bought teh 16A version with current sense and one of the tri-colour LEDS .....all very neat stuff :-)

Pete
Reply With Quote
  #10  
Old December 16th, 2017, 09:37 AM
snowboarder snowboarder is offline
Seer
 
Join Date: Oct 2002
Posts: 43
When i enable the plugin in homeseer i get the this error ?

WARNING: Failed getting InterfaceStatus from mcsMQTT - the interface was not found in the list of active interfaces, the list may need to be refreshed
Reply With Quote
  #11  
Old December 16th, 2017, 09:49 AM
snowboarder snowboarder is offline
Seer
 
Join Date: Oct 2002
Posts: 43
Quote:
Originally Posted by snowboarder View Post
When i enable the plugin in homeseer i get the this error ?

WARNING: Failed getting InterfaceStatus from mcsMQTT - the interface was not found in the list of active interfaces, the list may need to be refreshed
When i start in Homeseer in Developer Mode i see that the plugin want to connect to server ip 192.168.0.194 . this is not the ip of my homeseer server.
Reply With Quote
  #12  
Old December 16th, 2017, 10:36 AM
vasrc's Avatar
vasrc vasrc is offline
Seer Master
 
Join Date: May 2003
Location: Locust Dale, VA
Posts: 1,214
Quote:
Originally Posted by snowboarder View Post
When i start in Homeseer in Developer Mode i see that the plugin want to connect to server ip 192.168.0.194 . this is not the ip of my homeseer server.
Download the zip file again. He's fixed that in the latest one.

Z
Reply With Quote
  #13  
Old December 16th, 2017, 01:40 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,706
I compiled/uploaded a third time to connect to localhost rather than .194.
Reply With Quote
  #14  
Old December 17th, 2017, 09:11 AM
petez69's Avatar
petez69 petez69 is offline
Seer Master
 
Join Date: Oct 2005
Location: Alice Springs, Australia
Posts: 873
Michael

Thanks mate, this is a ripper of a plugin. Took me a little time to understand your config page but I've got it happily driving a Tasmota/Sonoff basic relay. Setup a virtual device with a back end script to turn the device on and off, thats now also working with Alexa....

Great work mate, very happy

Pete
Reply With Quote
  #15  
Old December 20th, 2017, 08:14 AM
petez69's Avatar
petez69 petez69 is offline
Seer Master
 
Join Date: Oct 2005
Location: Alice Springs, Australia
Posts: 873
Michael

I'm a little stumped as to how to trigger an event from a received MQTT topic. Actually its probably not a topic, its a device I've created as a result of /stat/wemos-sonoff/POWER

The device on the web page turns on and off fine as I ground the wemos PIN. What I cant seem to work out is how to trigger an event from this.

What device value is on/off or do I need to define this myself ?

I've gone into status graphics and set 0 to off and 1 to on....I cant seem to trigger an event from on or off/0 or 1 device status and value....

Clearly missing something simple....

Appreciate your guidance

Pete
Reply With Quote
  #16  
Old December 20th, 2017, 08:29 AM
petez69's Avatar
petez69 petez69 is offline
Seer Master
 
Join Date: Oct 2005
Location: Alice Springs, Australia
Posts: 873
Michael

I've created a device from stat/mqtt/alive

Seem to have an issue with the device adhering to the checkbox being turned off:

Do not update device last change time
if device value does not change:

I've turned this off and sent the following:

mosquitto_pub -d -t stat/mqtt/alive -m ping

If I send it in a minutes time, the timestamp on the web page doesnt change. If I change the payload then it updates the data on the web page fine. I was going to run a crontab on the raspberrypi every 5 mins so I can keep tab of the device being alive. I know you have another way to do it which is fine but curious as to why this is happening ?

Any ideas ?

Thanks Pete
Reply With Quote
  #17  
Old December 20th, 2017, 03:20 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,706
Quote:
I'm a little stumped as to how to trigger an event from a received MQTT topic. Actually its probably not a topic, its a device I've created as a result of /stat/wemos-sonoff/POWER

The device on the web page turns on and off fine as I ground the wemos PIN. What I cant seem to work out is how to trigger an event from this.

What device value is on/off or do I need to define this myself ?

I've gone into status graphics and set 0 to off and 1 to on....I cant seem to trigger an event from on or off/0 or 1 device status and value....

Clearly missing something simple....

Appreciate your guidance
What is the payload on the Topic /stat/wemos-sonoff/POWER?

If it is 0/1 then the DeviceValue will change between these two values. If you have status-graphics pairs setup for 0 and 1 values then the Status should show whatever graphics you setup for these two states.

If it is OFF/ON then the DeviceValue should never change from 0 and the DeviceString will contain the payload.

HS Events will support a change in DeviceValue. There are 3rd party plugins that will do DeviceString as the trigger.

There are two things I have been considering. One is the case where non-numeric payloads are received. In this case then look up to see if a status pair has been defined by the user and then store the numeric value if it matches.

The other is to expand the MQTT trigger to include the payload. This would allow trigger on a message reception based upon a payload for a topic rather than just a topic. This would allow two events to be setup where one is for an ON payload and the other for an OFF payload, as an example.

Quote:
I've created a device from stat/mqtt/alive

Seem to have an issue with the device adhering to the checkbox being turned off:

Do not update device last change time
if device value does not change:

I've turned this off and sent the following:

mosquitto_pub -d -t stat/mqtt/alive -m ping

If I send it in a minutes time, the timestamp on the web page doesnt change. If I change the payload then it updates the data on the web page fine. I was going to run a crontab on the raspberrypi every 5 mins so I can keep tab of the device being alive. I know you have another way to do it which is fine but curious as to why this is happening ?

Any ideas ?
I was not aware of HS3 providing the setting to control the device last change being used for device last refreshed. I will research the API and honor it in the next plugin update.
Reply With Quote
  #18  
Old December 20th, 2017, 07:46 PM
petez69's Avatar
petez69 petez69 is offline
Seer Master
 
Join Date: Oct 2005
Location: Alice Springs, Australia
Posts: 873
Quote:
Originally Posted by Michael McSharry View Post
What is the payload on the Topic /stat/wemos-sonoff/POWER?

If it is OFF/ON then the DeviceValue should never change from 0 and the DeviceString will contain the payload.


There are two things I have been considering. One is the case where non-numeric payloads are received. In this case then look up to see if a status pair has been defined by the user and then store the numeric value if it matches.

The other is to expand the MQTT trigger to include the payload. This would allow trigger on a message reception based upon a payload for a topic rather than just a topic. This would allow two events to be setup where one is for an ON payload and the other for an OFF payload, as an example.
Michael

OK, payload is ON or OFF, that's what the tasmota firmware sends, hence this is why devicevalue never changes. Understand I could use another plugin but I'd prefer not to as it would then require additional configuration for a single device to enable triggers to occur.

So to expand the trigger on payload, that is something you would need to code ? I did read your documentation and I see you can trigger on topic but not payload. Is this something you could consider as it would make the triggering of events very simple if we could define the payload and not just the topic. This will make using your plugin with the sonoff tasmota firmware a total breeze to use.

And thankyou for considering the change in code to honour the API. Again this means I can run a cronjob on the broker and track the "keepalive". I did note you have a trigger option if it doesnt get a message in a self determined timeframe.

Cheers & regards..Pete
Reply With Quote
  #19  
Old December 21st, 2017, 12:05 AM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,706
I made the updates discussed. I do not see the plugin in the updater yet. I have not updated the manual yet either. You can get it at http://mcsSprinklers.com/mcsMQTT_3_0_1_0.zip

If you have a message received that has case-insensitive OPEN, CLOSED, ON, or OFF as the Payload when the Topic is accepted then the created device will create Device-Value-Graphic pairs and handle OPEN/ON as DeviceValue=1 and CLOSED/OFF as DeviceValue=0. In this case the DeviceString will not be updated and the Status shown will be from the Device-Value-Graphic that is setup. If you want different text or icons then they can be edited. If it not a number and not one of these four then the DeviceValue will not be updated. In the future I think I will expand this to map every text string received on a topic to a unique DeviceValue so they will be treated as an enumeration and DeviceValue changes can be used in events to achieve desired trigger results.

For other non-numeric payloads the DeviceString will be updated and the Status will show up as the DeviceString. For all others the DeviceString will be cleared. Device Management of Devices can be used to provide suffix, prefix and some other formatting information for Status. For example, a number is treated by default as a Dim level. I change mine to add a suffix (e.g. Minutes) to provide a meaning to the number and remove the Dim prefix.

DeviceLastChange is now explicitly updated based upon the device's checkbox. It will either update the date on a value change or upon new topic reception based upon the checkbox.

MQTT Receive trigger how has provisions for the Payload. It likely means that you will need to redefine existing MQTT Receive Trigger Events.

Last edited by Michael McSharry; December 21st, 2017 at 12:17 AM.
Reply With Quote
  #20  
Old December 21st, 2017, 02:21 AM
drodegeb drodegeb is offline
Seer Deluxe
 
Join Date: Oct 2002
Posts: 184
This plugin is great!

How do you do the suffix part? I've been searching through the device config pages, and the plugin and can't find it. I have temperature and humidify values that are coming up as "DIM xx%", for the temperature one I would like to remove DIM and % and add F, for humidity I would like to get rid of the DIM.

Thanks

Quote:
Originally Posted by Michael McSharry View Post
For other non-numeric payloads the DeviceString will be updated and the Status will show up as the DeviceString. For all others the DeviceString will be cleared. Device Management of Devices can be used to provide suffix, prefix and some other formatting information for Status. For example, a number is treated by default as a Dim level. I change mine to add a suffix (e.g. Minutes) to provide a meaning to the number and remove the Dim prefix.
__________________
Dave
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ERRO Calling SetIOMulti in plugin Arduino Plugin:Object reference not set to an in fvhemert Arduino Plugin (3P) 5 April 28th, 2017 10:15 AM
Nest Plugin Errors - cannot change temperature via plugin TimSRQ Nest Devices (3P) 2 August 15th, 2016 08:48 AM
Upgrade procedure for ACRF plugin from W800 free plugin htsource ACRF Processor (3P) 14 January 26th, 2006 11:21 AM
Switch-to messages, plugin restart, and plugin startup Michael McSharry Plug-In Development 4 January 27th, 2003 11:20 PM


All times are GMT -4. The time now is 01:12 AM.


Copyright HomeSeer Technologies, LLC