Your Universal Remote Control Center
RemoteCentral.com
RS-232 & IP Control Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
Lighting Status from C-Bus MMI Report..URGENT!!!
This thread has 7 replies. Displaying all posts.
Post 1 made on Friday September 24, 2010 at 21:18
deric.lts
Long Time Member
Joined:
Posts:
September 2010
24

Anyone has the experience working on retrieving the lighting status from C-bus MMI report and display it on pronto TSU9600? ur help is very much needed!!! 

I can only On/Off of the lighting using ProntoScript at the moment..

Post 2 made on Monday September 27, 2010 at 20:14
sydinstaller
Active Member
Joined:
Posts:
February 2004
740
Hi,

They have a module.

Contact your rep or supplier.

D.
OP | Post 3 made on Thursday September 30, 2010 at 02:41
deric.lts
Long Time Member
Joined:
Posts:
September 2010
24
itz only available in aus but not in asia i guess..anyway..tq!!! =P
Post 4 made on Thursday September 30, 2010 at 06:26
sydinstaller
Active Member
Joined:
Posts:
February 2004
740
Have you tried contacting the Australian distributer?
Post 5 made on Thursday September 30, 2010 at 07:09
Guy Palmer
Active Member
Joined:
Posts:
June 2008
648
All the protocols and message formats are in the CBus documentation. If you know prontoscript, you can write your own script to fit your own circumstances.
OP | Post 6 made on Thursday September 30, 2010 at 21:37
deric.lts
Long Time Member
Joined:
Posts:
September 2010
24
they require decoding the lighting messages as the occur (not hard) and keeping a local copy of the level of each of the groups you want to monitor < sorry nick..i don't really get what are you trying to say..would you mind to elaborate further?

Basically I need to get the lighting status (On/Off Only, not level) of all together 10 groups (Application address = 38hex in Cbus). However, as i have mentioned, it tooks bout 5-8 seconds to update n display in my pronto because of the following reasons:

(1) "Status Report" time of a s/w could only be set at 3 sec (min & could not b reduced further using C-bus Toolkit) which means when a switch is being press to on/off the light, it will takes the switch about 3 sec to update it status to c-bus b4 i could retrieve it using my pronto.

(2) The 1st 4 lines of PCI returns (e.g Ackowledgement char: .g) which i have mentioned earlier in the post further delay the decoding process about 1 sec.

(3) One thing i am not sure is that why the 3 lines of MMI report comes in line-by-line slowly (i retrieve it and display on my pronto) whereas it could be retrieve n display immediately when I use c-bus diagnostic kit to read the MMI application report.

CF.widget("label1").label = Com1.match("","\r",0);
message = CF.widget("label1").label;
checkstr = message.substr(1,6);

(4) I could only set my pronto page script to excute every 1 sec. Further reduces would causes some status fail to retrieve n update.


Hence, the delay here n there added up causes my status update process becomes very slow. Anyway..i have pasted my script here and would really appreciate if someone could help. THANK YOU VERY MUCH!

Page Script
-----------
var Com1 = CF.extender[0].serial[0];
var checkstr = "";
var group1 = "";
var group2 = "";
var group3 = "";
var group17 = "";
var group174 = "";
var group230 = "";
var group1hex = "";
var group2hex = "";
var group3hex = "";
var group17hex = "";
var group174hex = "";
var group230hex = "";
var message = "";
if (Com1 == null)
{
     Diagnostics.log("Extender 0 is not a serial extender");
}
Com1.bitrate = 9600;
Com1.databits = 8;
Com1.parity = 0;
Com1.stopbits = 1;
if (CF.widget("label1").label == "")
{
      CF.widget("label1").visible = false;
      RefreshPage();
}

