King,
It sounds like you are a Windows man and I am not. My Windows experience, as limited as it was, ended with WinXP. I guess that makes me deprecated, right? I run TTD, node-red, and MQTT all on my raspberry pis. I did a little googling on installing an MQTT broker/server in Windows and it seemed rather complicated (How to Install The Mosquitto MQTT Broker- Windows and Linux). You don't need anything fancy at all, no WebSockets, probably none of any other options he addresses. Three command line entries are all it takes to set it up on a pi (Install Mosquitto Broker Raspberry Pi). If you have a pi, you could set that up as your server and run all your other programs on your windows computers if you like. The raspberry pi tutorial linked above has a pretty good graphic outlining the mqtt process.
When coupled with TTD, a simple python script becomes one of the devices on the right. When ttd decodes, the python code publishes a bit of information to a topic on the broker/server. Then every device on the left which has subscribed to this topic receives this bit of information. These devices can be smart outlets, light switches, etc. or an instance of node-red. Using node-red allows you to further process the information. There is a node-red node that subscribes to topics from an mqtt server. This all sounds complicated but is actually quite simple. The mqtt server is the heart of it. This server really retains none of the information bits that it serves up.
So the first step is to set up a MQTT server. There are several available free of charge on the internet that say they are available for "testing purposes" Maybe use one of those to start?
Here is the python code (mqtt.py) that I run from the alert_command option in TTD:
#!/usr/bin/python3
import os, glob, time, sys, datetime, json, time
import paho.mqtt.publish as publish
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("description")
args = parser.parse_args()
desc = args.description
split = desc.split('_')
town = split[0]
service = split[1]
publish.single("cmnd/sonoff/"+town+"/"+service+"/POWER", "on", hostname="pi_ip_address", auth = {'username':"UN", 'password':"PWD"})
quit()
I have formatted all my descriptions in TTD to be Town_Service. For example Boston_Fire or Boston_EMS. The above code then parses this description and publishes to a topic cmnd/sonoff/Town/Service/POWER on. That turns on a Sonoff smart outlet (S20) or any other sonoff device subscribed to that topic. This allows subscriptions to individual services or to all services connected to a town. The options are limitless.
In TTD tones.cfg the entry is alert_command = python mqtt.py [d]
For testing purposes if you get that far, subscribe to all topics on your mqtt server using the mqtt node in your node-red, pipe them to the debug window to see what the server is processing. The topic wildcard that gets you everything is #. So subscribe to # and you will see everything passing through your server.
Good luck, I hope that I have helped rather than discouraged you.
Jim
It sounds like you are a Windows man and I am not. My Windows experience, as limited as it was, ended with WinXP. I guess that makes me deprecated, right? I run TTD, node-red, and MQTT all on my raspberry pis. I did a little googling on installing an MQTT broker/server in Windows and it seemed rather complicated (How to Install The Mosquitto MQTT Broker- Windows and Linux). You don't need anything fancy at all, no WebSockets, probably none of any other options he addresses. Three command line entries are all it takes to set it up on a pi (Install Mosquitto Broker Raspberry Pi). If you have a pi, you could set that up as your server and run all your other programs on your windows computers if you like. The raspberry pi tutorial linked above has a pretty good graphic outlining the mqtt process.
When coupled with TTD, a simple python script becomes one of the devices on the right. When ttd decodes, the python code publishes a bit of information to a topic on the broker/server. Then every device on the left which has subscribed to this topic receives this bit of information. These devices can be smart outlets, light switches, etc. or an instance of node-red. Using node-red allows you to further process the information. There is a node-red node that subscribes to topics from an mqtt server. This all sounds complicated but is actually quite simple. The mqtt server is the heart of it. This server really retains none of the information bits that it serves up.
So the first step is to set up a MQTT server. There are several available free of charge on the internet that say they are available for "testing purposes" Maybe use one of those to start?
Here is the python code (mqtt.py) that I run from the alert_command option in TTD:
#!/usr/bin/python3
import os, glob, time, sys, datetime, json, time
import paho.mqtt.publish as publish
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("description")
args = parser.parse_args()
desc = args.description
split = desc.split('_')
town = split[0]
service = split[1]
publish.single("cmnd/sonoff/"+town+"/"+service+"/POWER", "on", hostname="pi_ip_address", auth = {'username':"UN", 'password':"PWD"})
quit()
I have formatted all my descriptions in TTD to be Town_Service. For example Boston_Fire or Boston_EMS. The above code then parses this description and publishes to a topic cmnd/sonoff/Town/Service/POWER on. That turns on a Sonoff smart outlet (S20) or any other sonoff device subscribed to that topic. This allows subscriptions to individual services or to all services connected to a town. The options are limitless.
In TTD tones.cfg the entry is alert_command = python mqtt.py [d]
For testing purposes if you get that far, subscribe to all topics on your mqtt server using the mqtt node in your node-red, pipe them to the debug window to see what the server is processing. The topic wildcard that gets you everything is #. So subscribe to # and you will see everything passing through your server.
Good luck, I hope that I have helped rather than discouraged you.
Jim