Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Send command to trigger macro via HTTP?

If you have a question or need help, this is the place to be.
Post Reply
User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Send command to trigger macro via HTTP?

Post by Livin »

I want to run a script, via XBMC, to send a web/http command to trigger a macro.

I've been trying the following code and appreciate any help you can give.

import urllib
WEBSVR = "http://192.168.2.11:8082/control.html?"
macroname = "wmc.load"
# Encode the data
params = urllib.urlencode({macroname})
# Send POST command
urllib.urlopen(WEBSVR, params)
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Re: Send command to trigger macro via HTTP?

Post by Livin »

got it working.

I did a single command...

import urllib
urllib.urlopen('http://localhost:8082/control.html?wmc.load')


btw, for anyone new to this, it looks like any HTML file can be used as EG simply looks for the argument after the ? and sees it as a trigger.
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
Post Reply