Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome General
 PowerHome Messageboard : PowerHome General
Subject Topic: CtrlCtr: Auto-update Static GlobalVar? Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jeffw_00
Super User
Super User


Joined: June 30 2007
Online Status: Offline
Posts: 929
Posted: January 14 2017 at 15:49 | IP Logged Quote jeffw_00

Hi - I have created a tab in the Control Center which I access remotely around my house using the Silk Browser on the Amazon Fire. (so the Fire is a $33 touch-screen panel :-) ).

My question is this - Every 15 minutes, Powerhome queries the web for the local temperature, and updates a Global Variable. I use this to decide whether to turn certain things (heaters, ceiling fans) on and off, and I also display the value on the Control Center tab as a Static GlobalVar.

However, updating this the global variable in PH does not update the displayed value on the remote browser. To see the current value I have to refresh the page at the browser. Is there any way I can "Push" the update of the global variable to the browser screen so that PH controls when the screen updates?

If not - as a plan B, maybe I can use an "Action GlobalVar", with an null action, and then pressing it will update it's value? [I can try this if it's my only option].

Thanks!
/j
Back to Top View jeffw_00's Profile Search for other posts by jeffw_00
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: January 17 2017 at 11:47 | IP Logged Quote dhoward

Jeff,

There is no way to effectively "push" the changes to your remote web based CC screen. This is something I would like to investigate more but it currently doesnt exist.

You could achieve the effect though by making a simple HTML webpage and placing it in the PowerHome web directory and call it from the Silk browser vs calling the CC
directly.

Code:

<html>
<head>
<script>setInterval(function(){var ifr=document.getElementsByName('main')[0];ifr.src = ifr.src;},300000);</script>
</head>
<body>
<iframe src="http://yourphserverip:8000/ph-cgi/controlcenter?id=YOUR CCID&type=4&flags=4" width="100%" height="100%" frameborder="0" name="main"></iframe>
</body>
</html>


Save the above code to CC.HTM in the PH web directory (make the necessary adjustments to the server IP and CC ID). The "300000" is how often the page will refresh in
milliseconds. In this case it should refresh every 5 minutes.

Hope this helps,

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


Joined: June 30 2007
Online Status: Offline
Posts: 929
Posted: January 18 2017 at 19:36 | IP Logged Quote jeffw_00

Hi Dave - Could you (or anyone) briefly explain how I would construct a URL to access a file in the Powerhome Web directory.

THANKS!
/j

Edited by jeffw_00 - January 18 2017 at 19:37
Back to Top View jeffw_00's Profile Search for other posts by jeffw_00
 
TonyNo
Moderator Group
Moderator Group
Avatar

Joined: December 05 2001
Location: United States
Online Status: Offline
Posts: 2889
Posted: January 18 2017 at 19:40 | IP Logged Quote TonyNo

Should just be http://yourphserverip:8000/yourfile.ext
Back to Top View TonyNo's Profile Search for other posts by TonyNo Visit TonyNo's Homepage
 
jeffw_00
Super User
Super User


Joined: June 30 2007
Online Status: Offline
Posts: 929
Posted: January 18 2017 at 19:41 | IP Logged Quote jeffw_00

Thanks Tony - will try it.
Back to Top View jeffw_00's Profile Search for other posts by jeffw_00
 
jeffw_00
Super User
Super User


Joined: June 30 2007
Online Status: Offline
Posts: 929
Posted: February 19 2017 at 11:04 | IP Logged Quote jeffw_00

if anyone's watching - it works better if you take the :8000 out of the HTML for some reason..

Thanks guys!

Back to Top View jeffw_00's Profile Search for other posts by jeffw_00
 

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