Android Question Interact with Bluetooth plug

martin mitch

Member
Licensed User
Thanks for your reply. So are you saying its probably not possible through B4A? So needs to be done through a different language?

Cheers
 

DonManfred

Expert
Licensed User
So needs to be done through a different language?
I don´t see a way to power off or on a Bluetooth Device using code. No matter in which language.

If the device is OFF you (the user) need to power it on to be able to connect to the bluetooth device.
 

MarkusR

Well-Known Member
Licensed User
what kind of "Bluetooth plug" do you speak?
 

martin mitch

Member
Licensed User
You can buy a "smart plug" off Amazon, for example, which you plug into the wall socket and then you plug, say, a lamp into. Then through an app on your phone you can switch the plug "on" or "off".
 

MarkusR

Well-Known Member
Licensed User
can u show a amazon product link/url ?

search here for the library BLE 2 - Bluetooth Low Energy

if your smart plug get serial data u need to know the command list.
 

MarkusR

Well-Known Member
Licensed User
WiFi is not Bluetooth ...
some WiFi devices using a cloud service means web api with http requests.
 

martin mitch

Member
Licensed User
Ah, good point. Not sure why I thought Bluetooth, you're right, they're WiFi, aren't they. So I would need to see if there's an API for the plug to interact with it?
 

MarkusR

Well-Known Member
Licensed User
i not like web services for this because they are outside of your home, you are dependently on it etc.

for web requests u can use the lib OkHttpUtils2 comes with the ide.
u need a web api description then, yes.

something autonomous home-made you can do with the raspberry pi or arduino microcontroller board.
 

thetahsk

Active Member
Licensed User
Don't buy that unknown Amazon crap. First choice, of a fully self controlled home automation system are alway the devices from Sonoff.
https://sonoff.itead.cc/en/
There is a well documentaded API and it's also possible to flash your own Tasmota firmware. The devices are all based on ESP8266 hardware plattorm.
https://github.com/arendst/Sonoff-Tasmota.

Sonoff-Tasmota
Alternative firmware for ESP8266 based devices like iTead Sonoff with web UI, rules and timers, OTA updates, custome device templates and sensors support. Allows control over MQTT, HTTP, Serial and KNX for integrations with smart home systems. Written for Arduino IDE and PlatformIO.
 
Top