Page 1 of 1

Icons status using programs

PostPosted: Thu Jul 09, 2015 10:44 am
by brianp6621
When using ML to initiate a program, what determines the icon displayed and when does it change?

I am trying to use someones else's programs to create a 1 button toggle for my garage door, that also shows the actual current state.

He (Xathros on UDI forums) supposedly has a solution that works but it just doesn't for me (and at least one other person). Xathros states that the icon displayed for a program should reflect that programs state (true/false).

The programs that run do all the logic correctly, I only see a False when the door is close, and I only see a true when the door is open, but the icon only seems to change DURING the running of the program. Once the program terminates, the icon reverts back to its original version even though the door AND the program have changed state.

So again, the original question, when a program is a dashboard item, what determines the version of the icon that is displayed?

Re: Icons status using programs

PostPosted: Fri Jul 10, 2015 10:54 am
by AdminWes
Hi brianp6621,

If the program is actively running the Then path or Else path then the icon will show the "ON" state of the icon.
If the program is not running (it's just true or false) the icon is the "OFF" state.

When the program is true, the line at the top of card is green.
When the program is false, the line at the top of the card is red.

Wes

Re: Icons status using programs

PostPosted: Fri Jul 10, 2015 11:08 am
by brianp6621
Ok, thanks. That's what I thought. So using a ML link to a program and using the program evaluation (true/false) to control the icon displayed, will not work.

Bummer.

Re: Icons status using programs

PostPosted: Fri Jul 10, 2015 11:43 am
by AdminWes
Sure, just think of the problem a little differently:

Write the program like this:

If
Status 'Garage Door Sensor' is OFF
Then
Wait 1 minute
Run Program 'This Garage Door Sensor Program' (If)
Else
[LEAVE EMPTY]

When the garage door is open (sensor is off) the program is running. After 1 minute, the program runs itself again as long as the door is still open.

As soon as the door closes and the sensor goes to ON, the program exits out and evaluates to False and stops running.

Set the icon of the garage door to either the normal garage door or the reverse depending on how you want it to be displayed.

BTW: I'm greatly simplifying the garage door in the next MobiLinc 4.5 release I'm wrapping up now. You'll be able to tap the garage door sensor to activate the garage door. So you'll get status and control in the sensor icon.

Wes

Re: Icons status using programs

PostPosted: Fri Jul 10, 2015 12:53 pm
by brianp6621
Sure but that make it a status only program, which is better served by just looking at the status of the door sensor. I want to be able to control and get status from the same program/icon, like you say is coming in the next release.

Re: Icons status using programs

PostPosted: Fri Jul 10, 2015 1:56 pm
by AdminWes
Yes, it's overly complicated to get both status and control into a program with the MobiLinc icons. Main reason I needed to overhaul the sensor icon for the garage door in MobiLinc to just simplify status/control into one icon.

Wes