Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Additional MQTT Support
#1
I am looking into Fauxmo to give Echo support to CQC and there is a couple of ways to use it..

One is to use the MQTT plugin, which to me is the most flexible that I can see at the moment. (HTTP is also supported, but I don't know about two way support)

To use it with CQC is kind of cumbersome though.

MQTT driver (Sub) -> Triggered Event -> write to associated CQC Driver.
Change in device status -> Triggered Event -> MQTT Driver (Pub).

Basically, when you ask for Alexa to turn on the kitchen light, Fauxmo publishes a MQTT message and because CQC is subscribed it updates the field.  This in turn then uses a triggered event to get CQC to turn the kitchen light on via the lighting driver.

A little cumbersome, but not too bad.

Fauxmo also can get the status of the device, if it were a pure MQTT device it would just publish its change of status (and that's how we work with MQTT in CQC currently), but for this setup, if you say, turn the light on you would again need a triggered event to publish a MQTT message so that Fauxmo is updated.

Would it be possible to have a MQTT driver/utility for CQC that wraps all that up nicely.  Something that would publish any [data configured] from CQC to any topic desired.  It would allow CQC to integrate with all other MQTT enabled products a little easier (e.g. another MQTT based server
Mykel Koblenz
Illawarra Smart Home
Reply
#2
Can't you basically sort of do that now? If you set up a faux slot in the MQTT driver that was outgoing only, you could set it up with a list of things you want to to send out in response to a field write. Of course it would only go to a specific target topic.

If you just want to generally send any sort of msg there are probably little command line tools out there already as good as any I could write, which you could just invoke. Presumably they would take command line parameters for the topic and data.
Dean Roddey
Explorans limites defectum
Reply
#3
Not that I am aware of. There is no mechanism that will cause a pub from a field change other than a triggered event - not unless you added something I was not aware of in the driver

Even using a command line tool would require a triggered event.

Think of something like the logic server. Assign a field(s) to a MQTT publish message. Similar logic - but slightly different in ways as well. If you have say a single field assigned to a pub message it would be designed to publish on field change. There may be an say three on off fields that will publish an on message when all are on and off when any are off.
Mykel Koblenz
Illawarra Smart Home
Reply
#4
I'm still not fully understanding the scenario. I could of course add a 'passthrough' field to the MQTT driver where you send it a topic path and a text string to send or something like that and it just blindly sends it out. But it could get tricky because the driver wouldn't know if that's valid or what to expect back in return or anything.
Dean Roddey
Explorans limites defectum
Reply
#5
OK, how do I send a MQTT message when any of the following happens

Kitchen light turns on/off (CQC/Light/Kitchen - "On")
Ceiling fan turns on to low (CQC/Fan/LivingFan - "Low"
TV turns on/off (CQC/TV/Bed1TV - "Off" )
A/C turns on (CQC/HVAC/SystemPower - "On"
Garage door is opened (CQC/Alarm/GarageDoor - "Open"
Alarm is armed. (CQC/Alarm/SystemState - "Armed")

Six different drivers in the list (with example topics and data) above so using a triggered event is really cumbersome.
Mykel Koblenz
Illawarra Smart Home
Reply
#6
Oh, OK, no, that's not likely to happen. That really would require something like the logic server which is a huge undertaking.

I guess one option would be to derive a class from EventHandler:

https://www.charmedquark.com/Web2/CQCDoc...entHandler

Set up a single triggered event that just roughly filters for the kinds of events you want. The action would be an invocation of your derived class. When that happens, the event server knows it's an event handler. In your Start() method you can call the Get method to get the raw event info and do whatever you want, which could be return some info to the action that tells it to invoke some command line tool to send that info.

Another would be to create an 'event monitor' which I created a long time ago and I don't think anyone has ever used. You derive from EvMonBase:

https://www.charmedquark.com/Web2/CQCDoc.../EvMonBase

In your Start() you tell it a list of fields you are interested in. You will be called back the FIeldChanged() method any time one of them changes. But, in this case, you'd have to build up the MQTT buffer to send yourself. You wouldn't have any way of invoking some external tool.
Dean Roddey
Explorans limites defectum
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  MQTT Verify Configuration not working znelbok 4 987 03-17-2022, 01:07 PM
Last Post: Dean Roddey
  Broadlink Support? Darrie 1 679 01-20-2022, 04:09 PM
Last Post: Dean Roddey
  Support for MATTER znelbok 0 583 01-10-2022, 03:08 AM
Last Post: znelbok
  MQTT Help sic0048 19 4,656 10-25-2021, 07:50 PM
Last Post: Shaky
  any support for TP Link Kasa natively or third party int? b00ter 1 872 03-13-2021, 06:16 PM
Last Post: gReatAutomation
  ISY994i Support simplextech 49 17,838 06-29-2020, 05:21 AM
Last Post: keepersg
  Elk Version Support Issue Ron Haley 20 6,642 05-05-2020, 08:38 PM
Last Post: Shaky
  RadioRA2 Visor Control Receiver - Input support gReatAutomation 12 5,269 02-24-2020, 07:38 AM
Last Post: gReatAutomation
  New MQTT support Dean Roddey 65 23,847 02-02-2020, 02:00 PM
Last Post: simplextech
  ISYv2 Driver - IOLinc Support simplextech 7 3,845 02-01-2020, 07:18 PM
Last Post: simplextech

Forum Jump:


Users browsing this thread: 1 Guest(s)