Android Question Controlling smart plugs, lights etc from a b4a app

rleiman

Well-Known Member
Licensed User
Longtime User
Greetings,

I noticed on Google Play there are several apps that are able to control WIFI smart devices such as plugs, lights etc. Can a B4A app be used to control those devices like the Alexa and eWeLink apps do?

Is there a B4A library that allows an app to connect to the WIFI network and configure a smart plug so it can be turned on and off?

Thanks.
 

walt61

Active Member
Licensed User
Longtime User
Hi @rleiman ,

I'm pretty sure it depends on whether a manufacturer has published API documentation (or some clever soul has reverse-engineered one), and for WIFI-connected devices I haven't come across any standards, as opposed to e.g. Zigbee connections.

For Sonoff devices (as you mentioned eWeLink) the only option I found is this python project which I intend to use on my B4J RPi server program that then communicates with my front-end Android app. I might give it a shot to 'B4Xify' the python code, but that could be a while - I don't speak python so there would be a lot of trial and error involved - and, once I get to actually playing with the things, I'll probably first use the python code via jShell.

I realise this doesn't really answer your question, but perhaps it offers some food for thought. Good luck!
 
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
Thanks for the reply,

Please let me know when you have something ready on B4X and if you can include a sample B4A project demonstrating the coding that would be great!
 
Upvote 0

rleiman

Well-Known Member
Licensed User
Longtime User
From which devices EXACTLY you are talking about?
Where is the device SDK?
One is a smart plug from Amazon for the Alexa app.
Another is a smart LED bulb that uses the TechLife Pro app.
Another is a smart plug that uses the eWeLink app.

I had to add those other apps as a skill in the Alexa app.

Unfortunately I don't know if there is a SDK for any of them.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
Enter MQTT in the search engine of our forum and you will find many solutions ...
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Search the forum for MQTT

Here is an old video of me using MQTT to control relays.

And here is another video of me controlling a SonOff 4CH control panel.

Erel has created some great tutorials with code on using MQTT, all you have to do is follow his examples and you will be on your way to controlling plugs, switches, lights etc etc etc using MQTT...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…