Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Suggestion for CC BUTTONS Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
gg102
Senior Member
Senior Member


Joined: January 29 2013
Location: United States
Online Status: Offline
Posts: 245
Posted: April 26 2014 at 10:10 | IP Logged Quote gg102

In the CC, there are buttons to turn devices on or off. For me, and probably others, this is not sufficient. We'd like like to see these buttons display the status of the device.

I have written a whole lot of macros to:
ph_setccobjgraphic(cc_page,x,x,x, object_graphic)

For me, these are all in a macro that gets called from another macro that gets triggered by a cc_refresh. It's a really big macro.

I use green to indicate on, blue to indicate off, gray when it's not, and red when there's a problem like it's off and shouldn't be.

Dave, what I'd like to suggest is this;
Since you're doing a database update, how about adding 4 cols to the cc table. These cols would be, for example, on_graphic, off_graphic, other_graphic and formula.

The formula col could contain either a blank or a formula. If blank, the button would use the up_graphic. (for compatibility) If there is a formula, it would return a 0,1,2 or 3.

0 = up_graphic (for compatibility)
1 = on_graphic
2 = off_graphic
3 = other graphic.
The down_graphic would remain as it is.

Edit:
So the way this would work is that the formula would be for each button. Something like (for x10)
case (ph_getx10stat("SOME_DEVICE") whatever...

So, when it's on, the ON button could be green, and the off button would be gray. When it's off, the OFF button would be blue and the on button would be gray.
(I tried to upload an image, but I can't seem to do that)

Since you're currently doing a database update, this would be a good time to add this.



Edited by gg102 - April 26 2014 at 10:33
Back to Top View gg102's Profile Search for other posts by gg102
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: April 26 2014 at 13:55 | IP Logged Quote dhoward

gg,

I like the idea. However, Ive pretty much frozen the current code development to work on putting the deployment package together so I would need to wait until after this release.

After 2.1.5 is out, I have plans to start working on the Control Center rewrite. Ive already developed the tables and several of the screens. The new CC will break the existing "Item Type" into two new fields, Object Type and Object Style. To give you an idea of where Im going with this, the Object Type will have the following choices:

Text
Graphic
Group Box
Rectangle
Round Rectangle
Web Page
Slider (Text)
Slider (Graphic)

Depending upon the object type you choose, you'll be able to select from the following object styles:

Static
Global Var
Date/Time
Analog I/O
Digital I/O
Insteon
Insteon Group
X10
UPB
UPB Link

You may be wondering where are thermostat commands but we're covered since all thermostat types were moved into the analogio table for 2.1.5.

The new control center will also support gradients on the various types (not graphic types though).

Concerning your suggestion...after thinking about it and reviewing the new CC code in progress, I would like to incorporate it by adding a new formula column for object styles associated with devices (Analog I/O, Insteon, etc). Whenever a device status changes, the formula will be executed which would allow you to set the graphic directly from the formula (as opposed to predefining it in a on/off/other type column). This would give you the flexibility to change the displayed graphic (up or down) to whatever instead of limiting you to the 4 choices. It would also give the user the ability to dynamically update object types other than graphics such as the background and foreground colors of text type objects for people who prefer text buttons to graphic buttons.

Anyways, do you think that this would give you the functionality you'd desire?

Also, Im not going to bite off so much on this next development round and will likely release 2.1.6 after the CC changes (and some other minor updates that got missed in the 2.1.5 version).

Let me know,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
gg102
Senior Member
Senior Member


Joined: January 29 2013
Location: United States
Online Status: Offline
Posts: 245
Posted: April 26 2014 at 16:27 | IP Logged Quote gg102

Dave,

Thanks for the reply.

I really really like the formula col idea, but, what I have run into was that with cc graphics is it's real easy to overflow the formula (1024) with lengthy path names for graphics. That's why I thought that "canning" 4 objects would save all that text from the formula.

I DO LIKE the idea of making it more flexible and yes, canning 4 objects was limiting.

How about this:
Allow for a macro in the formula...ok, I guess that would come with the territory when the formula gets built in (ph_macro("something")), but doing that would allow for more than one statement/formula.

I had another crazy idea:
What do you think about the idea of putting up a picture/jpg of my house floor plan, and have different little icons/jpgs for objects that I can poke onto the picture; like a light on/off or a TV on/off. That would be an interesting CC page. Then if they were "active graphics" you could click them to turn them on/off.

Wait, I can do that now with the current system. I guess I'll be busy for a few weeks. Never mind....



Edited by gg102 - April 27 2014 at 11:11
Back to Top View gg102's Profile Search for other posts by gg102
 
gg102
Senior Member
Senior Member


Joined: January 29 2013
Location: United States
Online Status: Offline
Posts: 245
Posted: April 28 2014 at 11:56 | IP Logged Quote gg102

Dave,

1) I'm curious. How would the formula col work for displaying global variables? I have a couple hand written "status" pages that display no buttons, only global variables. When would these get their formula triggered?

It's actually more complex than that. I conditionally display some globals based on a global that is not displayed.
ie:
if (HOUSE_MODE="AWAY", display on_time else display blank).
In this example, HOUSE_MODE is not displayed. Thus its formula would not get triggered. Would I need a null object on the cc page to handle this situation?

That's why I have a refresh-macro triggered on cc_refresh to set the button colors and CONDITIONALLY re-capture the globals from their respective devices or direct_sql. It might help if I could simply force a cc refresh but there's no command (that I've found) for that.

The formula col would definitely and significantly help, but it might not go far enough. I'd also need a "do_not_display" type thing so I don't have to set the global on_time to blank then display it - which I currently have to do; not pretty because if HOUSE_MODE changes I have to re-capture the on_time from the direct_sql and re-poke the global.

It would be SO MUCH cleaner in the new formula col to:
if (HOUSE_MODE="AWAY", display on_time else do_not_display_this_object)
(Yes, I could set the ph_setccobjcolor=background) but that's not clean.....

2) To add to the list, it would be nice to have a system global that I can set for a web page refresh rate. I'm currently using the WEB pages (since the remote cc crashes -we've talked about that).

