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.

simple task to wake up monitor - screen saver

If you have a question or need help, this is the place to be.
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: simple task to wake up monitor - screen saver

Post by kgschlosser »

ok well i went ahead and made up that RDP session loggin in and out and setting the display properly when using that DesktopDisplay add-on I made. I am going to be out of the house whore a while today and I wanted to get this to ya.

It is all self contained. so anything it needs as far as setting variables it will make. I put in some error handling as well.. for things like if you are in an RDP session and restart EG. it has no way of knowing what the original state of the switch was or if you are in an RDP session. so it will spit out a notice in the log telling you to toggle the wall switch and possibly restart the RDP session. but it will always default to leaving the screen on. and a simple toggle of the wall switch will fix this if it happens to be backwards. This can also happen if you have the switch off and you have to reboot the computer. the screen will default to on as well. and will require a toggle of the switch to get it back in sync. I do not know if there is a way to check the state of the switch. if there is via something like HTTP this can be added as well. then there would be no need to sync anything.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="0.5.0-rc4" Guid="{5EE4F107-2AA3-4802-8DB8-604BD73F8D36}" Time="1501852367.14">
    <Folder Name="Display Blackout" XML_Guid="{5EF73764-95C1-4FC6-A23A-C897E479651D}" Expanded="True">
        <Macro Name="Display Blackout Off" XML_Guid="{512BEA4F-6AE7-442C-A35A-A73CBC3F08B1}" Expanded="True">
            <Event Name="HTTP.ST.DummySwitch.switch.on" XML_Guid="{10A19873-FA79-40F4-8395-F3DA4712BEA5}" />
            <Action Name="Blackout Off" XML_Guid="{9A62027A-8840-4099-B6A7-B57F005E4B54}">
                EventGhost.PythonScript(u"if not hasattr(eg.globals, 'display_blackout'):\n    eg.globals.display_blackout = None\n    \nif not hasattr(eg.globals, 'rdp_state'):\n    eg.globals.rdp_state = None\n    \nif eg.globals.rdp_state is None:\n    eg.PrintNotice(\n            'Display Syncing Error:\\n'\n            'Please logoff RDP session if one is active.\\n'\n            'Please toggle wall switch to resync.'\n            \n        )\n    eg.globals.rdp_state = False\n\neg.globals.display_blackout = False\ndisplay = eg.DesktopDisplay.GetDisplay(0)\n\nif not eg.globals.rdp_state and display.blackout:\n    display.blackout = False\n\n")
            </Action>
        </Macro>
        <Macro Name="Display Blackout On" XML_Guid="{5D90EB1B-DA40-4E3A-8C29-BA74324B1B5A}" Expanded="True">
            <Event Name="HTTP.ST.DummySwitch.switch.off" XML_Guid="{AF66EEE0-592A-4CCC-8B36-DFA09ADECC8F}" />
            <Action Name="Blackout On" XML_Guid="{162BD3AF-1E95-4D7C-AB71-743EA7CA2AB4}">
                EventGhost.PythonScript(u"if not hasattr(eg.globals, 'display_blackout'):\n    eg.globals.display_blackout = None\n    \nif not hasattr(eg.globals, 'rdp_state'):\n    eg.globals.rdp_state = None\n    \nif eg.globals.rdp_state is None:\n    eg.PrintNotice(\n            'Display Syncing Error:\\n'\n            'Please logoff RDP session if one is active.\\n'\n            'Please toggle wall switch to resync.'\n            \n        )\n    eg.globals.rdp_state = False\n    \neg.globals.display_blackout = True\ndisplay = eg.DesktopDisplay.GetDisplay(0)\n\nif not eg.globals.rdp_state and not display.blackout:\n    display.blackout = True\n\n")
            </Action>
        </Macro>
        <Macro Name="RDP Session Connect" XML_Guid="{7D2B0529-7E0C-47D6-B17E-9EFD05896858}">
            <Event Name="System.RemoteConnect" XML_Guid="{4B73EA84-178D-4EC4-A039-1458B257F3C4}" />
            <Action Name="RDP Connect Set Blackout" XML_Guid="{8DAEB60F-8E10-4ECD-8BF4-D14EFE71BA98}">
                EventGhost.PythonScript(u"if not hasattr(eg.globals, 'display_blackout'):\n    eg.globals.display_blackout = False\n    \nif not hasattr(eg.globals, 'rdp_state'):\n    eg.globals.rdp_state = None\n\nif eg.globals.rdp_state is None:\n    eg.PrintNotice(\n        'Display Syncing Error:\\n'\n        'Please Toggle Wall Switch to resync.'\n    )\n    \neg.globals.rdp_state = True\ndisplay = eg.DesktopDisplay.GetDisplay(0)\neg.globals.display_blackout = display.blackout\n\nif display.blackout:\n    display.blackout = False\n    ")
            </Action>
        </Macro>
        <Macro Name="RDP Session Disconnect" XML_Guid="{C92A4B69-3075-4DDE-B633-C49C3ED2AFAA}">
            <Event Name="System.RemoteDisconnect" XML_Guid="{189402CC-958B-4AE8-951C-07A764B921A2}" />
            <Action Name="RDP Disconnect Set Blackout" XML_Guid="{10EA3251-2765-41B1-A080-47DA3E7B770D}">
                EventGhost.PythonScript(u"if not hasattr(eg.globals, 'display_blackout'):\n    eg.globals.display_blackout = False\n    \nif not hasattr(eg.globals, 'rdp_state'):\n    eg.globals.rdp_state = None\n\nif eg.globals.rdp_state is None:\n    eg.PrintNotice(\n        'Display Syncing Error:\\n'\n        'Please Toggle Wall Switch to resync.'\n    )\n    \neg.globals.rdp_state = False\ndisplay = eg.DesktopDisplay.GetDisplay(0)\n\nif eg.globals.display_blackout:\n    display.blackout = True\n\neg.globals.display_blackout = display.blackout")
            </Action>
        </Macro>
    </Folder>
