Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MQTT Help
#7
(12-05-2020, 09:08 AM)Dean Roddey Wrote: There's no standardization of how topics are defined, so every device my be somewhat different in what they expect. That's a big lacking in the MQTT standard, that it doesn't standardize something that important. If you can indicate where in the docs this extra info could be pointed out and what should be pointed out, I can update the docs.

I'd say it at least need to be address in the "Field Definitions" section of the docs (/Reference/MQTTCfg/FieldDefs).  Under Common Attributes, you talk about the "Topic" and say that it is the most important piece of information, but you give no help in indicating what needs to be included. What is confusing is that "topic" in the MQTT world is effectively just the device name.  For example you use the MQTT topic "Home/Kitchen/Fan" in the BoolSwitch element, "Home/Siren" in the ContactClosure element, "Home/Porch/Heater" in the Generic element, etc, etc, etc.  Those are all valid MQTT topics, but in CQC world the "Topic" you need to include in the config file is the full console command (except for the payload - the last part after the ":") needed to activate the desired command.  Every code example that I have seen in the documentation would actually fail in real life because the "topic" in the code example is only the MQTT topic and not the full command that CQC is looking for.

Using my example, I have a plug (relay) that has a MQTT topic of "home/light/den/xmastree" and the full MQTT command to turn the relay on is "cmnd/home/light/den/xmastree/POWER1:ON"  Looking at the docs and all the provided examples, it looks like the "topic" that CQC needs is "home/light/den/xmastree" but in reality the CQC "topic" needs to be "cmnd/home/light/den/xmastree/POWER1".

To get the status of a device, the MQTT console command would be "stat/home/light/den/xmastree/POWER1".  That full command is what CQC needs in the "topic" of the config file to work.  Because it is looking for status, there is no payload element to the MQTT console command which is why the actual console command is what is needed in the CQC "topic" portion of the code.

This would be a breaking change, so I'm not sure it would be wise to implement, but I think the use of the word "topic" in the config file/software is wrong.  It really needs to be something like "console command".  That would more closely represent the information that CQC needs to work.  The MQTT topic is part of the console command, but only 1/3 of the needed information.  The MQTT prefix and command are also needed. 

Long story short, the CQC "Topic" really needs to include these items:  The MQTT prefix + MQTT topic + MQTT command (without the actual payload element).  So "cmnd" + "home/light/den/xmastree" + "POWER1" in my case ("cmnd/home/light/den/xmastree/POWER1"). CQC then takes this command, appends the payload element to the string, and then sends it to the MQTT broker.

Hopefully that makes sense.
Brian - a long time user that rarely messes with the system now
Other systems used:
SageTV w/ cablecard tuner & multiple extenders for viewing
BlueIris and IP cameras for CCTV
Incredible PBX for home phone
Reply


Messages In This Thread
MQTT Help - by sic0048 - 12-02-2020, 08:40 PM
RE: MQTT Help - by sic0048 - 12-03-2020, 04:28 AM
RE: MQTT Help - by Dean Roddey - 12-04-2020, 04:51 PM
RE: MQTT Help - by znelbok - 12-04-2020, 08:45 PM
RE: MQTT Help - by sic0048 - 12-05-2020, 08:15 AM
RE: MQTT Help - by znelbok - 12-06-2020, 03:27 AM
RE: MQTT Help - by Dean Roddey - 12-05-2020, 09:08 AM
RE: MQTT Help - by sic0048 - 12-05-2020, 09:40 AM
RE: MQTT Help - by sic0048 - 12-05-2020, 11:19 AM
RE: MQTT Help - by Dean Roddey - 12-05-2020, 11:55 AM
RE: MQTT Help - by znelbok - 12-06-2020, 03:36 AM
RE: MQTT Help - by sic0048 - 12-06-2020, 01:07 PM
RE: MQTT Help - by sic0048 - 12-22-2020, 08:23 AM
RE: MQTT Help - by zaccari - 07-15-2021, 11:20 AM
RE: MQTT Help - by zaccari - 07-19-2021, 10:38 AM
RE: MQTT Help - by znelbok - 07-19-2021, 01:44 PM
RE: MQTT Help - by zaccari - 07-19-2021, 02:47 PM
RE: MQTT Help - by Shaky - 10-24-2021, 07:03 PM
RE: MQTT Help - by zaccari - 10-25-2021, 04:40 AM
RE: MQTT Help - by Shaky - 10-25-2021, 07:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  MQTT Verify Configuration not working znelbok 4 465 03-17-2022, 01:07 PM
Last Post: Dean Roddey
  Additional MQTT Support znelbok 5 2,020 05-14-2020, 03:55 PM
Last Post: Dean Roddey
  New MQTT support Dean Roddey 65 20,913 02-02-2020, 02:00 PM
Last Post: simplextech

Forum Jump:


Users browsing this thread: 1 Guest(s)