reboot at midnight

If you have a question or need help, this is the place to be.
Post Reply
scottsams
Experienced User
Posts: 55
Joined: Fri Jul 07, 2017 9:59 pm

reboot at midnight

Post by scottsams » Fri Aug 11, 2017 10:17 pm

or whenever...

i found reboot, found system uptime. i am looking for absolute time - i.e. 12:00 AM, or w/e. is there a way to do that so i can set my machine to reboot at a certain time?

User avatar
kgschlosser
Site Admin
Posts: 3030
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: reboot at midnight

Post by kgschlosser » Sat Aug 12, 2017 12:14 am

you would need to use the schedulghost plugin. this will allow you to trigger an event at a specific time of day and from that event you can set the reboot into action..

I do want to make one note on this. EG will freeze the reboot if there is unsaved data. I am not sure but I also think that if you have open dialogs it will as well. the python script below will circumvent the halting of the reboot. the first 2 lines you can change to True or False, these are the lines that determine whether to save any data in an open dialog or to save tree data. You will want to place this into a Python Script action and put the action before the Reboot action. I have not tested this code but it should work. the only thing I may have to change is the use of CallAfter. i may need to use eg.AsTasklet instead.

Code: Select all

SAVE_TREE = False
SAVE_OPEN_DIALOGS = False

import wx

if eg.document.frame is not None:
    for dialog in eg.document.frame.openDialogs[:]:
        if SAVE_OPEN_DIALOGS:
            try:
                if dialog.panel.isDirty:
                    wx.CallAfter(dialog.DispatchEvent, wx.ID_OK)
            except AttributeError:
                pass
        wx.CallAfter(dialog.Destroy)

if eg.document.isDirty:
    if SAVE_TREE:
        eg.document.Save()
    else:
        eg.document.isDirty = False
If you like the work I have been doing then feel free to Image

scottsams
Experienced User
Posts: 55
Joined: Fri Jul 07, 2017 9:59 pm

Re: reboot at midnight

Post by scottsams » Sat Aug 12, 2017 3:02 pm

oy, not sure what happened but i was testing reboot and after my pc came back up i am getting this on all Webserver sent to another EG events. they were all saved. i cannot seem to see anything that is not configured right. any ideas?


Error in Action: "Webserver: Send event to another EventGhost: ST.Kitchen Motion Sensor.motion.inactive"
Traceback (most recent call last) (0.5.0-rc4):
File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 116, in CallWrapper
return self(*args)
File "C:\Program Files (x86)\EventGhost\plugins\Webserver\__init__.py", line 4141, in __call__
Request("TriggerEnduringEvent", event)
File "C:\Program Files (x86)\EventGhost\plugins\Webserver\__init__.py", line 4127, in Request
sock.send("\r\n".join(data))
AttributeError: 'NoneType' object has no attribute 'send'

scottsams
Experienced User
Posts: 55
Joined: Fri Jul 07, 2017 9:59 pm

Re: reboot at midnight

Post by scottsams » Sat Aug 12, 2017 3:14 pm

nevermind... a second reboot fixed it. not sure what happened

User avatar
kgschlosser
Site Admin
Posts: 3030
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: reboot at midnight

Post by kgschlosser » Sat Aug 12, 2017 4:28 pm

don't know... glad ya solved it tho.
If you like the work I have been doing then feel free to Image

scottsams
Experienced User
Posts: 55
Joined: Fri Jul 07, 2017 9:59 pm

Re: reboot at midnight

Post by scottsams » Tue Aug 15, 2017 11:19 pm

kgschlosser wrote:don't know... glad ya solved it tho.
issue still occurring even after a reboot. any idea on what may be happening? anyway to figure it out?

Send Event ST.Kitchen Motion Sensor.motion.active
Webserver: Send event to another EventGhost: ST.Kitchen Motion Sensor.motion.active
Error in Action: "Webserver: Send event to another EventGhost: ST.Kitchen Motion Sensor.motion.active"
Traceback (most recent call last) (0.5.0-rc4):
File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionBase.py", line 116, in CallWrapper
return self(*args)
File "C:\Program Files (x86)\EventGhost\plugins\Webserver\__init__.py", line 4141, in __call__
Request("TriggerEnduringEvent", event)
File "C:\Program Files (x86)\EventGhost\plugins\Webserver\__init__.py", line 4127, in Request
sock.send("\r\n".join(data))
AttributeError: 'NoneType' object has no attribute 'send'

User avatar
kgschlosser
Site Admin
Posts: 3030
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: reboot at midnight

Post by kgschlosser » Wed Aug 16, 2017 5:57 am

I would post this question in the Webserver support thread under the plugins thread.

It seems as tho there is something wrong with the creation of the socket.
If you like the work I have been doing then feel free to Image

Post Reply