Bartman wrote:I just use it as an egg timer and i had a macro as a sleep tmer for shutting down the computer.
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
<Action>
Timer.TimerAction(u'NightMode', 0, 1, 1.0, u'NightMode', False, True, 2, u'20:00:00')
</Action>
</EventGhost>
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
<Action>
Timer.TimerAction(u'Morning', 0, 1, 1.0, u'Morning', False, True, 2, u'05:30:00')
</Action>
</EventGhost>
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
<Action>
Timer.TimerAction(u'Telus Routine', 0, 0, 86400.0, u'Wakeup Telus', False, True, 2, u'13:56:00')
</Action>
</EventGhost>
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
<Action Name="Transmit IR Telus Box ON">
USB_UIRT.TransmitIR(u'0000 0047 0000 001A 00EA 00EA 001D 003A 001D 0075 001D 003B 001D 003B 001D 003B 001D 003B 001D 0075 001D 003B 001D 0075 001D 003B 001D 0075 001D 003B 001D 0075 001D 003B 001D 0075 001D 0075 001D 0075 001D 0075 001D 003B 001D 0075 001D 003B 001D 0075 001D 003A 001D 0075 001D 01D1', 4, 0)
</Action>
Try my solution:prostetnic wrote:Is it possible to do this in any way?
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1449">
<Folder Name="Check 10 hours lighting">
<Macro Name="Initialization">
<Event Name="Main.OnInit" />
<Action>
EventGhost.DisableItem(XmlIdLink(16))
</Action>
<Action>
Timer.TimerAction(u'Start_lighting', 0, 0, 86400.0, u'Start_lighting', False, True, 2, u'10:00:00')
</Action>
<Action>
EventGhost.PythonScript(u'eg.globals.Time_Counter = 0\neg.globals.Light_Flag = False\n')
</Action>
</Macro>
<Macro Name="Light ON">
<Event Name="Timer.Start_lighting" />
<Action>
EventGhost.EnableItem(XmlIdLink(16))
</Action>
<Action>
EventGhost.PythonCommand(u'print "Lighting 10 hours started"')
</Action>
<Action>
Timer.TimerAction(u'Check_Time', 0, 0, 60.0, u'Check_time', False, True, 4, u'00:00:00')
</Action>
<Action>
EventGhost.PythonCommand(u'eg.globals.Light_Flag = True')
</Action>
</Macro>
<Folder Name="Pause/Continue" id="16" Enabled="False">
<Macro Name="Pause">
<Action Name="Here insert an Event">
EventGhost.Comment()
</Action>
<Action>
EventGhost.PythonCommand(u'print "Now switch light OFF"')
</Action>
<Action>
EventGhost.PythonCommand(u'eg.globals.Light_Flag = False')
</Action>
</Macro>
<Macro Name="Continue">
<Action Name="Here insert an Event">
EventGhost.Comment()
</Action>
<Action>
EventGhost.PythonCommand(u'print "Now switch light ON"')
</Action>
<Action>
EventGhost.PythonCommand(u'eg.globals.Light_Flag = True')
</Action>
</Macro>
</Folder>
<Macro Name="Minutes counter">
<Event Name="Timer.Check_time" />
<Action>
EventGhost.PythonScript(u'if eg.globals.Light_Flag:\n eg.globals.Time_Counter+=1\n if eg.globals.Time_Counter >599: # 10 hours\n eg.result = True\n else:\n eg.result = False\n\n ')
</Action>
<Action>
EventGhost.NewJumpIf(XmlIdLink(30), 0, False)
</Action>
<Action>
EventGhost.PythonCommand(u'print "Lighting:", eg.globals.Time_Counter,"minutes"')
</Action>
</Macro>
<Macro Name="Light OFF" id="30">
<Action>
EventGhost.PythonCommand(u'print "Now switch light OFF"')
</Action>
<Action>
EventGhost.DisableItem(XmlIdLink(16))
</Action>
<Action>
Timer.TimerAction(u'Check_Time', 4, 1, 1.0, u'', False, True, 1, u'00:00:00')
</Action>
<Action>
EventGhost.PythonCommand(u'print "Lighting 10 hours finished"')
</Action>
</Macro>
</Folder>
</EventGhost>Users browsing this forum: No registered users and 1 guest