<?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[Is it possible to have more then one parameter?]]></title><description><![CDATA[<p dir="auto">I'm playing with x10 on a Raspi  using HomeGenie<br />
x10 has a possible 256 addresses that's a lot of bash scripts just for On_Off</p>
<p dir="auto">Is it possible to add house code (A-P) as an additional paramiter and unit codes (1-16) as another?<br />
the command to turn on a device at house code A unit code 4 would look like this:<br />
curl <a href="http://url" rel="nofollow ugc">http://url</a>&amp;port/api/HomeAutomation.X10/A4/Control.On</p>
]]></description><link>https://www.triggercmd.com/forum/topic/1937/is-it-possible-to-have-more-then-one-parameter</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 11:09:04 GMT</lastBuildDate><atom:link href="https://www.triggercmd.com/forum/topic/1937.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Jan 2022 21:25:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Is it possible to have more then one parameter? on Thu, 23 May 2024 11:49:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/tuicemen" aria-label="Profile: tuicemen">@<bdi>tuicemen</bdi></a></p>
<p dir="auto">You can add house code (A-P) and unit codes (1-16) as parameters in your bash scripts.</p>
<p dir="auto">#!/bin/bash<br />
house_code=$1<br />
unit_code=$2<br />
action=$3<br />
curl "<a href="http://url" rel="nofollow ugc">http://url</a>:port/api/HomeAutomation.X10/${house_code}${unit_code}/Control.${action}"<br />
Run it like this:<br />
./control_x10.sh A 4 On</p>
<p dir="auto">This way, you only need one script.</p>
<p dir="auto">Thank you<br />
boblewis</p>
]]></description><link>https://www.triggercmd.com/forum/post/7858</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/7858</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 23 May 2024 11:49:48 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to have more then one parameter? on Fri, 07 Jan 2022 15:34:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/russ" aria-label="Profile: russ">@<bdi>russ</bdi></a>  Thanks, I found my error, the line in the commands.json file was correct.<br />
I was putting in the wrong X10 address for my test thus it was turning on/off a light in the basement not my test light.</p>
]]></description><link>https://www.triggercmd.com/forum/post/5147</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/5147</guid><dc:creator><![CDATA[tuicemen]]></dc:creator><pubDate>Fri, 07 Jan 2022 15:34:08 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to have more then one parameter? on Fri, 07 Jan 2022 13:07:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/tuicemen" aria-label="Profile: tuicemen">@<bdi>tuicemen</bdi></a> , if you show me your commands.json I can probably spot the problem.  It's usually that you need to escape some characters with a backslash.</p>
<p dir="auto">One way to do it is to use the GUI editor on another computer and copy the json text over.</p>
]]></description><link>https://www.triggercmd.com/forum/post/5146</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/5146</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Fri, 07 Jan 2022 13:07:03 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to have more then one parameter? on Fri, 07 Jan 2022 11:48:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/russ" aria-label="Profile: russ">@<bdi>russ</bdi></a> thanks, creating the bash file was no problem. I had that working but think the commands.json file is where I've messed up.</p>
<p dir="auto">Since HomeGenie can handle several different protocols, I've been rethinking what each parameter holds. I may be able to get one simple bash file to handle all protocols I use.<br />
Just need to play with the commands.json file.</p>
]]></description><link>https://www.triggercmd.com/forum/post/5141</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/5141</guid><dc:creator><![CDATA[tuicemen]]></dc:creator><pubDate>Fri, 07 Jan 2022 11:48:00 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to have more then one parameter? on Thu, 06 Jan 2022 22:50:12 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/tuicemen" aria-label="Profile: tuicemen">@<bdi>tuicemen</bdi></a>, you can use $1, $2, and $3 as placeholders for multiple parameters to your script, like this:</p>
<pre><code>russ@RussHP:~$ ./x10.sh A 4 on
curl http://url:port/api/HomeAutomation.X10/A4/Control.on
russ@RussHP:~$ cat ./x10.sh
#!/bin/bash
echo curl http://url:port/api/HomeAutomation.X10/$1$2/Control.$3
</code></pre>
<p dir="auto">You'd want to remove <strong>echo</strong> from the script.  I just included that so it would show you the substitutions in the curl command.</p>
]]></description><link>https://www.triggercmd.com/forum/post/5136</link><guid isPermaLink="true">https://www.triggercmd.com/forum/post/5136</guid><dc:creator><![CDATA[Russ]]></dc:creator><pubDate>Thu, 06 Jan 2022 22:50:12 GMT</pubDate></item></channel></rss>