Welcome @Fuschy!
I would tackle this in two main steps:
- Use the wake-on-LAN binding, and make sure you can wake-on-LAN from a sitemap switch
- Add the Alexa integration
I can help with step number 1.
A note first, however: the Wake-on-LAN binding is a v1 binding. OpenHAB is currently at v2, so the Wake-on-LAN binding still works. However, soon openHAB will move to v3 - this issue tracks the status of existing bindings, and what will happen in v3. It looks like the Wake-on-LAN binding will be sucked into the Network binding, so we’ll still have a method to perform Wake-on-LAN. OpenHAB v3 is not out yet, though, so I merely note all this so you’re aware that in the future, if you upgrade to v3, you will need to make some changes again.
Install Wake-on-LAN binding
From the PaperUI, install the Wake-on-LAN binding. In a browser, go to the IP address of your device which hosts openHAB, at port 8080. If the device is the same one that you’re writing these posts on, just got to http://localhost:8080/paperui/.
Once in PaperUI, go to Add-ons, then click the Bindings tab. Find the WOL (Wake-on-LAN) Binding, and click install.
Create Item for PC
Create a file called wol.items
, and save it in your openHAB items
folder. In this file, add the following:
Switch sWoLPC { wol="192.168.1.255#d4:3d:7e:f2:36:30" }
Full configuration details are here, but essentially:
- If your PC is at IP address 192.168.1.112 (for example), use the IP address 192.168.1.255 in the Item. If your PC is at 192.168.0.112, use 192.168.0.255 in the Item.
- The part after the # is the mac address of your PC
Add switch to sitemap
We now need to add a switch to our sitemap. Open your sitemap file from the sitemap
openHAB folder, and add the following:
Switch item=sWoLPC label="PC WoL" mappings=[ON="PUSH"]
If no sitemap file exists, you will need to start one. Name it strictly mySitemap.sitemap
, save it in the sitemap
openHAB folder, and add the following:
sitemap mySitemap label="mySitemap" {
Switch item=sWoLPC label="PC WoL" mappings=[ON="PUSH"]
}
This will give you a button which says PUSH
in your sitemap (address will be something like http://localhost:8080/basicui/app). Press that button, and the WoL packet will be sent.
Once you’ve got this working, then move on to the Alexa stuff. I don’t use it, so can’t help unfortunately!