more G-Labs products

Author Topic: CM15PRO and DS10 security sensor error  (Read 1860 times)

January 13, 2015, 11:16:05 PM
Read 1860 times

chrispazz

  • **
  • Information
  • Jr. Member
  • Posts: 38
Hello.
I have just connected a CM15PRO to my raspberry and I have activated SC9000 virtual modules.
I have various security sensors and I have all configured and working ok.

The only problem I have is the following:

I have two DS10 door/window sensor.
While SC9000 is correctly addressing them with different alarm zones, HG is considering both at the same address (module 6 in SC9000 domain).
Looking at RAW data they send different strings but HG does not care this and switch on/off the module with both sensors.

Is it a HG bug or I am wrong somewhere?

Thank you
Christian

January 13, 2015, 11:36:01 PM
Reply #1

chrispazz

  • **
  • Information
  • Jr. Member
  • Posts: 38
Doing some debug:

when receiving RF code:

5D 29 D7 D8 00 FF 74 00 (sensor 1 with address D7)

or code

5D 29 A7 A8 04 FB 13 80 (sensor 2 with address A7)

HG always map both to address 110:

11:33:01.406 PM   X10 RF debug   a=110 fn=84 Contact_normal_min_DS10A   122   HomeAutomation.HomeGenie.Automation
11:32:58.5 PM   X10 RF debug   a=110 fn=04 Contact_alert_min_DS10A   122   HomeAutomation.HomeGenie.Automation
11:32:32.479 PM   X10 RF debug   a=110 fn=04 Contact_alert_min_DS10A   122   HomeAutomation.HomeGenie.Automation
11:32:22.125 PM   X10 RF debug   a=110 fn=80 Contact_normal_max_DS10A   122   HomeAutomation.HomeGenie.Automation
11:32:08.868 PM   X10 RF debug   a=110 fn=00 Contact_alert_max_DS10A   122   HomeAutomation.HomeGenie.Automation
11:31:35.50 PM   X10 RF debug   a=110 fn=80 Contact_normal_max_DS10A   122   HomeAutomation.HomeGenie.Automation

so I think there is a bug in this section of SC9000 program source:

     var binaddress = Convert
                          .ToString(int.Parse(address, System.Globalization.NumberStyles.HexNumber), 2)
                          .PadLeft(8, '0')
                          .Substring(4, 3)
                        .ToCharArray();
         Array.Reverse(binaddress);
         var straddress = new string(binaddress);
Program.Notify("X10 RF debug", "a=" + straddress.ToString() + " fn=" + function + "\n" + fnvalue);     
     
         address = Convert.ToInt32(straddress, 2).ToString();
      module = sc9000Modules.WithAddress(address).Get();

If someone is able to correct it....

Thank you again

January 14, 2015, 11:24:50 AM
Reply #2

chrispazz

  • **
  • Information
  • Jr. Member
  • Posts: 38
Gene can you move this thread to "BUG" section?

Thank you very much

January 14, 2015, 04:57:17 PM
Reply #3

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525

January 16, 2015, 09:57:53 AM
Reply #4

chrispazz

  • **
  • Information
  • Jr. Member
  • Posts: 38
Someone can confirm the presence of this bug?

thank you

January 16, 2015, 11:04:36 AM
Reply #5

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi chris,

sc9000 code is mainly based on "as long as it works with my setup" =) so it's not a strict implementation since I was missing documentation about how to decode X10 RF security codes.
Lately I've come across this document:
http://www.smarthus.info/support/download/x10_RF_formats.pdf
that seems to explain very well how to decode rf security messages.
If you file a issue to github, I'll try to fix this, though have no way of testing the results.

Cheers,
g.

January 16, 2015, 11:06:44 AM
Reply #6

chrispazz

  • **
  • Information
  • Jr. Member
  • Posts: 38
Ok, I will do and I will be glad to test for you.

Thanks