The off button is setup to only trigger when the off button is triggered (pressed). It sends a command to tell the computer to sleep. The luup code is setup inside the trigger and not in the main luup section of the scene. It will not get triggered if the status changes. I have tested this and it works with out issue.
Correct. It will not have any issues if the computer is only told to sleep and never hibernates.
Try it with hibernate.
If it works perfectly for a few days, then it must be something on my end. But I tell you, without your plugin, using separate WOL and ping sensors mine works flawless. Only when Iāve introduced the OFF button trigger on your device does it go haywire. .
I use MCE and have a dedicated scene for hibernate that makes the call in the scene code. This way if Iām using VeraMoble i can execute it directly. Only works while logged in, but thatās the only case I need for now.
I then use a dedicated Combination Switch to act as a device button so that other scenes can trigger it. The hibernate scene listens to the trigger on that device. So ārunningā the scene, or triggering that device will signal MCE to hibernate.
When I wire up to your plugin, I simply add a trigger to the hibernate scene that listens for the off button press. If I was to add the code to the trigger, then I would have to do so for every trigger. Not manageable!
It is my opinion that you should not have code in the triggers unless you are attempting to have a blocking mechanism or need to have specific code for that event.
You say this plug in is not for me. What you are saying is its not for everyone and only works for āsleepā because it doesnāt do exactly what it says.
Everything Iāve reported is revealing to you a seriously fatal edge case that you are just inches away from solving.
If youāre gonna do something, do it right. Testing code on best case scenarios is asking for trouble. Weād all love for everyone to have ideal environments so that everything behaves as we expect. But that is almost never the case. I say to you that I am NOT the worst case scenario.
I have done the testing for you, and if I was your QA department, I would not let you release this plugin. If you do plan to fix it, then I suggest enabling hibernate on one of your computers (preferably the slowest one) and increasing your ping rate to see what happens with a hibernate action on the off button (reguardless of how itās done). Only after you have tested this yourself and made corrections will I try this plugin again.
Iām having problems triggering WOL with the ping sensor plugin. I want the ping sensor to activate my scene to wake one of my PCs if it is off. I have the following luup script.
The serivceId string is incorrect. You can see the correct one to use in the wiki samples, on code.mios.com, as well a various scene scripting posts in the forum.
I am using this WOL with ping sensor to bring up my system and check on the status and it works a charm.
however i am having problem of using the OFF button to switch of my windows 8 PC.
I saw that eventghost is the way. but I am lost on how to configure this to work.
mind to share in details the steps and code on how to do this?
One way would be use the EventGhost Vera plugin: http://forum.micasaverde.com/index.php/topic,7881.0.html to monitor when you get a Vera.Lounge.HTPC.OFF event, for example. That event just needs to be paired to the shutdown command in EventGhost.
I am using this WOL with ping sensor to bring up my system and check on the status and it works a charm.
however i am having problem of using the OFF button to switch of my windows 8 PC.
I saw that eventghost is the way. but I am lost on how to configure this to work.
mind to share in details the steps and code on how to do this?
thanks[/quote]
I setup eventghost to use the web server plugin. I use a url like so for the machine that is running eventghost:
http://computer_ip:port/eventghost.html?SleepPC
The html file I just created with an empty html template. But you do not have to have the html file it could be just this:
http://computer_ip:port/?SleepPC
Eventghost will see that a SleepPC request was issued and you can take that request to have it trigger the suspend or shutdown command for windows.
For the off button a created a scene to listen to the off trigger event of the wol plus ping device. So you would create a scene say āMediaPC Offā and have a trigger to use the wol plus ping sensor device and the trigger event would be āA device is triggered on or offā and the trigger mode would be āDevice is triggered offā. I than add the following luup code for that trigger:
-- Issue sleep command to MediaPC via Eventghost http
local http = require("socket.http")
http.TIMEOUT=5
result, statuscode, content = socket.http.request("http://computer_ip:port/eventghost.html?SleepPC")
log("Result"..result)
Iām finding the ping result is often false alerting for me. Does your plugin do just a single ping test? It may be more reliable if multiple pings are done (configurable count number), and then only report the server is down (off) if all pings time out.
Iāve no experience in developing plugins, so Iām not sure how your plugin works or if it would relatively easy to extend the functionality.
[quote=ājtmoore, post:72, topic:172491ā]Hi Garrett. Thanks for developing this plugin.
Iām finding the ping result is often false alerting for me. Does your plugin do just a single ping test? It may be more reliable if multiple pings are done (configurable count number), and then only report the server is down (off) if all pings time out.
Iāve no experience in developing plugins, so Iām not sure how your plugin works or if it would relatively easy to extend the functionality.
jtmoore.[/quote]
What type of device are you issuing a ping to? I can add a variable to set the ping count. However, depending on how many times you want to issue a ping, it can take long to issue the command.
[quote=āgarrettwp, post:74, topic:172491ā]What type of device are you issuing a ping to? I can add a variable to set the ping count. However, depending on how many times you want to issue a ping, it can take long to issue the command.
Garrett[/quote]
Hi Garret. I havenāt yet tried installing the alternative version that Brientim referred me to, to see if that behaves differently.
The target server is a NAS on same LAN as my Vera lite. The NAS is a Netgear ReadyNAS Pro. I was thinking 4 pings would be sufficient, and only alert if all 4 ping attempts failed.
Of course, I could just have an intermittent LAN problem, so I will have one of my PCs run a continuous ping and log results for comparison.
Thanks.
Jtmoore.
The post that Brientim pointed to I believe is the current version in the app market. The ping command has an option on the ping counts. I added a value that allowed you to set this. So if you set the ping count to 4, it will ping four times and report weather all four times failed or not. Would this be good enough? This can slow the command down a little bit, but should be ok if set to a low number like 5 or less. The default value is 1.
The app market version is showing version 1.0. I can see values for Period, Enable, and Invert, but I do not see one for ping count. A count of 5 would be good enough for me.
I have not submitted the new changes yet as I just added them and need to test it. Odd I thought I posted version 1.1. Iāll submit the new version in a few days once I know things are working ok.
Uploaded new version to the app store for approval. New version allows you to set the ping count. The default is 1, I would recommend no more than 5. It can be set via the advance tab under the ācountā variable.
Iām assuming you are just setting the ping count in the ping command rather than delaying and doing another single ping. Would it be difficult to do separate pings with an adjustable interval between them?