Switch and bluetooth

Hello I have the same problem please help
When you enter the switch applications, you don’t need to do anything and when you turn it on, it should send the “S” character over the bluetooth and after 2 seconds it should send the “K” and after 500 milliseconds it should send the “P” and when the switch is turned off, the bluetooth should send the character “M” and after 500 milliseconds "D" and after 2 seconds should send character "L"
Thank you

I am trying to understand your problem described here. Check if I am wrong.

  • when the app opens:

    • send "S".

    • wait for 2 seconds and send "K".

    • wait for 0.5 seconds and send "P".

  • when the user turnes off the switch:

    • send "M".

    • wait for 0.5 seconds and send "D".

    • wait for 2 seconds and send "L".

Am I right?

A little bit misunderstood, when the application opens you don’t need to do anything, when you turn on the switch:

send "S".

wait for 2 seconds and send "K".

wait for 0.5 seconds and send "P".

when the user turns off the switch:

send "M".

wait for 0.5 seconds and send "D".

wait for 2 seconds and send "L".

when you enter the application the switch should turn off and should not send anything

Check if this works:

Switch.aia (3.8 KB)

You have to choose a valid Bluetooth address in the ListView first, then you can turn the switch.

1 Like

Thank you, everything worked out, but another problem appeared, please help
There are 5 such switches.
1switch
when switch is turned on
send "1alga".

wait for 2 seconds and send "algatokta".

wait for 0.5 seconds and send "alga45skr".
when the user turns off the switch:

send "algatokta".

wait for 0.5 seconds and send "artka".

wait for 2 seconds and send "artkatokta".
2switch
when switch is turned on
send "2alga".

wait for 2 seconds and send "2algatokta".

wait for 0.5 seconds and send "2alga45skr".
when the user turns off the switch:

send "2algatokta".

wait for 0.5 seconds and send "2artka".

wait for 2 seconds and send "2artkatokta".
3switch
when switch is turned on
send "3alga".

wait for 2 seconds and send "3algatokta".

wait for 0.5 seconds and send "3alga45skr".
when the user turns off the switch:

send "3algatokta".

wait for 0.5 seconds and send "3artka".

wait for 2 seconds and send "3artkatokta".
4switch
when switch is turned on
send "4alga".

wait for 2 seconds and send "4algatokta".

wait for 0.5 seconds and send "4alga45skr".
when the user turns off the switch:

send "4algatokta".

wait for 0.5 seconds and send "4artka".

wait for 2 seconds and send "4artkatokta".
5switch
when switch is turned on
send "5alga".

wait for 2 seconds and send "5algatokta".

wait for 0.5 seconds and send "5alga45skr".
when the user turns off the switch:

send "5algatokta".

wait for 0.5 seconds and send "5artka".

wait for 2 seconds and send "5artkatokta".

and still need two buttons
If some kind of switch is turned on when the button is touched, then they should turn off and do their duties when turning off, I hope you understand me

Try to find the pattern in the code. As you can see, the second item in each item in the list is the timer interval in milliseconds, and that the second item of the last item is 1000. I will try to put together a complete AIA tomorrow.

1 Like

This has the same timing delays you would see in Morse code ...

Hello. were you able to decide?

Woops, almost forgot it. I am making the AIA. What would you like to call the first switch here?

1 Like

switch1
and I have a question, is it possible to change the intervals of a second later? this does not affect the stability

So is this OK if I name the switches Switch1 - Switch6?

1 Like

yes the name doesn't matter

Can you please test this? Note: if you turn on a switch and then turn on another switch immediately, the app will stop for the first switch and continue for the second switch.

See if this is what you want.

Switch_1.aia (6.1 KB)

thanks for the hard work!
There, when you connect the bluetooth, only 4 switches appear.
I need five.
And perhaps for example, all switches are on. If you disable any of them, then all switches should
blocked before all the symbols had time to leave, after sending they should open, and so with all

Only 4? It should be 6.

image

I have now labeled each Switch. Does this show all switches?

Switch_2.aia (161.8 KB)

1 Like

Can you restart the companion by going to Connect > Reset connection, exit the companion app, and try again?

1 Like