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

rleiman

Well-Known Member
Licensed 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
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!
 

rleiman

Well-Known Member
Licensed 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!
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!
 

rleiman

Well-Known Member
Licensed 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.
 

DonManfred

Expert
Licensed User
Top