<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Custom Commands in @MMM-Remote-Control]]></title><description><![CDATA[<p dir="auto">I am using a raspberry pi 4. I have a radio frequency transmitter attached to one of my GPIO pins and I am using running a python script through the terminal to send a command that will turn on/off and change the colour of my led lights.  (See link below). I have said these files in my MagicMirror folder.</p>
<p dir="auto">Is it possible to use custom commands to do this? If so can you help me understand how. Attached are the shell files that are executable and work( when i double click the files in desktop mode - the lights change). How do i link this to MMM-Remote-Control or do the same action in MMM-Remote-Control?</p>
<p dir="auto"><strong>Config.js</strong></p>
<pre><code>/* Magic Mirror Config Sample
 *
 * By Michael Teeuw https://michaelteeuw.nl
 * MIT Licensed.
 *
 * For more information on how you can configure this file
 * See https://github.com/MichMich/MagicMirror#configuration
 *
 */

var config = {
	address: "0.0.0.0", 	// Address to listen on, can be:
	//address: "localhost", 	// Address to listen on, can be:
							// - "localhost", "127.0.0.1", "::1" to listen on loopback interface
							// - another specific IPv4/6 to listen on a specific interface
							// - "0.0.0.0", "::" to listen on any interface
							// Default, when address config is left out or empty, is "localhost"
	port: 8080,
	basePath: "/", 	// The URL path where MagicMirror is hosted. If you are using a Reverse proxy
					// you must set the sub path here. basePath must end with a /
	ipWhitelist: [], 	// Set [] to allow all IP addresses
	//ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], 	// Set [] to allow all IP addresses														// or add a specific IPv4 of 192.168.1.5 :
															// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
															// or IPv4 range of 192.168.3.0 --&gt; 192.168.3.15 use CIDR format :
															// ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],

	useHttps: false, 		// Support HTTPS or not, default "false" will use HTTP
	httpsPrivateKey: "", 	// HTTPS private key path, only require when useHttps is true
	httpsCertificate: "", 	// HTTPS Certificate path, only require when useHttps is true

	language: "en",
	logLevel: ["INFO", "LOG", "WARN", "ERROR"],
	timeFormat: 24,
	units: "metric",
	// serverOnly:  true/false/"local" ,
	// local for armv6l processors, default
	//   starts serveronly and then starts chrome browser
	// false, default for all NON-armv6l devices
	// true, force serveronly mode, because you want to.. no UI on this device

	modules: [

		{
		    	module: 'MMM-Remote-Control',
		    	// uncomment the following line to show the URL of the remote control on the mirror
		     	position: 'bottom_right',
		    	// you can hide this module afterwards from the remote control itself
		    	config: {
				customCommand: {},  // Optional, See "Using Custom Commands" below
				showModuleApiMenu: true, // Optional, Enable the Module Controls menu
				// uncomment any of the lines below if you're gonna use it
				// customMenu: "custom_menu.json", // Optional, See "Custom Menu Items" below
				// apiKey: "",         // Optional, See API/README.md for details
		    		},
			customCommand: {
				monitorOnCommand: 'cd ./MagicMirror python3 send.py -p 396 -t 1 11717633',
				
			    }




		},
		{
  			module: "MMM-Remote-Control-Repository",
		},
				
	]
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}
</code></pre>
<p dir="auto"><strong>Shell Script</strong></p>
<pre><code>cd ./MagicMirror
python3 send.py -p 396 -t 1 11717633
</code></pre>
<p dir="auto"><strong><a href="http://send.py" target="_blank" rel="noopener noreferrer nofollow ugc">send.py</a></strong></p>
<pre><code>#!/usr/bin/env python3

import argparse
import logging

from rpi_rf import RFDevice

logging.basicConfig(level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S',
                    format='%(asctime)-15s - [%(levelname)s] %(module)s: %(message)s',)

parser = argparse.ArgumentParser(description='Sends a decimal code via a 433/315MHz GPIO device')
parser.add_argument('code', metavar='CODE', type=int,
                    help="Decimal code to send")
parser.add_argument('-g', dest='gpio', type=int, default=17,
                    help="GPIO pin (Default: 17)")
parser.add_argument('-p', dest='pulselength', type=int, default=None,
                    help="Pulselength (Default: 350)")
parser.add_argument('-t', dest='protocol', type=int, default=None,
                    help="Protocol (Default: 1)")
parser.add_argument('-l', dest='length', type=int, default=None,
                    help="Codelength (Default: 24)")
parser.add_argument('-r', dest='repeat', type=int, default=10,
                    help="Repeat cycles (Default: 10)")
args = parser.parse_args()

rfdevice = RFDevice(args.gpio)
rfdevice.enable_tx()
rfdevice.tx_repeat = args.repeat

if args.protocol:
    protocol = args.protocol
else:
    protocol = "default"
if args.pulselength:
    pulselength = args.pulselength
else:
    pulselength = "default"
if args.length:
    length = args.length
else:
    length = "default"

logging.info(str(args.code) +
             " [protocol: " + str(protocol) +
             ", pulselength: " + str(pulselength) +
             ", length: " + str(length) +
             ", repeat: " + str(rfdevice.tx_repeat) + "]")

rfdevice.tx_code(args.code, args.protocol, args.pulselength, args.length)
rfdevice.cleanup()
</code></pre>
<h1>apt-get install python3-pip</h1>
<h1>pip3 install rpi-rf</h1>
<p dir="auto"><a href="https://github.com/milaq/rpi-rf/tree/master/scripts" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/milaq/rpi-rf/tree/master/scripts</a></p>
]]></description><link>https://forum.magicmirror.builders/topic/14070/custom-commands-in-mmm-remote-control</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 20:11:54 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/14070.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 Nov 2020 19:58:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Custom Commands in @MMM-Remote-Control on Fri, 20 Nov 2020 04:21:57 GMT]]></title><description><![CDATA[<p dir="auto">Hello! Ezequiel here. <code>customCommands</code> should be inside the config of the Remote Control. You can raise a question in the issue page for further instructions. Cheers :D</p>
]]></description><link>https://forum.magicmirror.builders/post/84861</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/84861</guid><dc:creator><![CDATA[ezeholz]]></dc:creator><pubDate>Fri, 20 Nov 2020 04:21:57 GMT</pubDate></item><item><title><![CDATA[Reply to Custom Commands in @MMM-Remote-Control on Thu, 19 Nov 2020 22:06:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gkchimz" aria-label="Profile: gkchimz">@<bdi>gkchimz</bdi></a> Google is your friend</p>
<p dir="auto">Also every command has help</p>
<p dir="auto">curl --help</p>
]]></description><link>https://forum.magicmirror.builders/post/84859</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/84859</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Thu, 19 Nov 2020 22:06:26 GMT</pubDate></item><item><title><![CDATA[Reply to Custom Commands in @MMM-Remote-Control on Thu, 19 Nov 2020 20:47:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a>  - thank you very much for your prompt response. I have not learned about curl commands yet ( although i know i have copied and pasted one during installation of modules.</p>
<p dir="auto">Are you able to point me towards an example or a good page that i may be able to lean the relevant things quickly please.</p>
]]></description><link>https://forum.magicmirror.builders/post/84858</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/84858</guid><dc:creator><![CDATA[gkchimz]]></dc:creator><pubDate>Thu, 19 Nov 2020 20:47:15 GMT</pubDate></item><item><title><![CDATA[Reply to Custom Commands in @MMM-Remote-Control on Thu, 19 Nov 2020 20:20:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/gkchimz" aria-label="Profile: gkchimz">@<bdi>gkchimz</bdi></a> you use a curl command to send a request to the remote control  api url</p>
]]></description><link>https://forum.magicmirror.builders/post/84857</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/84857</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Thu, 19 Nov 2020 20:20:09 GMT</pubDate></item></channel></rss>