HomeGenie Forum

Automation Program Plugins and Wizard Scripting => APP Contributions => Topic started by: mvdarend on December 19, 2014, 05:51:04 PM

Title: Wake on LAN (WOL)
Post by: mvdarend on December 19, 2014, 05:51:04 PM
Here's another simple app which sends a WOL Magic Packet, to wake up devices in your network. Not sure of the best way to make a widget for this though... what do you think?

Should it be possible to create a widget per device with its own MAC address, or should I just leave it at a single point which can be called with Send('AA-BB-CC-DD-EE-FF')


Edit 20-12-2014: New .hgx file. Put UdpCLient in a 'using' block.
Title: Re: Wake on LAN (WOL)
Post by: tasioX on December 19, 2014, 06:27:30 PM
This is great thank you for putting this together.  You will also want to add a menu for the broadcast address as well since to may be different from the one you had in the program.  Mine is 192.168.10.255 for instance.
Title: Re: Wake on LAN (WOL)
Post by: mvdarend on December 19, 2014, 07:04:11 PM
You can edit the Broadcast address in the above .hgx file
Title: Re: Wake on LAN (WOL)
Post by: tasioX on December 20, 2014, 06:57:41 PM
Ah, I see now.  Sorry I hadn't actually looked at the new HGX, and I thought the picture of the MAC address was on the options tab.  I guess I was thinking that you would enter both the MAC address and the Broadcast address in the options tab for simplicity but this works great either way.
Title: Re: Wake on LAN (WOL)
Post by: mvdarend on December 20, 2014, 07:00:40 PM
Yeah, I'm not sure how to go about it.

Either leave it as it is now, allowing you to call it and send the MAC address of the device you want to wake up, or make it so that you can have multiple Widgets, each having their own MAC/Broadcast parameters.

Edit: Actually, I don't even know how to go about making it so that each widget has their own properties, could anyone point me in the right direction?
Title: Re: Wake on LAN (WOL)
Post by: xefil on December 29, 2014, 12:43:33 PM
Sorry for the maybe stupiod question but I'm really new on HG.
How/where to set the MAC Address of the device I would like to wake?

Thanks!

Simon
Title: Re: Wake on LAN (WOL)
Post by: mvdarend on December 29, 2014, 03:20:34 PM
The app can be called with SEND('AA-BB-CC-DD-EE-FF'). (Don't forget to set the Broadcast address in the app properties.)

If you look at the screenshot in the first post, you'll see an example I created with the HomeGenie Wizard interface:

HomeAutomation.Network.WOL.1
Send
[MAC address]

Hope this helps
Title: Re: Wake on LAN (WOL)
Post by: xefil on December 29, 2014, 04:23:22 PM
The app can be called with SEND('AA-BB-CC-DD-EE-FF'). (Don't forget to set the Broadcast address in the app properties.)

If you look at the screenshot in the first post, you'll see an example I created with the HomeGenie Wizard interface:

HomeAutomation.Network.WOL.1
Send
[MAC address]

Hope this helps

Hello mvdarend,
I'm sorry but it's more a problem I can't understood very well how to use the Wizard. I've done the following:

1. downloaded your HGX file
2. From HOME -> Configure -> Automation -> Contrib Choosen the Action: Import Program
3. Choosen Program and then Uploaded
4. Enbled
5. Clicked on the Program to open the OPTIONS menu
6. Configured the 'Network broadcast address'

So, then?
I really cannot understand how to go thorough the Wizard Interface :(
I've searched for documentation too, but with no luck.

Simon
Title: Re: Wake on LAN (WOL)
Post by: mvdarend on December 29, 2014, 06:59:14 PM
Hi Simon,

You're almost there, here are the steps to actually send a command:

- Go to Configure -> Automation and open the group you would like to add the new wizard program to. (or create a new group)

- Choose Actions -> Add new Program and give it a name -> OK

- Go to tab 'Program Code' and click 'Add Command'

- Wizard Step 1/4: Select WOL
- Wizard Step 2/4: Select 1
- Wizard Step 3/4: Select 'Custom API Command'
- Wizard Step 4/4: Type 'Send' (without quotes)
- Wizard Step 4/4 pt 2: Type the MAC address of the device you'd like to Wake -> Done

- Select Actions -> Save

- Select Actions -> Run and the Magic Packet should be sent.

Once that works you can define a trigger, or just call it from another Script.

I realize it's a bit messy, but I created this for another forum user to see if it would work. (I don't actually make use of it myself.)
Title: Re: Wake on LAN (WOL)
Post by: xefil on December 30, 2014, 10:35:28 AM
Hello mvdarend!

Thanks a lot for the support. I was able to complete the setup and create a button on the dashboard as well!  ;D
Use it in a trigger or in another script is now a little too much for me. I'm tring to understand a little bit more how the whole stuff and logic works testing an own code :) (see my thread http://www.homegenie.it/forum/index.php?topic=586.0 (http://www.homegenie.it/forum/index.php?topic=586.0)).
Meanwhile at least a little step further was made :)

Again thank you!! :) :)

Simon
Title: Re: Wake on LAN (WOL)
Post by: Bitcraze on August 11, 2016, 11:08:17 AM
Hi, Mvdarend

Thanks so much, it's working great. Not a nice looking button, i.e. nice round border around it. Is this because there is no "APP" in HomeGenie for this?

Also, I would like to add another Button, in the same Group, that can shut down my Windows PC as well. DOS Command would be something like:

shutdown /s /m \\Laptop

How can I do this?

Title: Re: Wake on LAN (WOL)
Post by: [email protected] on August 11, 2016, 03:26:35 PM
why not just calculate the brodcast address from the currently configured adapters subnet mask and network?

I suspect that would cover 99.9% of users.
Title: Re: Wake on LAN (WOL)
Post by: mvdarend on August 11, 2016, 08:09:36 PM
Also, I would like to add another Button, in the same Group, that can shut down my Windows PC as well. DOS Command would be something like:

shutdown /s /m \\Laptop

How can I do this?
To be quite honest, I have no idea... :/

Quote
why not just calculate the brodcast address from the currently configured adapters subnet mask and network?
I hadn't thought of that, it should work I guess, but I'm not sure how to go about it. I actually made this app because someone requested it some time ago, I don't actually use it myself.