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 April 13th, 2018, 05:33 PM
mwolter mwolter is offline
Seer Deluxe
 
Join Date: Feb 2017
Location: San Diego
Posts: 261
Possible Issue: Not recognizing string

Michael,
Might have found an issue. I have a payload of 1:04:12:51 and it's not recognized as a string.
Attached Images
  
Reply With Quote
  #2  
Old April 13th, 2018, 05:56 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,768
There has been a discussion on this on the 3.2.x.x thread. I believe the default UI is List rather than Text. HS also seems to have an issue forgetting VSP's after they have been deleted. I suggest the following:
Use Manual tab to select Text for your subscription
Use Association tab to remove Accept checkbox and then set it back. It will create a new HS device without the history of the VSP definitions.
Reply With Quote
  #3  
Old April 13th, 2018, 06:04 PM
mwolter mwolter is offline
Seer Deluxe
 
Join Date: Feb 2017
Location: San Diego
Posts: 261
Thanks, that worked.

Noticed the Manual tab has a lot of info populated from the last accepted topic. First time I've noticed this. How is this populated? Is it only on right after a topic is accepted?
Reply With Quote
  #4  
Old April 13th, 2018, 09:57 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,768
Correct, the Association and Manual tabs are synchronized. If some thing is one on one, then the other is updated.
Reply With Quote
  #5  
Old April 14th, 2018, 12:08 AM
mwolter mwolter is offline
Seer Deluxe
 
Join Date: Feb 2017
Location: San Diego
Posts: 261
Great thanks.
Reply With Quote
  #6  
Old April 14th, 2018, 12:12 AM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,768
I changed the List type in 3.2.18.0 to no longer be an auto-determined type, but still available as a user option. This seems to work better with the current behavior of HS.
Reply With Quote
  #7  
Old April 14th, 2018, 06:57 AM
ServiceXp's Avatar
ServiceXp ServiceXp is offline
Seer Master
 
Join Date: May 2015
Location: USA
Posts: 837
Would it be possible to add an additional synchronization method outside of the Accept method.

This would be super handy in making changes.

Sent from my ASUS_Z00AD using Tapatalk
__________________
RJ_Make On YouTube
Reply With Quote
  #8  
Old April 14th, 2018, 08:32 AM
mwolter mwolter is offline
Seer Deluxe
 
Join Date: Feb 2017
Location: San Diego
Posts: 261
That would be a nice feature.
Reply With Quote
  #9  
Old April 14th, 2018, 09:15 AM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,768
Quote:
Would it be possible to add an additional synchronization method outside of the Accept method.
I do not understand the suggestion. Can you elaborate?
Reply With Quote
  #10  
Old April 14th, 2018, 09:27 AM
ServiceXp's Avatar
ServiceXp ServiceXp is offline
Seer Master
 
Join Date: May 2015
Location: USA
Posts: 837
Quote:
Originally Posted by Michael McSharry View Post
I do not understand the suggestion. Can you elaborate?
Currently, the method of synchronization exists when using the "A" button.

I'm suggesting adding an additional method for synchronization (button?).

This would make adjusting Accepted topics entries much easier.
__________________
RJ_Make On YouTube
Reply With Quote
  #11  
Old April 14th, 2018, 09:39 AM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,768
Are you looking for a button that will populate the Manual tab that serves the function of the top two text boxes that are on the Manual tab?

HS uses hyperlink on the device name on Device Management to get to the Edit tabs. This actually brings up a new page. They did not provide a mechanism to my knowledge to get back other than selecting the Device Management from the menu again.
Reply With Quote
  #12  
Old April 14th, 2018, 10:49 AM
mwolter mwolter is offline
Seer Deluxe
 
Join Date: Feb 2017
Location: San Diego
Posts: 261
Possible Issue: Not recognizing string

What I think he’s asking, and what I would like as well, is a button or link next to the accepted topic on the associations tab in the PI setup that populates the manual tab. Just like checking the accepted box does.

