Hi,
I was switching from Tasker to Automagic Premium because of the nice flows, which are a great optical programming help.
Now I have a little problem and hope to get some help here.
I'm using a relay with a bluetooth interface, so I can easily connect to it with my Samsung Tab. But now I wonder how to send commands via bluetooth in order to switch the relay. The commands are already known from the relays user manual. But how to send them? Do I need a plugin or can I do that within Automagic Premium?
Best regards,
nanobot
Sending commands via bluetooth serial port
Moderator: Martin
Sending commands via bluetooth serial port
Last edited by nanobot on 11 Aug 2014 10:52, edited 1 time in total.
Re: Sending commands via bluetooth
Maybe I have to go more into detail.
The relay is called TOSR02 from TinySine. There is a separate App which works great - one just have to connect to the bluetooth relay and then can easily toggle the two relays between on and off. I want to use it in my car together with my Samsung Tab 4. Everytime the tabs battery is getting low I want to toggle the relay by Automagic which is installed on the tab. The tab is plugged to the relay at all times and is being charged if the relay is in the state "on". Now I'm in search of a Automagic feature or a compatible plugin to send commands to the relay via bluetooth whenever the battery of the tab is low or even fully charged.
The relay is called TOSR02 from TinySine. There is a separate App which works great - one just have to connect to the bluetooth relay and then can easily toggle the two relays between on and off. I want to use it in my car together with my Samsung Tab 4. Everytime the tabs battery is getting low I want to toggle the relay by Automagic which is installed on the tab. The tab is plugged to the relay at all times and is being charged if the relay is in the state "on". Now I'm in search of a Automagic feature or a compatible plugin to send commands to the relay via bluetooth whenever the battery of the tab is low or even fully charged.
Re: Sending commands via bluetooth
Hi nanobot, were you able to do that with Tasker? If yes - was it some plugin involved or it was a natively supported in Tasker?
Re: Sending commands via bluetooth
Hi ZSasha,
I didn't try that in Tasker up to now because it's a new project and I don't want to use both apps. If it is not possible with Automagic than I have to try it with Tasker, but I love Automagic!
If there is no Automagic action which can handle bluetooth serial connections than I have to do it by a plugin or by command line. But that's very new for me.
I didn't try that in Tasker up to now because it's a new project and I don't want to use both apps. If it is not possible with Automagic than I have to try it with Tasker, but I love Automagic!
If there is no Automagic action which can handle bluetooth serial connections than I have to do it by a plugin or by command line. But that's very new for me.
Re: Sending commands via bluetooth serial port
Hi,
There's no built-in way to communicate with a BT device directly so you would have to use a plugin for now. Maybe SL4A also allows to communicate over BT.
BT serial communication is something that is on my list of features under consideration but I did not yet have the time to look at it so I can't promise anything yet.
Regards,
Martin
There's no built-in way to communicate with a BT device directly so you would have to use a plugin for now. Maybe SL4A also allows to communicate over BT.
BT serial communication is something that is on my list of features under consideration but I did not yet have the time to look at it so I can't promise anything yet.
Regards,
Martin
Re: Sending commands via bluetooth serial port
Hi,
now everythings works great with Automagic Premium and my BT serial connection. I installed SL4A and PY4A and now I can start my script.py by the action "Plugin" very easy.
Here is my script if anyone will be interested in it:
Bye,
nanobot
now everythings works great with Automagic Premium and my BT serial connection. I installed SL4A and PY4A and now I can start my script.py by the action "Plugin" very easy.
Here is my script if anyone will be interested in it:
Code: Select all
import android
import time
droid = android.Android()
mac = '01:02:03:04:05:06' #here you have to change the mac address by the one of your paired BT device
uuid = '00001101-0000-1000-8000-00805F9B34FB'
command = 'd'
droid.toggleBluetoothState(True) #if your BT is off you can switch it on
droid.bluetoothConnect(uuid,mac)
droid.bluetoothWrite(command)
time.sleep(2) #the script will pause for 2 seconds
droid.exit()
nanobot
-
- Posts: 186
- Joined: 12 Feb 2014 01:45
Re: Sending commands via bluetooth serial port
interesting, thank you for sharing
Best regards,
AngelAtwOrk
AngelAtwOrk