</EventGhost>
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: simple task to wake up monitor - screen saver

Post by scottsams »

that did it! i downloaded that display file, installed in Classes, just created a new EG file, installed web services, pasted your code and it works. i am viewing display from a remote camera - looks like display is still active but screen is blank. i think that will do for me. i will check it out in person in a bit.

as for the display, i am using what i intend to use. it is a 15" touch panel.

ASUS 15.6" 1366x768 HDMI VGA 10-point Touch Eye Care Screen LCD Monitor (VT168H)

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

Re: simple task to wake up monitor - screen saver

Post by scottsams »

as a side note. my screen saver is set to go off after a minute. i checked back and it was on. i turned switch back on and it did not go off. no big deal. what is the shut monitor down doing?
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: simple task to wake up monitor - screen saver

Post by kgschlosser »

The blackout is litterally like it sounds. It blacks out. Does not stop anything from running. It simply makes a window the exact same size as your display and paint the whole window black. Now this does not turn anything off. So you may or may not get a glow. This all depends on the display and how it interperets a sold color that does not change. Some will consider this as no video and go into standby others will stay on. It's a crap shoot
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: simple task to wake up monitor - screen saver

Post by scottsams »

got it. thanks. it has a glow. mouse is visible but it works. so you said microsoft jacked up turning monitor back on? trying to read through all of your posts. i thought i was chatty.. :D
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: simple task to wake up monitor - screen saver

Post by kgschlosser »

OK get ready to do some light reading. But this concept is going to knock your socks off. but this is the kind of stuff I do.. i fine solutions.. as cheap and as easy as possible.


it's not that I am trying to be chatty. I am trying to educate.. because the more people that know how to do things and the more things that are known then there is a good chance that the "pay it forward" ideal will take place.. and the people I help will help others and so on and so forth. that is one of the main reasons why I like to really explain in depth what is going on.. first off because if you know then it is going to make it far less frustrating on the next addition you add because know you are armed with some knowledge and possible solutions can be obtained from that knowledge. But also there are others in here even seasoned users that I bet read that blurb on the Find Window action. as was like holy &%^@ I didn't realize that is how it works. and there is a specific bit of it i am talking about. being able to target something as small as a button and simply adding the send keystrokes after it with {enter} as a command is far better then trying to move the mouse to click on something. and that you do not have to have the Bring to front action after the Find window in order for this to work. it will send the key stroke to only that specific part and nothing else will see it (unless something else is set up to intercept keyboard input).


