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.

A touchscreen GUI...

If you have a question or need help, this is the place to be.
Post Reply
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

A touchscreen GUI...

Post by krambriw »

I was thinking of having a GUI for a small wall mounted touchscreen.

After reading and testing a bit it seems to be a good choice to write .hta applications to send events to eg.

The code below works fine if the .hta executes in the same machine as eg runs in. But is there a way I can change this to work over networks? Like the -n option for the command line???

My idea is to have eg running in my house server and the .hta in a wall mounted client

Best regards, Walter

Code: Select all

		var EventGhost = new ActiveXObject("EventGhost"); 

		function trigger(event){ 
				EventGhost.TriggerEvent(event); 
		}
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: A touchscreen GUI...

Post by Bitmonster »

You can try the Webserver plugin.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: A touchscreen GUI...

Post by krambriw »

Do u have a small sample the sends an event?
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: A touchscreen GUI...

Post by Bitmonster »

You have to extend the URL with a questionmark and the event you want:
http://localhost/index.html?MyEvent
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: A touchscreen GUI...

Post by krambriw »

OK, thanks, got it working.

Best regards, Walter
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: A touchscreen GUI...

Post by krambriw »

If this could be some help for others, I would be happy!

Below are screen shots of my small html I use to control indoor and outdoor lights of my house. Besides manual control through the GUI, I have a separate application that sends triggers for the outdoor lights to EG by calculation of local sunset/sunrise.

Everything works perfect according to my needs!

To do the same, you need to add the web server plug-in, configure it and create your macros, actions and events. Then take my sample named "EgCtrl.html" and edit accordingly. Put it then in the web root.

You can see that my EG events are named like D1_ON, B1_OFF etc and typically you navigate with url's like ...EgCtrl.html?D1_ON

The code is really simple and easy to change if you need other/more buttons.

Code: Select all

<head>
		<title>Lightcontrol</title>
</head>
<body onload="parent.reSize()">
<table border="1"  width="50%">
  <tr><!-- Row 1 -->
    <td><input type="button" value="Light in bookshelf: ON" onclick="location.href='EgCtrl.html?D1_ON'" style="background-color: green; color: white;"></td><!-- Col 1 -->
    <td><input type="button" value="Light in bookshelf: OFF" onclick="location.href='EgCtrl.html?D1_OFF'" style="background-color: red; color: white;"></td><!-- Col 2 -->
     <td><!-- Col 3 -->
  </tr>
  <tr><!-- Row 2 -->
     <td><input type="button" value="Window lights upstairs: ON" onclick="location.href='EgCtrl.html?D2_ON'" style="background-color: green; color: white;"></td><!-- Col 1 -->
     <td><input type="button" value="Window lights upstairs: OFF" onclick="location.href='EgCtrl.html?D2_OFF'" style="background-color: red; color: white;"></td><!-- Col 2 -->
     <td><!-- Col 3 -->
  </tr>
  <tr><!-- Row 3 -->
     <td><input type="button" value="Entrance light: ON" onclick="location.href='EgCtrl.html?D3_ON'" style="background-color: green; color: white;"></td><!-- Col 1 -->
     <td><input type="button" value="Entrance light: OFF" onclick="location.href='EgCtrl.html?D3_OFF'" style="background-color: red; color: white;"></td><!-- Col 2 -->
     <td><!-- Col 3 -->
  </tr>
  <tr><!-- Row 4 -->
     <td><input type="button" color="red" value="Light livingroom: ON" onclick="location.href='EgCtrl.html?D4_ON'" style="background-color: green; color: white;"></td><!-- Col 1 -->
     <td><input type="button" value="Light livingroom: OFF" onclick="location.href='EgCtrl.html?D4_OFF'" style="background-color: red; color: white;"></td><!-- Col 2 -->
     <td><!-- Col 3 -->
  </tr>
  <tr><!-- Row 5 -->
     <td><input type="button" value="Light outdoor: ON" onclick="location.href='EgCtrl.html?B2_ON'" style="background-color: green; color: white;"></td><!-- Col 1 -->
     <td><input type="button" value="Light outdoor: OFF" onclick="location.href='EgCtrl.html?B2_OFF'" style="background-color: red; color: white;"></td><!-- Col 2 -->
     <td><!-- Col 3 -->
  </tr>
  <tr><!-- Row 6 -->
     <td><input type="button" value="Light garage: ON" onclick="location.href='EgCtrl.html?B3_ON'" style="background-color: green; color: white;"></td><!-- Col 1 -->
     <td><input type="button" value="Light garage: OFF" onclick="location.href='EgCtrl.html?B3_OFF'" style="background-color: red; color: white;"></td><!-- Col 2 -->
     <td><!-- Col 3 -->
  </tr>
</table>
</body>
</html>

The first picture is just to demonstrate when I control the lights from my smartphone. I have tried it over internet as well and it works of course but for security reason this is now disabled.

The second picture shows the small window on my laptop screen with the browser pointing to the EG webserver.

Thanks for the nice EG software!!!

Best regards, Walter
Attachments
Image2.jpg
Image2.jpg (77.61 KiB) Viewed 3863 times
Image1.jpg
Image1.jpg (106.3 KiB) Viewed 3867 times
CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: A touchscreen GUI...

Post by CollinR »

I do this with X10 on my systems.


Here is how I do it...

Install EG on each machine, link their XML files back to the fileserver.

On the Automation server I setup the entire lighting control Events, basically I only do "scene" controls.

In EG looks like:

Event:
TCP.NightMode ['192.168.1.3']

Actions:
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
<Macro Name="Night Mode" Expanded="True">
<Event Name="TCP.NightMode">
</Event>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
System.Execute(u'C:\\Program Files\\Home Control\\x10com32.exe', u'e1 off', 3, False, 2, u'')
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
System.Execute(u'C:\\Program Files\\Home Control\\x10com32.exe', u'e2 off', 3, False, 2, u'')
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
System.Execute(u'C:\\Program Files\\Home Control\\x10com32.exe', u'e3 off', 3, False, 2, u'')
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
System.Execute(u'C:\\Program Files\\Home Control\\x10com32.exe', u'e3 dim 40%', 3, False, 2, u'')
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
System.Execute(u'C:\\Program Files\\Home Control\\x10com32.exe', u'e4 on', 3, False, 2, u'')
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
System.Execute(u'C:\\Program Files\\Home Control\\x10com32.exe', u'b1 off', 3, False, 2, u'')
</Action>
<Action>
EventGhost.Wait(0.10000000000000001)
</Action>
<Action>
System.Execute(u'C:\\Program Files\\Home Control\\x10com32.exe', u'b1 on', 3, False, 2, u'')
</Action>
</Macro>
</EventGhost>




Then on each touchscreen all you do is run EG in "lite" mode only having a network sender installed.

You can call it like this.

EventGhost.exe -n 192.168.1.2:1234 1234 NightMode

(EventGhost.exe -n {Host}:{Port} {Password} {Eventname})


Works like a charm. :D
Post Reply