Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Dynamic Objects in the Control Center Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
MrGibbage
Super User
Super User
Avatar

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: September 21 2010 at 16:26 | IP Logged Quote MrGibbage

How does one go about getting dynamic objects into a CC web page? I envision
where I might be looking at the CC on my cell phone, and as the volume is
increased on my receiver, the volume objects instantly reflects the change. Or
if the temperature in my house goes from 75 to 76 degrees while I am looking at
the display, that change is instantly reflected on the page. I don't want to
have to refresh the page.

So, am I looking for a red herring, or is it as simple as javascript/ajax/html 5
or something else?
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
MrGibbage
Super User
Super User
Avatar

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: September 26 2010 at 09:42 | IP Logged Quote MrGibbage

No answers.... should I assume that it can't be done?

__________________
Skip
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
raven77
Groupie
Groupie
Avatar

Joined: January 02 2007
Location: United States
Online Status: Offline
Posts: 44
Posted: September 26 2010 at 09:55 | IP Logged Quote raven77

MrGibbage wrote:
No answers.... should I assume that it can't be done?

I currently use Ajax/PHP/HTML5/mysql.
I am pretty sure the only way to do what you want is to constantly poll the server looking for changes.
I am not aware of a way to "push" changes out to a currently active page.
That would be pretty awesome though!
Back to Top View raven77's Profile Search for other posts by raven77
 
MrGibbage
Super User
Super User
Avatar

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: September 27 2010 at 08:45 | IP Logged Quote MrGibbage

How do websites like Gmail work? I can have an open web page to my gmail account, and as new emails
come in, the page automatically "refreshes", but it is not a real refresh. It just squeezes in the
new email at the top. Facebook does the same thing. If it is just a really fast polling, then I
suppose that would work. But I have no idea how to write a page like that. I'm ok with most HTML
and PHP, but I have never written anything like that. I think it is ajax???

__________________
Skip
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 
spou
Newbie
Newbie


Joined: July 28 2007
Location: Canada
Online Status: Offline
Posts: 33
Posted: September 27 2010 at 14:59 | IP Logged Quote spou

I have seen AJAX that pools the server, and refresh the client interface based on the returned data. it implies that your device can run AJAX, which is not always the case. the simple way is needed if you want to connect anything to your house.

I think that a simple web page will always have to be refresh the old fashion way. However, if you design your interface correctly, refresh "flashes" can be avoided most of the time. Mostly if your interface fits in a single height of screen, a refresh will look as if only a few values had been updated witout disturbing the rest of the screen.

My Lcars interface works that way, and refresh flashes are rarely noticed, values just change. The screens were build with the CC designer and made to be just a little less high that the screen height of the smallest monitor I use. You can get rid of the borders by using the F11 button, so you get a full and clean screen.

Now the other problem is how often you update the page. one per 30 secs? once per minute? once per 5 sec? Depends on the load you are ready to put on your home server...



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

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: September 29 2010 at 11:40 | IP Logged Quote dhoward

I would definitely say its possible. You should be able to do this with Ajax and Javascript. Basically have a hidden/inline frame running the Ajax to poll the server and when a change in a value is detected, use Javascript to update the elements of the currently displayed page by reference...you should have no visible refresh or flashing with this approach, but again, you would not have as much support for this technology. An optional interface utilizing this approach is something Ive toyed with but have not had the opportunity to actually sit down and write .

To eliminate the constant polling of the server, you could also write a plugin that monitors the UDP broadcasts from PowerHome and then accepts a continuous connection (probably Java) from a webpage and then "pushes" these changes to a connected client. This is getting a bit more involved and out of my current range of experience. I will be using this technique when I get to writing external remote versions of the remote client applications.

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
MrGibbage
Super User
Super User
Avatar

Joined: October 23 2006
Location: United States
Online Status: Offline
Posts: 513
Posted: September 30 2010 at 07:46 | IP Logged Quote MrGibbage

That all sounds really cool, but I think it is just past my level of expertise. I will probably just keep building my web pages with
the CC designer. Of course I could just dive in and learn it...

Thanks for the response, Dave.

__________________
Skip
Back to Top View MrGibbage's Profile Search for other posts by MrGibbage
 

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