now EG is not simply limited to controlling Windows is it?? Nope.... it can control almost any piece of software that runs on windows. right down to selecting menu items. or a specific item in a choice box.

OK mouse is not an issue. I will have that fixed in a jiffy.

you specific issue is that when you connect via any RDP program.. a virtual monitor gets installed. and that monitor it set to be a mirror of the existing one. and since windows has no mechanism to be able to specifically turn on and off a single monitor that is attached. they would all have to be turned on if you connect via that RDP program.. because the virtual one still functions like a normal monitor would. except for.. they never added the parts about putting it into standby. because you shouldn't need to. so if you tell windows to power off the monitors. it will try to power off the RDP one as well, because windows can only change the power state of all monitors. and the virtual monitor or windows i do not know which pitches a fit when you try to turn it off... LOL... so you will not be able to test monitor actions from a remote desktop connection. nor will you be able to test sound card actions. There is a whole slew of virtual drivers that act more like redirection when an RDP session is taking place. so in reality simply using the monitor off and monitor on actions in EG should work just fine for you. but you will have to have the actions get disabled when you connect via an rdp session so windows doesn't have a heartattack if someone presses the light switch while you are connected. the screen saver things is a bit trickier but it can also be done.


Here is the BONUS!!!

my solution would actually allow you to connect 6 touch screens up to the same computer. HDMI will go 100' and with the advent of multi touch more then one display can be touched at the same time. you now have the ability to specifically turn on and off different displays depending on what switch gets pressed. this can be done with 2 pretty cheap video cards that have HDMI and DisplayPort connections on it. because you are running a 15" screen 800x600 would probably be the ideal resolution. possibly 1024x768 at 800x600 is not that much higher a resolution then 1080p and most video cards now will do 4K. so for 5 beans a card. and a bunch more screens and some long HDMI cables. you are ready to rock and rill and have cur your expense wayyyyyy down. and in all reality. you could ditch the whole RDP thing. centrally locate the machine. have a keyboard, mouse and monitor attached. and set that bugger as primary so it has the start bar and all the icons. and simply use EG to move whatever it is to be displayed to the proper monitor. and have EG handle the blacking out of those displays.. no need to do the mini-itx crap. for around 500USD build a single computer with 3 pcie slots for 3 video cards. a 120 gig ssd (ocz makes one that is rippin fast for 50 bucks i think), depending on what you want to display and actually control i would suggest 16 gig memory and you set the swap file to a gig. this will reduce any hammering on the ssd and prolong it's life. i picked up an AMD mobo with 4 pcie slots for 15 beans USD not to long ago. 6 core 3.2 amd i think is about 70. case is 30 with a PSU. and you would be able to connect 8 touch screens and one console screen.

so here is the breakdown.
50 HDD
125 mainboard -30 mail in rebate, -30 combo with processor. so call it 60 for sake of round numbers
30 case with psu
AMD FX 8320E Black Edition Vishera 3.2 GHz 8 Core AM3+ Boxed Processor 80.00 -30 with mobo combo. so 50.00
ocz 128gb SSD 60.00
16 gb ram 100.
50 each for the video cards

500.00... for the computer that will carry 8 touch displays and 1 console display.

hell i found 3M Multi-Touch Chassis Display C2167PW - 21.5" for 45 beans USD each You many need a raspberry pi for each display with virtual here to "extend" the USB. this will allow you to connect th USB from the touch display to the computer using you wifi network. USB is limited to 15 feet without the need for boosters or amps.. expensive.. raspberry pi is what 20 dollars if that?!? and this will also allow you to be able to plug in a memory card for displaying photos. or a music library.. whatever you want.


so here we go.. 500 for the machine.
50 for each of the 8 screens. = 400
20 for each raspberry pi one for each screen. 160