3) I keep trying to upload a pic here to show you, but I get errors from the forum. It would help if I could show you these things.

Back to Top View gg102's Profile Search for other posts by gg102
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: April 29 2014 at 19:36 | IP Logged Quote dhoward

gg,

1. Originally I wasnt thinking of having the formula column for global variables (only devices) but there wouldnt be any reason why we couldnt. It would be executed when the global variable changes and you could perform various tasks related to the global in the formula.

Concerning the CC Refresh...The CC Objects are currently stored in a table named ccbuttons and these values/settings are what is set from the CC Design or from the PH Explorer. When the Control Center is launched, a copy of the records in this table is made to table named ccbuttonstemp. When you make changes to CC objects using the ph_ccobj functions, the changes are only made to the temp table thus preserving your original design settings. The CC Refresh trigger is fired anytime PowerHome must refresh the rows in the ccbuttonstemp table (CC startup, changes to CC in the PH Explorer or Design view). You could force a CC Refresh by calling the ph_ccclearchgs function.

Concerning the "Do Not Display" option, I'd have to look into that a little closer. Are you thinking if Do Not Display is checked, that the entire CC Object is not displayed or just the text leaving the background color and borders? The closest you can get right now is to use either the ph_setccobjx or ph_setccobjy functions to set the x or y value to a negative number (you could simply multiply the x or y value by -1 to toggle back and forth). This will take it offscreen rendering it invisible. Additionally, you could use the ph_ccmodifyid function to actually render it invisible but this is getting a little deep and wouldnt render on a web CC. If you're just interested in making the entire CC Object invisible, then I should be able to add/modify a CC function to provide that functionality.

2. Part of the CC rewrite will include changes to the web CC so that elements can be updated in the background dynamically (essentially an auto refresh). I can make this interval customizable. In the meantime, you should be able to achieve something close by creating an HTML page in the PH webserver directory that contains code to auto refresh an iframe (reference this link: http://stackoverflow.com/questions/6975765/how-to-refresh-an -iframe-automatically) and then set the iframe source to the URL of your Control Center. If you make the iframe 100% without borders you won't even be able to visibly tell a difference between you auto refresh version or the standard CC page.

3. Not sure why the picture upload isnt working for you. The image size is limited to 150K and sometimes the code is browser dependent. You could email me the pics (so I can see what you're explaining) and I'll upload them the forum for you.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
gg102
Senior Member
Senior Member


Joined: January 29 2013
Location: United States
Online Status: Offline
Posts: 245
Posted: April 29 2014 at 21:29 | IP Logged Quote gg102

Dave,

Thanks for the information. This is getting a lot more complex than I was thinking. I'll think a little more about this.

The first pic is showing why it’s important to be able to have an on/off and “not” state for buttons. If all the buttons worked as they default, there would be no way to know if the day is enabled or not. This page uses a lot of globals to operate this matrix.



The second image, is an example of displaying or not displaying a global. If you see the CHRISTMAS_TREE doesn’t have an on or off time. That’s because it’s not currently December. So, this device doesn’t currently operate.   Other devices DO have on and off times because they are currently operational.   These other devices also change state depending if I’m home or not.



I'm sure this helps show you what I'm talking about.
Again, thanks Dave.


Edited by gg102 - May 01 2014 at 00:08
Back to Top View gg102's Profile Search for other posts by gg102
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum