peterlcw
Posts: 4
Joined: Wed Mar 25, 2020 4:42 pm

Project: Using Raspberry PI as a Web Server to turn on WiFi switchi S

Thu Mar 26, 2020 6:13 am

Hi, I doing a Project on Application to use Raspberry PI as a Web Server to turn on WiFi switch.

I'm new to this and really need all the help I can. Anyone can point to me where in this forum I can get help to start it.

User avatar
neilgl
Posts: 2226
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Project: Using Raspberry PI as a Web Server to turn on WiFi switchi S

Thu Mar 26, 2020 9:19 am

If you can program the WiFi switch with Tasmota firmware, it can then accept MQTT or http messages over the network to turn on/off. Then send the relevant command from your pi via web page with PHP or python.

If not you could look at the WiFi switch manufacturer’s software method to se if it has an API you could use, some can be integrated with openhab2 which runs on the pi and has a nice set of web pages (panels).

peterlcw
Posts: 4
Joined: Wed Mar 25, 2020 4:42 pm

Re: Project: Using Raspberry PI as a Web Server to turn on WiFi switchi S

Sat Mar 28, 2020 4:31 am

The switch menu indicated can use Smart Life APP to connect to the switch in 2 mode. Easy Mode or AP Mode. Also, it can use Google Home, Amazon Alexa.

Spec of switch:

Wi-Fi Smart Power Switch
Using 2.4 GHz 802.11b/g/n
Amazon Alexa, IFTTT, Google Home

If I use OpenHAB with APP would that be a programming project?

Or is it possible I come up with a simple Application with APP.?

Anyways, both I don't know how to do.

jbudd
Posts: 1446
Joined: Mon Dec 16, 2013 10:23 am

Re: Project: Using Raspberry PI as a Web Server to turn on WiFi switchi S

Sat Mar 28, 2020 12:53 pm

Can you post a link for the exact type of wifi switch you have?

From my point of view the trouble with some/most/all wifi switches is that they expect you to connect to some cloud service to use them. It's all too complex for me.
So I prefer, if possible, to replace their code with Tasmota. It connects no further than my home wifi and accepts commands to turn on or off from a Raspberry Pi via MQTT
Last edited by jbudd on Sun Mar 29, 2020 1:34 am, edited 1 time in total.

User avatar
neilgl
Posts: 2226
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Project: Using Raspberry PI as a Web Server to turn on WiFi switchi S

Sat Mar 28, 2020 1:45 pm

Using openhab2 is not really a programming project, it is more a case of configuration of a program that someone else has written (in java), using plugins that other people have written.

peterlcw
Posts: 4
Joined: Wed Mar 25, 2020 4:42 pm

Re: Project: Using Raspberry PI as a Web Server to turn on WiFi switchi S

Sat Mar 28, 2020 5:13 pm

I have installed an Apache Server on the Raspberry PI running on Raspbian. As for the switch, the IP is configured using "Smart Life APP". The configuration comes in 2 mode. Easy Mode (Recommended) or APP mode.

How can the MQTT be used on the switch? It seems that firmware upgrade is needed to get it working.
Or can I make use of the APP to connect to the switch and turn it on?

I don't have much time as I have only 1 month to get it working. Hope I can quickly get this going.

peterlcw
Posts: 4
Joined: Wed Mar 25, 2020 4:42 pm

Re: Project: Using Raspberry PI as a Web Server to turn on WiFi switchi S

Sun Apr 05, 2020 8:47 am

Hi I need to get the front end computing out seriously fast. Anyone has any example of UI programming for the inputting data. Such as pressing a button on the Webpage to trigger the backend switch to turn on.

Return to “Beginners”