Page 1 of 1

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

Posted: Thu Mar 26, 2020 6:13 am
by peterlcw
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.

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

Posted: Thu Mar 26, 2020 9:19 am
by neilgl
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).

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

Posted: Sat Mar 28, 2020 4:31 am
by peterlcw
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.

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

Posted: Sat Mar 28, 2020 12:53 pm
by jbudd
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

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

Posted: Sat Mar 28, 2020 1:45 pm
by neilgl
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.

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

Posted: Sat Mar 28, 2020 5:13 pm
by peterlcw
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.

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

Posted: Sun Apr 05, 2020 8:47 am
by peterlcw
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.