This would allow adjustments to the accepted topic without needing to uncheck the accepted box, then check it again. This would be desirable as the device would not lose its customizations or event relationships. For instance, if the device is used in events or has other customizations (parent/child relationship, name, Room, vs pairs) all of these customizations would need to be done again. Some of the customizations (such as event relationships) aren’t easy to see and are easily forgotten. If an event relationship was missed, that particular automation would be broken.
Reply With Quote
  #13  
Old April 14th, 2018, 03:41 PM
ServiceXp's Avatar
ServiceXp ServiceXp is offline
Seer Master
 
Join Date: May 2015
Location: USA
Posts: 837
Quote:
Originally Posted by mwolter View Post
What I think he’s asking, and what I would like as well, is a button or link next to the accepted topic on the associations tab in the PI setup that populates the manual tab. Just like checking the accepted box does.

This would allow adjustments to the accepted topic without needing to uncheck the accepted box, then check it again. This would be desirable as the device would not lose its customizations or event relationships. For instance, if the device is used in events or has other customizations (parent/child relationship, name, Room, vs pairs) all of these customizations would need to be done again. Some of the customizations (such as event relationships) aren’t easy to see and are easily forgotten. If an event relationship was missed, that particular automation would be broken.
This..
__________________
RJ_Make On YouTube
Reply With Quote
  #14  
Old April 14th, 2018, 05:18 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,768
The Ref number on the Association tab is now a button. When clicked the Manual tab is updated with that Ref number information. 3.2.19.0

To clarify what appears to be a usability confusion. One can copy the Ref number (or Subscribe Topic) and paste it into the top of the Manual tab. This will populate it just as the button that just added does.

The Uncheck/Check the Accept box was done to overcome what looks to be a HS problem of remembering previously defined VSP and VGP for a Device. The only way to forget was to create a new device. That is what the Uncheck/Check dance did. Since any edit on the Association row would populate the Manual tab, this action did the population.
Reply With Quote
  #15  
Old April 14th, 2018, 07:01 PM
ServiceXp's Avatar
ServiceXp ServiceXp is offline
Seer Master
 
Join Date: May 2015
Location: USA
Posts: 837
Quote:
Originally Posted by Michael McSharry View Post
The Ref number on the Association tab is now a button. When clicked the Manual tab is updated with that Ref number information. 3.2.19.0

To clarify what appears to be a usability confusion. One can copy the Ref number (or Subscribe Topic) and paste it into the top of the Manual tab. This will populate it just as the button that just added does.

The Uncheck/Check the Accept box was done to overcome what looks to be a HS problem of remembering previously defined VSP and VGP for a Device. The only way to forget was to create a new device. That is what the Uncheck/Check dance did. Since any edit on the Association row would populate the Manual tab, this action did the population.
Understood on the usability concerns, but this is very helpful. And you Sir are the hardest working PI dev I've ever seen here on HS.

You NEED to setup a donation method OR for the love of Pete start charging for this gem!.

Now TAKE MY MONEY!..

Oh and thanks for your help.
__________________
RJ_Make On YouTube
Reply With Quote
  #16  
Old April 15th, 2018, 11:05 AM
mwolter mwolter is offline
Seer Deluxe
 
Join Date: Feb 2017
Location: San Diego
Posts: 261
Thanks Michael!
Reply With Quote
  #17  
Old April 16th, 2018, 10:20 PM
mwolter mwolter is offline
Seer Deluxe
 
Join Date: Feb 2017
Location: San Diego
Posts: 261
Michael,
Getting a little further into configuring devices to send MQTT and not sure what happened but the uptime string values are not showing HS device list. It appears the correct HS Device Control/Status UI is selected in the PI but the device is not displaying the string value.

I also tried changing the uptime to be the number of seconds instead of a formatted string and it still not showing anything on the HS device list.
Attached Images
      
Reply With Quote
  #18  
Old April 16th, 2018, 10:57 PM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,768
The debug may have something if you have it enabled. Also make certain you are using the version in the Updater so the source matches for investigation.
Reply With Quote
  #19  
Old April 16th, 2018, 11:42 PM
mwolter mwolter is offline
Seer Deluxe
 
Join Date: Feb 2017
Location: San Diego
Posts: 261
Was running 3.2.19.0, upgraded to 3.2.19.1. Both were updater versions.

