Android Question Interact with Bluetooth plug

DonManfred

Expert
Licensed User
Longtime User
I don´t think that there is a possibility to Power ON a Bluetooth Device. Same probably applies to power off.
 
Upvote 0

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
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime 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.
 
Upvote 0

MarkusR

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

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".
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime 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.
 
Upvote 0

MarkusR

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

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?
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime 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.
 
Upvote 0

thetahsk

Active Member
Licensed User
Longtime 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.
 
Upvote 0
Top