Situations application feedback

Hello, the 326 works also fine on my x10III with 5.1.0.11 and the BT Problem with the BT bridge is also solved here. The fist start need also terminal because the screen was empty. But after that it works from launcher. Thanks I will tested it a hole day now…

Thanks @babo & @rdomschk , the empty screen with just Situation heading seems like the UI didn’t connect to background service - for whatever reason. I’ll see if I can reproduce with a fresh install.

Situations startup problems seem to have been caused by the app support bluetooth changes - causing some dbus exception to happen on non-root installations - i.e. on a default startup on a clean device. Or any installation with just a non-root service. Should be fixed now here. But I haven’t tested if bluetooth plugins work anymore with app support and non-root service. Probably not.

Also made some blind changes to watchface plugin. It was already broken, so most likely no harm trying to fix it. If anyone has a pebble watch, please check if the new plugin shows any signs of life with it.

Thanks

I had a quick look at watchface and when I click on ‘what’ to a situation entry and then try to add a watchface, the list remains empty.

Is there a way to turn bluetooth off, if it isnt connected to a device for a while?

Also if I use the followig automation it keeps turning off and on in a loop:
when:
Bluetooth = on and bluetooth device “XY” not nearby
do:
Bluetooth off

It would be cool if you be able to manually select between AND/OR commands.
And I’d like to trigger the start up command if the shell gets restarted. (patchmanager collides with the boot-commands if it doesnt start automatically after boot)

I have to say that the app is awesome. Coming from an iphone, it alone makes me fall in love with this device. It gives the user sooo much power without needing any linux knowledge.

Thanks for the feedback! The intent of the app is exactly to be somewhat intuitive while still be powerful enough for advanced uses also. So I guess that makes you a target audience :wink:

Sort of yes, but that “while” is quite limited at the moment. You can create a situation with a Bluetooth pro condition that has “Method” selected as “Active connection” (for some certain device connection) or “Any connection” (for any device connection). Then you can tap the condition icon to make it “negative” - i.e. the situation activates when ever that connection is not available.

As an action you can then have Bluetooth state. When editing that action (selecting on or off), in the bottom left corner there there is a small gear to edit action properties. Currently there is only one: timeout. From there you can set the a timeout for that action in milliseconds. But it can be maximum 60000 milliseconds, i.e. 60 seconds. So that’s the limitation.

I was thinking, perhaps there could be a separate “Timeout” condition that allows much bigger timeouts to be used. Alone it wouldn’t be too useful, but in this kind of case, combined with Bluetooth condition, might be. It would basically start a timeout right after the conditions before it have activated. So a situation could be active during that timeout. And by “negating” the timeout, a situation could instead become active after that timeout has passed. Requires a bit of mental juggling, but would such condition perhaps be useful?

For most actions the app restores previous values set in a situation when one is disabled. Perhaps that is what is happening here. Would it work better without the “Bluetooth = on” condition? When Bluetooth (or Wifi) is turned off, a periodic scanning condition should remember previous results precisely so that one could be used for this kind of scenario. But of course there might be bugs also…

Doing that would most likely complicate the UI a lot, so unlikely to happen. But you can achieve it by creating multiple situations instead. And using them in another situation as multiple conditions for a Situation condition (which are then “OR”).

Could you explain a bit more what exactly do you mean? Currently startup actions in Situations are reserved only for application startup itself. So could Situations perhaps also be restarted in this case? Or would there perhaps need to be a condition that tracks the shell state in an ordinary situation? Or something else…

I noticed a bug I had introduced earlier with plugin loading. Had to fix it, so updates are available here. Basically shouldn’t affect users much, but if you notice a plugin missing, please check the features page first if it is actually installed.

thanks for that long reply and especially your time!

60 seconds are enough to find a device and connect to it or reconnect on a connection loss.

I guess it would be enough, if you could set up a timer in the when clause and then the condition has to be true for as long as that timer is to trigger the actions. Similar to home assistant automations.

For most actions the app restores previous values set in a situation when one is disabled. Perhaps that is what is happening here.

Yes. I’m pretty sure thats the reason. I will try it with on next time. Would be cool, if there is an option while creating the situation to choose between trigger once or trigger in a loop like it happened here.

Doing that would most likely complicate the UI a lot, so unlikely to happen.

Yes, that would be difficult for sure. also it would complicate the code signifficantly i suppose. also combining and/or could create some weird behavior for people not used to such operators without also adding ().

Could you explain a bit more what exactly do you mean?

I try as best as i can :slight_smile:

i run the app karuselli to stick some apps into the partnered space. those apps are not started by default, so i trigger the launch with situations.

but if the ui crashes f.e., the apps wont get lauched again.

