INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Scenes (and devices) via command line  (Read 4797 times)

drmimosa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 691
Scenes (and devices) via command line
« on: February 12, 2017, 10:08:05 pm »

How do you turn a scene on and off via Windows command line? Or via the Engen Command line?

I've set up a regular IR remote control to turn individual devices on and off via Eventghost and an ir receiver, but turning scenes on and off would be even more useful.

Thanks!
Logged

linutic

  • Recent member
  • *
  • Posts: 33
Re: Scenes via command line
« Reply #1 on: February 13, 2017, 07:41:26 pm »

The command "scene_set('complete scene name')" should do it for you.

You can also set all the devices in a scene to a specific value (e.g 88) with "group_set('complete scene name', 88)".   That's how we turn all the devices in a scene off.

Of course this works the same in the terminal window as on the command line.

I suggest you get into the terminal window and type "help()".   It describes some other things you can do as well.   If you wish, you can do "help()" on the command line as well.
Logged

linutic

  • Recent member
  • *
  • Posts: 33
Re: Scenes via command line
« Reply #2 on: February 13, 2017, 07:45:47 pm »

Forgot to mention the command "watch(1)".   It allows you to watch the logfile, which is otherwise pretty hard to do in Windows.   From the command line, omit the "-n" option.

When you have had enough, "watch(0)" stops the logfile display.
Logged

drmimosa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 691
Re: Scenes via command line
« Reply #3 on: March 26, 2017, 02:44:48 pm »

Linutic, I have one additional command line question when you have a chance. I have just moved my Engen server to a Pi Id.

I would like to turn switches on and off via a windows .bat file (for amplifiers on a house music system). The .bat script are running on a separate computer from the Engen Id Pi. I would also like to modify several Eventghost commands on my system.

Previously, I had the Engen server and the .bat files on the same machine and just ran command line arguments to turn devices on and off via a script. I would like to turn on device 25, which is an Aeon power switch.

Is there a way to do this via REST? Can I send a command via a web browser to turn on and off a specific device?

I'm currently investigating the Engen Documentation, and I've tried entering "http://192.168.1.132:52125/api/v1" into a browser and I get a successful "Hello World." But "http://192.168.1.132:52125/api/v1/:25" won't return data for device 25.

Is there a way to to accomplish this with a browser command?

I hope I've described what I'm trying to do clearly. I'm basically trying to send commands to an Engen server on a local network in a way analogous to Media Center's MCWS commands via a web browser.
Logged

drmimosa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 691
Re: Scenes (and devices) via command line
« Reply #4 on: March 26, 2017, 03:08:36 pm »

I found this web command from an old post on OneRemote:

http://192.168.1.132:52125/alpha000/basic_set?node=25,value=0

It returns the following code:

Code: [Select]
{
  "function": "basic_set",
  "param": {
    "node": "25,value=0"
  },
  "result": {
    "status": "selected 25,value=0"
  }
}

But it doesn't seem to turn the switch on and off...
Logged

drmimosa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 691
Re: Scenes (and devices) via command line
« Reply #5 on: March 26, 2017, 03:21:22 pm »

Ok, I found a browser basic_set that worked! It came from the old test file documentation:

http://192.168.1.132:52125/alpha000/basic_set?node=25&value=99
Logged
Pages: [1]   Go Up