more G-Labs products

Author Topic: How to send X10 All On or All Off  (Read 8737 times)

January 05, 2016, 05:29:23 AM
Read 8737 times

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Hello,  noob here.

I'd like to send an X10 ALL OFF command every night at 11:50pm

Can someone point me to the simplest way to do such a thing?

Thanks so much!!!

January 05, 2016, 05:51:40 AM
Reply #1

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
I don't believe the All Off or All Lights On commands are available right now.  I don't use them, but it would be good to have them available.  Could you post this as a request in the features request sub forum so it gets in Gene's to do list?

January 05, 2016, 11:31:36 AM
Reply #2

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi,
for my X.10 Devices the "All Lights On" and "All Lights Off" scenario works fine. This currently works for Dimmers and Lights but can be extended to Switches also.

br. Christian

January 05, 2016, 11:39:28 AM
Reply #3

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330
is there a related webapi to turn all lights off (x10 and zwave)?

January 05, 2016, 11:43:49 AM
Reply #4

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi,
with a short glimpse to the documentation you'll find:


Control.AllLightsOn

Turn on all lights with the house code <house_code>.

Syntax

/api/HomeAutomation.X10/<house_code>/Control.AllLightsOn

GET /api/HomeAutomation.X10/B/Control.AllLightsOn
Control.AllLightsOff

Turn off all lights with the house code <house_code>.

Syntax

/api/HomeAutomation.X10/<house_code>/Control.AllLightsOff

GET /api/HomeAutomation.X10/B/Control.AllLightsOff

br. Christian

January 05, 2016, 02:07:29 PM
Reply #5

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Thanks.

Would you kindly point me to the documentation you mention?  I am struggling greatly to find documentation that is useful.  Thanks!!!

January 05, 2016, 02:49:01 PM
Reply #6

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
http://genielabs.github.io/HomeGenie/api/mig/mig_api_x10.html

You can reach it also via www.homegenie.it -->  click Docs & Support and go to Developers' Docs.

br. Christian

January 05, 2016, 03:34:49 PM
Reply #7

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Ahhh, I thought you wanted to perform the All lights ON/All OFF from the GUI.  You can turn them ON/OFF as described by emerich through a script.  I suppose if you want to access the command from the GUI you could simply create a Wizard script with the one command and add that script to the GUI where you'd like to use it.

January 06, 2016, 05:12:24 AM
Reply #8

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
OK I think I created a Wizard Script in the Customize | Programs area.   

I'd like to see an example of a Wizard Script maybe so I knew the syntax.  Is this documented somewhere?

Once I create the script,  how does one get it to run say every day at 11pm?

Thanks!

January 06, 2016, 04:45:17 PM
Reply #9

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
There is a lot of documentation (though maybe not complete for what you need) linked from the main site (www.homegenie.it).  If you click on the "DOCS & SUPPORT" link at the top and go to either "USER'S GUIDE" or "DEVELOPERS' DOCS" you will see a lot of information about setting up HG and coding for it.  A lot of the info on the dev side is for C#, but Wizard, JS, Python, etc. should all be referenced.

I just looked around and did not locate a specific page showing how to develop a Wizard script, but I suppose that makes sense.  The Wizard script is so simple it really doesn't require much documentation.  Basically just add commands one at a time and they will execute in that order.  You can't do much if any logic which is why it's pretty self explanatory.  Do you need help constructing a Wizard script?

Running the script at a certain time is easy too.  In a Wizard script, switch to the trigger tab.  Follow the guide under the events scheduler and it should work for you right away.

http://www.homegenie.it/docs/scheduler.php

January 06, 2016, 04:59:51 PM
Reply #10

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
OK I'll give it a shot .  Thanks.

So do you envision I would enter both these lines (as mentioned above) in my new wizard script?

/api/HomeAutomation.X10/<house_code>/Control.AllLightsOff
GET /api/HomeAutomation.X10/B/Control.AllLightsOff

January 06, 2016, 07:57:44 PM
Reply #11

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
Not exactly.  The code you posted is for the API which is accessed through a web connection.  You would call that with a command like:
Code: [Select]
<HG IP address>/api/HomeAutomation.X10/<house_code>/Control.AllLightsOn
The Wizard scripting language doesn't work like normal code.  You click something like
Code: [Select]
X10->All Llights->Control.On
I'm still not sure if there's a way to send the "ALL ON" or "ALL OFF" directly from a C# script.  I know you could do it with the following, but it won't send the same command as you are asking for.
Code: [Select]
Modules.OfDeviceType("Light,Dimmer,Switch").On();

January 07, 2016, 04:55:53 AM
Reply #12

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
ok thanks for all the advice so far.

I cant find any way to do AllOn or AllOff from the wizard. 

I have two questions:

1)  Does HG have any way to send commands via the Unix command line? 
2)  If anyone could share some info or an example on a basic C# or Python script that would be helpful

Thanks again!

January 07, 2016, 12:41:17 PM
Reply #13

kevin1

  • *****
  • Information
  • Hero Member
  • Posts: 330
For question #1, this worked from cygwin (unix command line tools for windows):
Code: [Select]
wget http://<ip>/api/HomeAutomation.ZWave/16/Control.On
For #2, look in Config menu, Programs, there are several in there.  Or you can search the forum for .hgx files to find the ones posted here which you can import (or open in text editor to study).  Or were you looking for something specific?

January 07, 2016, 02:49:45 PM
Reply #14

kevinvinv

  • ****
  • Information
  • Sr. Member
  • Posts: 196
Thanks,  I'll check what your pointers.

I have had a horrible time ramping up on this thing b/c the introductory documentation is nearly non-existent and there seems to be a lot of pitfalls... and oh yeah... I have only a few minutes a day to work on this thing   :)

Thanks again!!