Introduced in 3.4.13.0 of mcsMQTT is a time-saving feature for those who have the ability to publish standard topic formats to control HS devices. The topic will include the HS Device Reference. When the wildcard template is setup (General Tab, Incoming Subscription Management) mcsMQTT will match it with existing HS device and make an automatic acceptance. Default publish and payload templates will be associated so when the device changes it will be reported via MQTT. Once setup it is possible to edit any of the properties on a Device by Device basis. The manual was updated to reflect a use-case example and as a method to assign Topics to existing HS devices.
Announcement
Collapse
No announcement yet.
Wildcard Template for Auto-Association of MQTT control topics to existing HS devices
Collapse
X
-
The pdf is also at http://mcsSprinklers.com/mcsMQTT.pdf
It extracts for me from the zip using Windows 7 and Windows Explorer.
Comment
-
Not trying to be a drag...
Subscriptions would be much more useful for me if there was access to;
$$ROOM:
$$TYPE:
$$NAME:
It appears only $$REF: works for subscriptions
Not sure how your accomplishing the subscription
What do you think about something like
PHP Code:WILDCARD_MASK = "Home/$$ROOM:/$$TYPE:/$$NAME:"
for device in all_devices:
mqtt.subscribe(WILDCARD_MASK, device)
Comment
-
Submitted to Updater and available at http://mcsSprinklers.com/mcsMQTT_3_4_14_0.zip contains the update to allow use any of the Topic substitution parameters in the manual's Table 1.
I also published a topic with %20 embedded and the %20 was shown on the mcsMQTT association tab for the message. Could it be your observation is based upon your client that may have converted the %20 into space before it sent it to the broker?
Comment
-
I am using mosquitto as my broker
My clients are Node-RED and MQTT.fx java app on windows.
Both clients receive for example
PHP Code:Home/Deck/Z-Wave%20Switch%20Multilevel/Deck%20Light%20Dimmer/Status
PHP Code:Home/$$ROOM:/$$TYPE:/$$NAME:/Status
I get the following results from testing
HS3 -> Node-Red = %20
HS3 -> MQTT.fx = %20
MQTT.fx -> Node-Red = Space Character
Node-Red -> MQTT.fx = Space Character
MQTT.fx -> mcsMQTT = Space Character (In association tab)
Comment
-
Can you explain exactly when the subscriptions are updated.
For example if I have set inbound wildcard to
Home/Control/$$REF:/Command
I send a message to Home/Control/101/Command=60 and it works
I then change inbound wildcard to
Home/Control/$$NAME:/Command
I send a message to Home/Control/Deck Light Dimmer/Command=60 and it does NOT work
I send a message to Home/Control/101/Command=60 and it works
I've resorted to deleting the entire database during testing here but it's a bit confusing
Comment
-
The wildcards are processed during non-plugin device enumeration. This is done at startup and done when the button on bottom of General tab is used. This was done to minimize the time it takes to evaluate each received message. I can see that I should rebuild automatically if wildcard template is changed. I'll do this in next update.
The topics are case-sensitive so make certain room names obey the case of what is in HS
$$TYPE: is DeviceTypeString property of the device
$$ROOM: is Location property of the device
$$FLOOR is Location2 property of the device
Use of any substitution in addition to $$REF: is not a good idea because $$REF: is unique and needs no further specification. If you ever get out of sync between name and ref in your example it will not recognize the topic.
Do any of these help?
Comment
-
Yes I can get the output of all these wildcard on the publish side of mcsMQTT
I use this below to ensure I generate valid data
PHP Code:Publish Mask: Home/$$ROOM:/$$TYPE:/$$NAME:/Status
Publish Result: Home/Deck/Z-Wave%20Switch%20Multilevel/Deck%20Light%20Dimmer/Status
Ideal Subscribe Mask: Home/$$ROOM:/$$TYPE:/$$NAME:($$REF:)/Command
So I simplified and tried the ones below
PHP Code:Home/Control/$$REF:/Command
Home/Control/101/Command with payload 60
WORKS
Home/Control/$$NAME:/Command
Home/Control/Deck Light Dimmer/Command with payload 60
WORKS
Home/Control/$$NAME:/$$REF:/Command
Home/Control/Deck Light Dimmer/101/Command with payload 60
NOT working
11/28/2018 3:57:51 PM 3156772 | ActoOnMessageForTrigger Topic Home/Control/Deck Light Dimmer/101/Command,Payload=50
Could you see if Home/Control/$$NAME:/$$REF:/Command works on your end?
Comment
-
My mistake. Corrected in 3.4.14.1. http://mcsSprinkers.com/mcsMQTT_3_4_14_1.zip. It should also have the refresh after change of template, but have not confirmed this yet. Dinner time now.
Comment
Comment