I also installed patch manager and its default setting willlaunch a few seconds after boot and restart the ui. vefore it triggers the restart itgives you the option to cancel it. the restart also closes my apps in the partnered space and situations wont fire them up again.

the app is already doing more than i could wish for! thanks for sacrificing your time with this cool project!

Would it be possible to have an action to connect to a BT device after the timeout? Looking at you Suunto. :eyes:

I know this would be a “purkkaviritys” (bubblegum bugfix), because currently the native Suunto Sync app drops the connection (for unknown reasons, powersave, something…), so would be nice to “ping” the watch and keep it connected. If the connection is inactive for a long time (during the night for example), the watch needs to be re-paired.

Yes, I’m aware this is something that @jarnose needs to fix, and it’s under investigation. So I understand that this may not be a viable option for Situations to-do list. If someone doesn’t want to connect to a speaker, or home theater with the condition that they are home, music is playing → connect to an avaiable BT speaker/system. Well, sound more like a home automation thingy to do actually.

Hmm.. that escalated. :slightly_smiling_face:

Updated packages with a Duration-condition. So perhaps @doctorflynt and @raketti can try to use that for bigger than 60s timeouts. Basically the condition will always be the last condition in a list - and thus activated only after all other conditions are met. And when activated, it will start the countdown. For a delayed situation start (instead of certain active duration) the condition can be negated by tapping the icon.

For updating a connection to a certain BT device, perhaps Situations can be used as something that notices when a connection disappears - but a connection back perhaps needs a script that could be then run as a custom command - after this new Duration condition has finished(?)

Ok. So, now I just need to find out how to fiddle with the Command option to connect to the Suunto.

Searching intensifies…

Ok, so, not as trivial as I expected. Just added a condition that when the Suunto is disconnected, Situations should run the following command:

bluetoothctl connect [MAC:ADDRESS:OF:THE:WATCH]

And BINGO - we have contact!

A question, there’s a timer setting in the situation, but it starts counting as soon as I set it up. Shouldn’t it start only when the condition matches? Also noticed that when the command is executed, it starts to search for BT devices - I know this is something out of Situations’ scope, but I found it peculiar that it does so, instead of just connecting to the defined device.

What timer setting are you referring to? Perhaps this: A situation mode can be “Timed” which means it will be manual for that time. And that mode starts immediately after a timeout for it is selected - so no conditions involved there. Well except that they will be disabled during that timed mode. And after the timeout the situation returns to automatic mode, i.e. be based on the conditions.

The new Duration condition starts when all conditions before that are active. If there are no other conditions, then that duration of course starts immediately - which is perhaps not so useful.

Or something else?

I’m using build 323, so I don’t have the Duration option. But that sounds exactly what I’d need. So as per my use case:

When

  • No connection to BT device
  • Wait N minutes

What

  • Connect to BT device

Yes, Duration can be used for that “Wait N minutes”. And in What section you can either run Command at situation end (when that duration is finished). Or tap the icon to negate it so that the situation itself starts only after that duration - and have the Command then run at the start (which should effectively disable that situation then after your Suunto connection is up and running again).

Brilliant! Well, yes, either works. Now the condition checks if the Suunto is not connected and runs the command. The Duration would just ease the stress on the situation - so that it wouldn’t bombard the bluetoothctl all the time, but for example every 30 minutes.

Ok, good :slight_smile:

Getting the Duration condition to Harbour may take months since the review process is so slow. In the meanwhile you can add that max 60000ms delay to the condition. I.e. when editing the command there should be a small gear icon on bottom left → tap that and put some delay there.

i dont know if im the reason but im not able to use it with my bluetooth situation.

When
Bluetooth = ON
Active Bluetooth Connection = False
Countdown = 00:01
Then
Bluetooth = Off

It doesnt seem to use the countdown correctly and it keeps switching bluetooth on and off in a loop, no matter what countdown is set.

Also it does seem to make a difference between
Bluetooth = On
Bluetoth != Off

If I may (since I struggled with the same issue :slight_smile:). The countdown in after the When section launches the situation after the counter has finished. What you want to do is:

  1. Open the bluetooth action in the What section
  2. In the bottom left corner, tap the gear
  3. Set the delay for 1000 ms (1 second)
  4. …profit :slight_smile:

Im not sure. I think im still in that loop where bluetooth keeps turning on and off. Just slower with the delay.

Is there a way where i can turn off that loop-function for certain tasks?

Yeah, you can’t have Bluetooth=On as a condition and Bluetooth=Off as action without getting into a loop. But, then again, is that Bluetooth=On condition really needed? Without it the situation will practically be always on when Bluetooth is off. But does it matter?

Anyway, I might introduce an action setting (besides the delay) to not remember previous state. But haven’t thought about it much yet.