function initializepage()
{
      CF.widget("label1").visible = false;
      CF.widget("status1").visible = false;
      CF.widget("status2").visible = false;
      CF.widget("status3").visible = false;
      CF.widget("status4").visible = false;
      CF.widget("status5").visible = false;
      CF.widget("status6").visible = false;
      CF.widget("status7").visible = false;
      CF.widget("status8").visible = false;
      CF.widget("status9").visible = false;
      CF.widget("status17").visible = false;
      CF.widget("status174").visible = false;
      CF.widget("status230").visible = false;
}
function RefreshPage()
{
     Com1.send("~~~\r");
     Com1.send("A3210038g\r");
     Com1.send("A3420002g\r");
     Com1.send("A3300079g\r");
}
GetState();
convertBase="0123456789abcdefghijklmnopqrstuvwxyz";
function convert(input,origin,dest)
{
      input=input.toString().toLowerCase();
      origin=origin.toString();
      dest=dest.toString();
    
      var b=0; var Result = "";
      if (Number(origin)>convertBase.length || Number(dest)>convertBase.length || Number(origin)<2 || Number(dest)<2)
      {    
           return "Invalid numbering system";
      }
   
      for (var c=1;c<=input.length;c++)
      {
           b+=convertBase.indexOf(input.substring(c-1,c))*(Math.pow(origin,input.length-c));
         
           if (convertBase.indexOf(input.substring(c-1,c)) > Number(origin))
           {    
                 return 'Character "'+input.substring(c-1,c)+'" not present in origin system';
           }
      }
      var a=Math.floor(Math.log(b)/Math.log(dest));
      while (a>-1)
      {
           var e=Math.pow(dest,a);
           a--;
           var d=(b-b%e)/e+1;
           b%=e;
           Ciffer=convertBase.substring(d-1,d);
           Result+=Ciffer;
      }
    
      return Result;
}
function GetState() 
{
      CF.widget("label1").label = Com1.match("","\r",0);
      message = CF.widget("label1").label;
      checkstr =  message.substr(1,6);
      if (checkstr == "D638B0" )
      {
         
           group230 = message.substr(33,2);
         
           group230hex =convert(group230,16,2);
           while (group230hex.length != 8)
           {
                 group230hex = "0" + group230hex;
            
           }
         
           toggle(group230hex.substr(2,2),"230");
      }
      
  if (checkstr == "D83858")
      {
         
           group174 = message.substr(49,2);
         
           group174hex =convert(group174,16,2);
           while (group174hex.length != 8)
           {
                 group174hex = "0" + group174hex;
           }
        
   toggle(group174hex.substr(2,2),"174");
      }
      if (checkstr == "D83800")
      {
  group1 = message.substr(7,2);
           group2 = message.substr(9,2);
           group3 = message.substr(11,2);
           group17 = message.substr(15,2);
           group1hex =convert(group1,16,2);
           while (group1hex.length != 8)
           {
                 group1hex = "0" + group1hex;
           }
           group2hex = convert(group2,16,2);
           while (group2hex.length != 8)
           {
                 group2hex = "0" + group2hex;
           }
           group3hex = convert(group3,16,2);
           while (group3hex.length != 8)
           {
          group3hex = "0" + group3hex;
           }
           group17hex = convert(group17,16,2);
           while (group17hex.length != 8)
           {
          group17hex = "0" + group17hex;
           }
 
           toggle(group1hex.substr(0,2),"3");
           toggle(group1hex.substr(2,2),"2");
           toggle(group1hex.substr(4,2),"1");
           toggle(group2hex.substr(0,2),"7");
           toggle(group2hex.substr(2,2),"6");
           toggle(group2hex.substr(4,2),"5");
           toggle(group2hex.substr(6,2),"4");
           toggle(group3hex.substr(4,2),"9");
           toggle(group3hex.substr(6,2),"8");
           toggle2(group17hex.substr(4,2),"17");
     }  
}

function toggle(v,no)
{
      if (v=="01")
      {
           CF.widget("Light"+no).label = "On";
           CF.widget("status"+ no).label = v;
      }
      else
      {
           CF.widget("Light"+no).label = "Off";
           CF.widget("status"+ no).label = v;
      }
      initializepage();
}

function toggle2(v2,no2)
{
      if (v2=="01")
      {
           CF.widget("Light"+no2).label = "On";
           CF.widget("status"+ no2).label = v2;
  CF.widget("PLEASEWAIT").visible = false;
      }
      else
      {
           CF.widget("Light"+no2).label = "Off";
           CF.widget("status"+ no2).label = v2;
  CF.widget("PLEASEWAIT").visible = false;
      }
      initializepage();
}

********************************************************************************************************************************************************************
Button Script
-------------
Com1.send("~~~\r");
Com1.send("A3210038g\r");
if (CF.widget("status1").label == "10")
{
 Com1.send("\\053801007901g\r");
 CF.widget("status1").label = "01";
 toggle("01","1");
}
else
{
 Com1.send("\\053801000101g\r");
 CF.widget("status1").label = "10";
 toggle("10","1");
}
 
<!-- / message --><!-- attachments -->

Last edited by deric.lts on October 1, 2010 06:27.
Post 7 made on Friday October 1, 2010 at 21:08
sydinstaller
Active Member
Joined:
Posts:
February 2004
740
Are you sending the initilise strings every time?

function RefreshPage()
{
Com1.send("~~~\r");
Com1.send("A3210038g\r");
Com1.send("A3420002g\r");
Com1.send("A3300079g\r");

That will slow things down.
OP | Post 8 made on Tuesday October 5, 2010 at 05:04
deric.lts
Long Time Member
Joined:
Posts:
September 2010
24
Any idea to do a page jump after some delay?

Requirement

If the user leave the page without any activity for after some time, the pronto should go back to the home page.


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse