Turn on/off local wifi device with bash script

187 Views Asked by At

I have a raspberry pi in my local wifi network. Also I bought smart socket which can be integrated with Alexa or Google Home Assistant. What is a best option to turn the socket on/off from my raspberry? I thought about installing alexa or google home assistant on the raspberry and somehow use one of these to control my socket. However I don't want to do that by voice but simply a bash script.

1

There are 1 best solutions below

0
On

It is possible to control the local wifi device with a bash script. You can use ifconfig to bring an interface up/down and configure it accordingly. But, it also depends on the integration of the smart socket with Alexa/Assistant, whether the manufacturer provides their own API endpoints for you to use or whether the user interacts through Assistant/Alexa. If you are using Google Assistant, you can leverage automations on Google Home App to control the device automatically.