for a smidge over a thousand USD you get 8 21" touch screen displays with the ability to plugin USB accessories... all controlled by 1 machine. and you have the ability to turn on and off each display.. OOOh and btw.. because of the raspberry pi. a 5 dollar PIR sensor (motion sensor) and there is no need to even touch the light switch :-D coupled with EG and the SunTracker plugin it will know when to turn the lights on and off in the room as well as the display. which BTW can also be set with a timeout to blacken back up after a period of time and become awake again if someone touches it... :-D
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: simple task to wake up monitor - screen saver

Post by scottsams »

thanks again and i meant no offense on the chatty comment. you are very helpful and explain everything quite well. i agree - someone else will come upon this and probably learn more than i have.

i want to reiterate again, RDP is not in my plans for use. i apologize for mentioning it as it seems you did some work that i would not need however someone else will benefit from that for sure! and your panel system is a great idea. one issue for me would be 21" monitors hung all over the place. ;) wife may call it there. she has been luke warm to accepting my HA. i got the 15" because of kitchen counter top real estate. the 21" was actually cheaper. as for the minix it does what i need albeit i wish it were a tad smaller. strapping it to the back of this monitor will be fun hiding the cables and all to minimize clutter. as for a pi, i actually have one sitting here on my desk that i bought before i found EG. i was going to use it with Tasker and a couple of other programs but i just did not have the stomach for messing with those again. i did it once, got it working and then cratered the tablet i was planning to use and could not recreate my setup on another tablet for some reason.

so thanks again for everything. if you ever figure out how to shut down / turn on the monitor, let me know. actually shut down works. turning on is the one that is not working.

i really appreciate your help!
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: simple task to wake up monitor - screen saver

Post by kgschlosser »

I have a question...

I am not familiar with the display you are using. But... have you tried the Monitor Standby action??? because EG could literally be turning off the monitor with the monitor off action. in which would not be woken up from a mouse movement. so give the standby action a shot and see if it works. not a lot of displays function this way. to be honest yours would be the first i have ever seen the standby work on...


And Oh. the RDP thing i understand what you are saying.. But trust you me.. you will end up using it to maintenance that computer and screen. I do not think that using the touch interface to really get into changing things up in it is something you will want to do. and even if you plugged in a keyboard and mouse.. a 15" screen and a chair you would most likely not want to sit in for an extended period of time holding your hands up to the counter to type and operate the mouse in your kitchen i do not think is going to work. well... maybe it would work for you.. but almost 100%sure it is not going to work for the Mrs if she has to utilize the kitchen while you are working on the thing. LOL (i think you said it was going in the kitchen. i don't feel like going back and searching for it. If not ooops. heh..)
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
Posts: 5190
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: simple task to wake up monitor - screen saver

Post by kgschlosser »

and the funny thing is my wife was just like yours.. and I had bought a bunch of cheap android tablets and hung them about.. well i guess when you purchase cheap tablets and the batteries go bad inside of them it will not allow them to turn on even tho the tablet is plugged in. so after her having those tablets for 2 years when they started to die one at a time and she no longer had access to those "special HA features" she was quite disgruntled over the whole thing. kinda funny how the luke warm turned into her using almost every aspect of my HA system more then I do. LOL I will never even try to figure out what goes on in her head.. when i started doing a massive remodel project on the house (still doing it) actually remodeling the whole house is the better term. most of the HA system is now offline. she got all upset about the light not turning off when she left the house and on when she got home. My statement to her was.. "I remember you asking me if we really needed all of this stuff. and you didn't seem all that interested/happy about me doing it." funny how it changed.
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: simple task to wake up monitor - screen saver

Post by scottsams »

hey, i had a thought. i use the find "exe" and close to terminate a program. would that work for screen saver? it is a program. tried and it did not work but i would think it should.
scottsams
Experienced User
Posts: 55
Joined: Fri Jul 07, 2017 9:59 pm

Re: simple task to wake up monitor - screen saver

Post by scottsams »

i found a way to use screensaver and turn it off with motion detection. i am running pskill on motion detection to kill my screensaver. will continue testing but it looks good so far!
scottsams
Experienced User
Posts: 55
Joined: Fri Jul 07, 2017 9:59 pm

Re: simple task to wake up monitor - screen saver

Post by scottsams »

so far so good with pskill.
Post Reply