Author |
|
MrGibbage Super User
Joined: October 23 2006 Location: United States
Online Status: Offline Posts: 513
|
Posted: September 21 2010 at 16:26 | IP Logged
|
|
|
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 |
|
|
MrGibbage Super User
Joined: October 23 2006 Location: United States
Online Status: Offline Posts: 513
|
Posted: September 26 2010 at 09:42 | IP Logged
|
|
|
No answers.... should I assume that it can't be done?
__________________ Skip
|
Back to Top |
|
|
raven77 Groupie
Joined: January 02 2007 Location: United States
Online Status: Offline Posts: 44
|
Posted: September 26 2010 at 09:55 | IP Logged
|
|
|
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 |
|
|
MrGibbage Super User
Joined: October 23 2006 Location: United States
Online Status: Offline Posts: 513
|
Posted: September 27 2010 at 08:45 | IP Logged
|
|
|
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 |
|
|
spou Newbie
Joined: July 28 2007 Location: Canada
Online Status: Offline Posts: 33
|
Posted: September 27 2010 at 14:59 | IP Logged
|
|
|
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 |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: September 29 2010 at 11:40 | IP Logged
|
|
|
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 |
|
|
MrGibbage Super User
Joined: October 23 2006 Location: United States
Online Status: Offline Posts: 513
|
Posted: September 30 2010 at 07:46 | IP Logged
|
|
|
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 |
|
|