more G-Labs products

Author Topic: Wake on LAN (WOL)  (Read 3777 times)

December 19, 2014, 05:51:04 PM
Read 3777 times

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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.
« Last Edit: December 20, 2014, 09:25:21 AM by mvdarend »

December 19, 2014, 06:27:30 PM
Reply #1

tasioX

  • *
  • Information
  • Newbie
  • Posts: 19
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.

December 19, 2014, 07:04:11 PM
Reply #2

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
You can edit the Broadcast address in the above .hgx file
« Last Edit: December 19, 2014, 07:07:11 PM by mvdarend »

December 20, 2014, 06:57:41 PM
Reply #3

tasioX

  • *
  • Information
  • Newbie
  • Posts: 19
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.

December 20, 2014, 07:00:40 PM
Reply #4

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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?
« Last Edit: December 20, 2014, 07:03:39 PM by mvdarend »

December 29, 2014, 12:43:33 PM
Reply #5

xefil

  • **
  • Information
  • Jr. Member
  • Posts: 31
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

December 29, 2014, 03:20:34 PM
Reply #6

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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

December 29, 2014, 04:23:22 PM
Reply #7

xefil

  • **
  • Information
  • Jr. Member
  • Posts: 31
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

December 29, 2014, 06:59:14 PM
Reply #8

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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.)
« Last Edit: December 29, 2014, 07:02:11 PM by mvdarend »

December 30, 2014, 10:35:28 AM
Reply #9

xefil

  • **
  • Information
  • Jr. Member
  • Posts: 31
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).
Meanwhile at least a little step further was made :)

Again thank you!! :) :)

Simon

August 11, 2016, 11:08:17 AM
Reply #10

Bitcraze

  • ***
  • Information
  • Full Member
  • Posts: 73
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?


August 11, 2016, 03:26:35 PM
Reply #11

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
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.

August 11, 2016, 08:09:36 PM
Reply #12

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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.
« Last Edit: August 11, 2016, 08:12:13 PM by mvdarend »