I created a Rule that triggers multiple instances of the “Run Program” addon. Each program then executes the same Netcat program to send commands to Mochad instance running on the same server. This in turn controls X10 devices behind an X10 CM15 controller. This “hack” works ok so far.
Here is an example Run Program command for reference:
/bin/echo “RF O3 OFF” | /home/node/.mozilla-iot/addons/nc -w 5 127.0.0.1 1099
A question or 2 on GW events. I’ve included a logfile snippet showing time stamps
Q: When a scheduled event fires does it execute actions sequentially or in parallel?
After looking at the time stamps for each action in the log file it appears that they overlap indicating to me that they are forked and run in parallel. Mochad seems to operate correctly and must be designed to handle multiple incoming TCP connections natively.
I’ve recently combined the “Run Program” and “X10 CM11” addons into a mostly-working “X10 Mochad” addon. This addon has code to queue and manage multiple commands simultaneously and send them to Mochad sequentially. It works, but still needs improvement to parse return status from Mochad to correctly manage on/off states.
Q: When this new “X10 Mochad” addon is instantiated is there only 1 instance ever created or are these cases were multiple addon instances exist? If there are cases were multiple instances exist how would one coordinate a common command queue?
Thanks,
Eric L. Edberg
2020-12-04 00:00:00.037 INFO : run-program-adapter: Front Door Light OFF (O5): Running: /bin/echo "RF O5 OFF" | /home/node/.mozilla-iot/addons/nc -w 5 127.0.0.1 1099
2020-12-04 00:00:00.066 INFO : run-program-adapter: Master Bedroom OFF (C2): Running: /bin/echo "RF C2 OFF" | /home/node/.mozilla-iot/addons/nc -w 5 127.0.0.1 1099
2020-12-04 00:00:00.102 INFO : run-program-adapter: Garage Indoor OFF (O4): Running: /bin/echo "RF O4 OFF" | /home/node/.mozilla-iot/addons/nc -w 5 127.0.0.1 1099
2020-12-04 00:00:00.142 INFO : run-program-adapter: Christmas Outdoor OFF (O7): Running: /bin/echo "RF O7 OFF" | /home/node/.mozilla-iot/addons/nc -w 5 127.0.0.1 1099
2020-12-04 00:00:12.984 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:00 Tx RF HouseUnit: O5 Func: Off
2020-12-04 00:00:12.988 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:00 Tx PL HouseUnit: O5
2020-12-04 00:00:12.990 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:00 Tx PL House: O Func: Off
2020-12-04 00:00:12.992 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:00 Tx RF HouseUnit: C2 Func: Off
2020-12-04 00:00:12.994 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:00 Tx PL HouseUnit: C2
2020-12-04 00:00:12.997 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:00 Tx PL House: C Func: Off
2020-12-04 00:00:13.000 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:00 Tx RF HouseUnit: O4 Func: Off
2020-12-04 00:00:13.003 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:00 Tx PL HouseUnit: O4
2020-12-04 00:00:13.005 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:00 Tx PL House: O Func: Off
2020-12-04 00:00:13.008 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:00 Tx RF HouseUnit: O7 Func: Off
2020-12-04 00:00:13.011 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:00 Tx PL HouseUnit: O7
2020-12-04 00:00:13.014 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:00 Tx PL House: O Func: Off
2020-12-04 00:00:13.017 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:01 Rx PL HouseUnit: O5
2020-12-04 00:00:13.019 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:01 Rx PL House: O Func: Off
2020-12-04 00:00:13.024 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:05 Rx PL HouseUnit: O4
2020-12-04 00:00:13.026 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:05 Rx PL House: O Func: Off
2020-12-04 00:00:13.029 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:07 Rx PL HouseUnit: O7
2020-12-04 00:00:13.031 INFO : run-program-adapter: Front Door Light OFF (O5): 12/04 00:00:07 Rx PL House: O Func: Off
2020-12-04 00:00:13.033 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:00 Tx RF HouseUnit: C2 Func: Off
2020-12-04 00:00:13.035 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:00 Tx PL HouseUnit: C2
2020-12-04 00:00:13.037 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:00 Tx PL House: C Func: Off
2020-12-04 00:00:13.039 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:00 Tx RF HouseUnit: O4 Func: Off
2020-12-04 00:00:13.041 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:00 Tx PL HouseUnit: O4
2020-12-04 00:00:13.043 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:00 Tx PL House: O Func: Off
2020-12-04 00:00:13.046 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:00 Tx RF HouseUnit: O7 Func: Off
2020-12-04 00:00:13.048 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:00 Tx PL HouseUnit: O7
2020-12-04 00:00:13.050 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:00 Tx PL House: O Func: Off
2020-12-04 00:00:13.052 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:01 Rx PL HouseUnit: O5
2020-12-04 00:00:13.054 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:01 Rx PL House: O Func: Off
2020-12-04 00:00:13.056 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:05 Rx PL HouseUnit: O4
2020-12-04 00:00:13.058 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:05 Rx PL House: O Func: Off
2020-12-04 00:00:13.060 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:07 Rx PL HouseUnit: O7
2020-12-04 00:00:13.063 INFO : run-program-adapter: Master Bedroom OFF (C2): 12/04 00:00:07 Rx PL House: O Func: Off
2020-12-04 00:00:13.065 INFO : run-program-adapter: Garage Indoor OFF (O4): 12/04 00:00:00 Tx RF HouseUnit: O4 Func: Off
2020-12-04 00:00:13.067 INFO : run-program-adapter: Garage Indoor OFF (O4): 12/04 00:00:00 Tx PL HouseUnit: O4
2020-12-04 00:00:13.069 INFO : run-program-adapter: Garage Indoor OFF (O4): 12/04 00:00:00 Tx PL House: O Func: Off
2020-12-04 00:00:13.071 INFO : run-program-adapter: Garage Indoor OFF (O4): 12/04 00:00:00 Tx RF HouseUnit: O7 Func: Off
2020-12-04 00:00:13.073 INFO : run-program-adapter: Garage Indoor OFF (O4): 12/04 00:00:00 Tx PL HouseUnit: O7
2020-12-04 00:00:13.076 INFO : run-program-adapter: Garage Indoor OFF (O4): 12/04 00:00:00 Tx PL House: O Func: Off
2020-12-04 00:00:13.083 INFO : run-program-adapter: Garage Indoor OFF (O4): 12/04 00:00:01 Rx PL HouseUnit: O5
2020-12-04 00:00:13.086 INFO : run-program-adapter: Garage Indoor OFF (O4): 12/04 00:00:01 Rx PL House: O Func: Off
2020-12-04 00:00:13.091 INFO : run-program-adapter: Garage Indoor OFF (O4): 12/04 00:00:05 Rx PL HouseUnit: O4
2020-12-04 00:00:13.094 INFO : run-program-adapter: Garage Indoor OFF (O4): 12/04 00:00:05 Rx PL House: O Func: Off
2020-12-04 00:00:13.097 INFO : run-program-adapter: Garage Indoor OFF (O4): 12/04 00:00:07 Rx PL HouseUnit: O7
2020-12-04 00:00:13.099 INFO : run-program-adapter: Garage Indoor OFF (O4): 12/04 00:00:07 Rx PL House: O Func: Off
2020-12-04 00:00:13.101 INFO : run-program-adapter: Christmas Outdoor OFF (O7): 12/04 00:00:00 Tx RF HouseUnit: O7 Func: Off
2020-12-04 00:00:13.103 INFO : run-program-adapter: Christmas Outdoor OFF (O7): 12/04 00:00:00 Tx PL HouseUnit: O7
2020-12-04 00:00:13.106 INFO : run-program-adapter: Christmas Outdoor OFF (O7): 12/04 00:00:00 Tx PL House: O Func: Off
2020-12-04 00:00:13.108 INFO : run-program-adapter: Christmas Outdoor OFF (O7): 12/04 00:00:01 Rx PL HouseUnit: O5
2020-12-04 00:00:13.110 INFO : run-program-adapter: Christmas Outdoor OFF (O7): 12/04 00:00:01 Rx PL House: O Func: Off
2020-12-04 00:00:13.112 INFO : run-program-adapter: Christmas Outdoor OFF (O7): 12/04 00:00:05 Rx PL HouseUnit: O4
2020-12-04 00:00:13.114 INFO : run-program-adapter: Christmas Outdoor OFF (O7): 12/04 00:00:05 Rx PL House: O Func: Off
2020-12-04 00:00:13.116 INFO : run-program-adapter: Christmas Outdoor OFF (O7): 12/04 00:00:07 Rx PL HouseUnit: O7
2020-12-04 00:00:13.118 INFO : run-program-adapter: Christmas Outdoor OFF (O7): 12/04 00:00:07 Rx PL House: O Func: Off