Deleted the device (1093) and recreated it (1094). Attached the debugs.
Attached Files
File Type: txt mcsMQTT Debug-6.txt (6.6 KB, 1 views)
Reply With Quote
  #20  
Old April 17th, 2018, 08:09 AM
Michael McSharry's Avatar
Michael McSharry Michael McSharry is offline
OverSeer
 
Join Date: Jul 2001
Location: North Bend, WA, USA
Posts: 13,768
The code sequence is below for the debug "Update Accepted 1094 to 13069". Seems pretty straightforward to me that either Value or String will be updated based upon the Status/Control UI setting of the plugin. Conditions are that 1094 exists and it belongs to mcsMQTT. If the Status/Control UI setting is at Button or List then the VSP will result in a 0 being stored because 13069 will be the first payload observed. In 3.2.19.4 I put more debug in the code below to better isolate the path it is taking.

Code:
            If gDebugLog Then
                hsWritelog(PLUGIN_DEBUG, "Update Accepted " & iRef.ToString & " to " & sValue)
            End If
            If iRef > -1 Then
                'if payload is numeric then set DeviceValue
                'if not numeric then lookup status/graphic pairs and if found then set DeviceValue to the corresponding value (now just look for 0/1 OFF/ON)
                'if not numeric and SET_DOES_NOT_CHANGE_LAST_CHANGE is not set then update DeviceValue and DeviceString, otherwise set only DeviceString
                dv = hs.GetDeviceByRef(iRef)
                If dv IsNot Nothing Then
                    bUpdateLastChange = Not dv.MISC_Check(hs, Enums.dvMISC.SET_DOES_NOT_CHANGE_LAST_CHANGE)
                    nHSValue = dv.devValue(hs)
                    If dv.Interface(hs) = PLUGIN_NAME Then
                        If dv.AssociatedDevices_Count(hs) = 1 AndAlso dv.Relationship(hs) = Enums.eRelationship.Child Then
                            Dim iList() As Integer = dv.AssociatedDevices(hs)
                            iParentRef = iList(0)
                        End If
                        If iParentRef = 0 Then
                            iParentRef = -1
                        End If
                        Dim iVGP As StatusTypes = oMQTT.StatusType
                        If iVGP = StatusTypes.Number Then
                            'If IsNumeric(sValue) Then
                            bValueChange = nValue <> nHSValue
                            hs.SetDeviceString(iRef, "", False)
                            hs.SetDeviceValueByRef(iRef, nValue, True) 'bValueChange) ' trigger event if there was a change in value changed to true 4/2/2018
                        ElseIf iVGP = StatusTypes.Text Then
                            Dim sString As String = hs.DeviceString(iRef)
                            bValueChange = sString <> sValueIn
                            If bValueChange Then
                                hs.SetDeviceString(iRef, sValueIn, False)
                            End If
                            If IsNumeric(sValueIn) Then
                                hs.SetDeviceValueByRef(iRef, CType(sValueIn, Double), True) 'so devicevalue trigger can be used 
                            Else
                                hs.SetDeviceValueByRef(iRef, nHSValue, True) 'so devicevalue trigger can be used 
                            End If

                        Else 'button/list
                            nValue = CType(oMQTT.VGPValue(sValueIn), Double)
                            bValueChange = nValue <> nHSValue
                            hs.SetDeviceString(iRef, "", False)
                            hs.SetDeviceValueByRef(iRef, nValue, True)
                        End If
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
Plugin fails to start up, string conversion issue TomB Device History (3P) 10 January 19th, 2018 03:40 PM
Bug? Sensor String Option Issue Planetview ImperiHome Plug-in (3P) 2 January 5th, 2017 01:15 PM
Issue with degrees in string value rileydogmi BLML2HS (3P) 4 November 1st, 2016 06:16 PM
Plugin recognizing Kinect? mtroxell1 Kinect (3P) 3 September 16th, 2014 08:31 AM
INI not recognizing new DS19S20s adds21 Midon Design Temp05/08 4 June 23rd, 2004 12:17 PM


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


Copyright HomeSeer Technologies, LLC