AskSin++ Library

Begonnen von papa, 08 September 2016, 11:11:25

Vorheriges Thema - Nächstes Thema

papa

Habe eben den AES Code eingecheckt. Die Beispiele sind alle entsprechend angepasst. Getestet habe ich hauptsächlich mit dem HM-LC-SWX-SM Code.

AES wird mit "#define USE_AES" aktiviert. Es sind dann auch der Key und der Index zu definieren. Doku werde ich die Tage im Readme ergänzen.
BananaPi + CUL868 + CUL433 + HM-UART + 1Wire

0xFFFF

So schnell hätte ich jetzt echt nicht damit gerechnet :D Vielen dank fürs zur Verfügung stellen!

bjoernh

Hallo papa.

zuerst vielen Dank für die tolle Arbeit.

Ich möchte mir einen RC1 Sender bauen. Nun bekomme ich es aber irgendwie nicht hin, dass das neue Device nur einen Channel hat.
Ich denke das liegt an der Model ID. Kannst Du mir vielleicht sagen wo ich eine Liste mit den Model IDs finde.
Desweiteren wollte ich meinem RC dann eine Batterieüberwachung hinzufügen. Sehe ich es richtig, dass ich dazu den BatterySensor.h verwenden kann?

Gruß
Björn

papa

#138
Versuche mal nen HM-RC-P1 - 0x001a

Infos gibt es hier:

https://github.com/eq-3/occu/blob/master/firmware/rftypes/rf_rc.xml

BatterySensor.h ist richtig. Dort gibt es 3 unterschiedliche Varianten. Die einfachste nutzt die interne Messung. Siehe auch HM-SEC-MDIR als Beispiel.
BananaPi + CUL868 + CUL433 + HM-UART + 1Wire

Dietmar63


models:
  subType          name                       ID supportedMode            Info  List  channels
  --------------------------------------------------------------------------------------------
  AlarmControl     HM-Sec-Cen               004B normal                         1,3
  blindActuator    HM-LC-BL1-FM             0005 normal                         1,3
  blindActuator    HM-LC-Bl1-FM-2           00D2 normal                         1,3
  blindActuator    HM-LC-BL1-PB-FM          0053 normal                         1,3
  blindActuator    HM-LC-Bl1PBU-FM          006A normal                         1,3
  blindActuator    HM-LC-BL1-SM             0006 normal                         1,3
  blindActuator    HM-LC-Bl1-SM-2           00D1 normal                         1,3
  blindActuator    ROTO_ZEL-STG-RM-FEP-230V 007B normal                         1,3
  blindActuator    Schueco_263-146          0086 normal                         1,3
  blindActuator    Schueco_263-147          0087 normal                         1,3
  blindActuatorSol WDF-solar                0096 burst                          1,3   1 win, 2-3 blind,
  dimmer           HM-LC-DIM1L-CV           0012 normal                         1,3
  dimmer           HM-LC-Dim1L-CV-2         00B7 normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-Dim1L-CV-644       006E normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-DIM1L-PL           0013 normal                         1,3
  dimmer           HM-LC-Dim1L-Pl-2         00A3 normal                         1,3
  dimmer           HM-LC-Dim1L-Pl-3         00B3 normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-Dim1L-Pl-644       006F normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-Dim1PWM-CV         0067 normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-Dim1PWM-CV-2       00B5 normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-DIM1T-CV           0058 normal                         1,3
  dimmer           HM-LC-Dim1T-CV-2         00B9 normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-Dim1T-CV-644       0072 normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-DIM1T-FM           0059 normal                         1,3
  dimmer           HM-LC-Dim1T-FM-2         00BA normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-Dim1T-FM-644       0073 normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-Dim1T-FM-LF        00F5 normal                         1,3
  dimmer           HM-LC-Dim1TPBU-FM        0068 normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-Dim1TPBU-FM-2      00B6 normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-DIM1T-PL           0057 normal                         1,3
  dimmer           HM-LC-Dim1T-Pl-2         00A4 normal                         1,3
  dimmer           HM-LC-Dim1T-Pl-3         00B4 normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-Dim1T-Pl-644       0071 normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           HM-LC-DIM2L-CV           0016 normal                         1,3   1-2 Sw,
  dimmer           HM-LC-DIM2L-SM           002E normal                         1,3   1-2 Sw,
  dimmer           HM-LC-Dim2L-SM-2         00B8 normal                         1,3   1-2 Sw, 3-4 Sw1_V, 5-6 Sw2_V,
  dimmer           HM-LC-Dim2L-SM-644       0070 normal                         1,3   1-2 Sw, 3-4 Sw1_V, 5-6 Sw2_V,
  dimmer           HM-LC-DIM2T-SM           005A normal                         1,3   1-2 Sw,
  dimmer           HM-LC-Dim2T-SM           0074 normal                         1,3   1-2 Sw, 3-4 Sw1_V, 5-6 Sw2_V,
  dimmer           HM-LC-Dim2T-SM-2         00BB normal                         1,3   1-2 Sw, 3-4 Sw1_V, 5-6 Sw2_V,
  dimmer           OLIGO-smart-iq-HM        00FC normal                         1,3   1-2 Dim, 3-4 Dim1_V, 5-6 Dim2_V,
  dimmer           Schueco_263-132          0088 normal                         1,3
  dimmer           Schueco_263-133          008A normal                         1,3   1 Sw, 2-3 Sw1_V,
  dimmer           Schueco_263-134          0089 normal                         1,3
                   DORMA_atent              0064 config                         1,3   1-3 Btn,
  keyMatic         HM-SEC-KEY               0019 burst                          1,3
  keyMatic         HM-SEC-KEY-O             0027 burst                          1,3
  keyMatic         HM-SEC-KEY-S             0026 burst                          1,3
  KFM100           KFM-Display              0049 normal                         1,3
  KFM100           KFM-Sensor               0047 config                         1,3

  motionAndBtn     HM-Sen-MDIR-WM55         00DB config,wakeup,lazyConf         1,4   1-2 Btn, 3 Motion,
  motionDetector   HM-SEC-MDIR              004A config,wakeup,lazyConf   00:20 1,4
  motionDetector   HM-SEC-MDIR-2            00C0 config,wakeup,lazyConf   00:20 1,4
  motionDetector   HM-SEC-MDIR-3            00F7 config,wakeup,lazyConf   00:20 1,4
  motionDetector   HM-Sen-MDIR-O            005D config,wakeup,lazyConf   00:10 1,4
  motionDetector   HM-Sen-MDIR-O-2          00C1 config,wakeup,lazyConf   00:10 1,4
  motionDetector   HM-SEN-MDIR-SM           004F config,wakeup,lazyConf         1,4
  motionDetector   Schueco_263-162          0090 config,wakeup,lazyConf   00:30 1,3
  outputUnit       HM-OU-CFM-PL             0075 normal                         3     1 Led, 2 Mp3,
  outputUnit       HM-OU-CFM-TW             00FA config,burst                   3     1 Led, 2 Mp3,
  outputUnit       HM-OU-CF-PL              005C normal                         3     1 Led, 2 Sound,
  outputUnit       HM-OU-CM-PCB             00AF normal                         3
  outputUnit       HM-OU-LED16              006D normal                         ,1    1-16 Led,
  powerMeter       HM-ES-PMSw1-DR           00EA normal                   00:10 1,1,3p.4p.5p.6p 1 Sw, 2 Pwr, 3 SenPwr, 4 SenI, 5 SenU, 6 SenF,
  powerMeter       HM-ES-PMSw1-Pl           00AC normal                   00:10 1,1,3p.4p.5p.6p 1 Sw, 2 Pwr, 3 SenPwr, 4 SenI, 5 SenU, 6 SenF,
  powerMeter       HM-ES-PMSw1-Pl-DN-R1     00D7 normal                   00:10 1,1,3p.4p.5p.6p 1 Sw, 2 Pwr, 3 SenPwr, 4 SenI, 5 SenU, 6 SenF,
  powerMeter       HM-ES-PMSw1-Pl-DN-R2     00E2 normal                   00:10 1,1,3p.4p.5p.6p 1 Sw, 2 Pwr, 3 SenPwr, 4 SenI, 5 SenU, 6 SenF,
  powerMeter       HM-ES-PMSw1-Pl-DN-R3     00E3 normal                   00:10 1,1,3p.4p.5p.6p 1 Sw, 2 Pwr, 3 SenPwr, 4 SenI, 5 SenU, 6 SenF,
  powerMeter       HM-ES-PMSw1-Pl-DN-R4     00E4 normal                   00:10 1,1,3p.4p.5p.6p 1 Sw, 2 Pwr, 3 SenPwr, 4 SenI, 5 SenU, 6 SenF,
  powerMeter       HM-ES-PMSw1-Pl-DN-R5     00E5 normal                   00:10 1,1,3p.4p.5p.6p 1 Sw, 2 Pwr, 3 SenPwr, 4 SenI, 5 SenU, 6 SenF,
  powerMeter       HM-ES-PMSw1-SM           00F6 normal                   00:10 1,1,3p.4p.5p.6p 1 Sw, 2 Pwr, 3 SenPwr, 4 SenI, 5 SenU, 6 SenF,
  powerSensor      HM-ES-TX-WM              00DE config,wakeup            00:10 1     1-2 IEC,
  pushButton       HM-Dis-EP-WM55           00FB config,burst                   1,3   1-2 Dis, 3-9 Key,
  pushButton       HM-Dis-WM55              00D3 config                         1,    1-10 Dis,
  pushButton       HM-PB-2-FM               00BF config,lazyConf                1,4   1-2 Btn,
  pushButton       HM-PB-2-WM               0036 config                         1,4   1-2 Btn,
  pushButton       HM-PB-2-WM55             006B config,wakeup,lazyConf         1,4   1-2 Btn,
  pushButton       HM-PB-2-WM55-2           00C2 config,wakeup,lazyConf         1,4   1-2 Btn,
  pushButton       HM-PB-4DIS-WM            0060 config,wakeup,lazyConf         1,4   1-20 Btn,
  pushButton       HM-PB-4DIS-WM-2          00DD config,wakeup,lazyConf         1,4   1-20 Btn,
  pushButton       HM-PB-4-WM               0035 config                         1,4   1-4 Btn,
  pushButton       HM-PBI-4-FM              0034 config                         1,4   1-4 Btn,
  pushButton       HM-Sen-DB-PCB            00DC config                         1,4
  pushButton       ROTO_ZEL-STG-RM-DWT-10   007E config,wakeup,lazyConf         1,4   1-20 Btn,
  pushButton       ROTO_ZEL-STG-RM-FST-UP4  007F config                         1,4   1-4 Btn,
  pushButton       ROTO_ZEL-STG-RM-WT-2     007D config,wakeup,lazyConf         1,4
  pushButton       Schueco_263-135          008D config,wakeup,lazyConf         1,4
  pushButton       Schueco_263-145          008F config                         1,4
  remote           CMM                      0018 normal                         3
  remote           DORMA_RC-H               0054 config                         1,3
  remote           HM-MOD-Em-8              00D9 lazyConf                       1,4   1-8 Btn,
  remote           HM-PB-6-WM55             00A9 config,wakeup,lazyConf         1,4   1-6 Btn,
  remote           HM-RC-12                 0029 config                         1,4   1-12 Btn,
  remote           HM-RC-12-B               002A config                         1,4   1-12 Btn,
  remote           HM-RC-12-SW              004C config                         1,4   1-12 Btn,
  remote           HM-RC-19                 0037 config,burst                   1,1.2p.3p.4p.5p.6p.7p.8p.9p.10p.11p.12p.13p.14p.15p.16p 1-17 Btn, 18 Disp,
  remote           HM-RC-19-B               0038 config,burst                   1,1.2p.3p.4p.5p.6p.7p.8p.9p.10p.11p.12p.13p.14p.15p.16p 1-17 Btn, 18 Disp,
  remote           HM-RC-19-SW              004D config,burst                   1,1.2p.3p.4p.5p.6p.7p.8p.9p.10p.11p.12p.13p.14p.15p.16p 1-17 Btn, 18 Disp,
  remote           HM-RC-2-PBU-FM           00E0 normal                         1,4   1-2 Btn,
  remote           HM-RC-4                  0008 config                         1,4   1-4 Btn,
  remote           HM-RC-4-2                00A0 config,lazyConf                1,4   1-4 Btn,
  remote           HM-RC-4-3                00D4 config,wakeup,lazyConf         1,4   1-4 Btn,
  remote           HM-RC-4-3-D              00F8 config,wakeup,lazyConf         1,4   1-4 Btn,
  remote           HM-RC-4-B                003B config                         1,4   1-4 Btn,
  remote           HM-RC-8                  00DA config,wakeup,lazyConf         1,4   1-8 Btn,
  remote           HM-RC-Dis-H-x-EU         00E1 config,wakeup,lazyConf         1,4   1-20 Btn,
  remote           HM-RC-KEY3               001D config                         1,4   1-3 Btn,
  remote           HM-RC-KEY3-B             001E config                         1,4   1-3 Btn,
  remote           HM-RC-Key4-2             00A6 config,lazyConf                1,4   1 unlock, 2 lock, 3 light, 4 open,
  remote           HM-RC-Key4-3             00D6 config,lazyConf                1,4   1 unlock, 2 lock, 3 light, 4 open,
  remote           HM-RC-P1                 001A config                         1,4
  remote           HM-RC-SEC3               001B config                         1,4   1-3 Btn,
  remote           HM-RC-SEC3-B             001C config                         1,4   1-3 Btn,
  remote           HM-RC-Sec4-2             00A5 config,lazyConf                1,4   1 armInt, 2 armExt, 3 light, 4 disarm,
  remote           HM-RC-Sec4-3             00D5 config,lazyConf                1,4   1 armInt, 2 armExt, 3 light, 4 disarm,
  remote           ROTO_ZEL-STG-RM-HS-4     0080 config                         1,4
  remote           Schueco_263-155          008E config                         1,4
  repeater         HM-Sys-sRP-Pl            0076 normal                         ,2
  rgb              HM-LC-RGBW-WM            00F4 normal                         1,3   1 Dim, 2 Color, 3 Auto,
  senBright        HM-Sen-LI-O              00FD config,wakeup            00:10 1
  sensor           HM-SEN-EP                0044 config,wakeup                  1,4   1-2 Sen,
  sensor           HM-Sen-Wa-Od             009F config,wakeup            28:00 1,4
  sensRain         HM-Sen-RD-O              00A7 normal                         1,1   1 Rain, 2 Heating,
  singleButton     DORMA_BRC-H              0065 config                         1,3   1-4 Btn,
  siren            HM-Sec-Sir-WM            00F9 config,burst                   1,3   1-2 Sen, 3 Panic, 4 Arm,
  smokeDetector    HM-CC-SCD                0056 config,wakeup            28:00 1,4
  smokeDetector    HM-SEC-SD                0042 burst                    99:00
  smokeDetector    HM-SEC-SD-2              00AA config,3Burst            99:00
  smokeDetector    Schueco_263-160          0084 config,wakeup                  1,4
  smokeDetector    Schueco_263-167          0091 burst                    99:00
  swi              HM-SWI-3-FM              0046 config                         4     1-3 Sw,
  swi              Roto_ZEL-STG-RM-FSS-UP3  0083 config                         4
  switch           HM-Dis-TD-T              0078 burst                          3
  switch           HM-LC-DDC1-PCB           004E normal                         1,3
  switch           HM-LC-SW1-BA-PCB         006C burst                          1,3
  switch           HM-LC-Sw1-DR             00F0 normal                         1,3
  switch           HM-LC-SW1-FM             0004 normal                         1,3
  switch           HM-LC-Sw1-FM-2           00CA normal                         1,3
  switch           HM-LC-SW1-PB-FM          0051 normal                         3
  switch           HM-LC-Sw1PBU-FM          0069 normal                         1,3
  switch           HM-LC-Sw1-PCB            0103 normal                         1,3   1-4 Sw,
  switch           HM-LC-SW1-PL             0011 normal                         1,3
  switch           HM-LC-SW1-PL2            00A1 normal                         1,3
  switch           HM-LC-Sw1-Pl-3           00C8 normal                         1,3
  switch           HM-LC-Sw1-Pl-CT-R1       00EB normal                         1,3
  switch           HM-LC-Sw1-Pl-CT-R2       00EC normal                         1,3
  switch           HM-LC-Sw1-Pl-CT-R3       00ED normal                         1,3
  switch           HM-LC-Sw1-Pl-CT-R4       00EE normal                         1,3
  switch           HM-LC-Sw1-Pl-CT-R5       00EF normal                         1,3
  switch           HM-LC-Sw1-Pl-DN-R1       00D8 normal                         1,3
  switch           HM-LC-Sw1-Pl-DN-R2       00E6 normal                         1,3
  switch           HM-LC-Sw1-Pl-DN-R3       00E7 normal                         1,3
  switch           HM-LC-Sw1-Pl-DN-R4       00E8 normal                         1,3
  switch           HM-LC-Sw1-Pl-DN-R5       00E9 normal                         1,3
  switch           HM-LC-SW1-PL-OM54        0001 normal                         1,3
  switch           HM-LC-SW1-SM             0002 normal                         1,3
  switch           HM-LC-Sw1-SM-2           00C9 normal                         1,3
  switch           HM-LC-SW1-SM-ATMEGA168   0014 normal                         3
  switch           HM-LC-SW2-DR             0062 normal                         1,3   1-2 Sw,
  switch           HM-LC-Sw2-DR-2           00CC normal                         1,3   1-2 Sw,
  switch           HM-LC-SW2-FM             0009 normal                         1,3   1-2 Sw,
  switch           HM-LC-Sw2-FM-2           00CB normal                         1,3   1-2 Sw,
  switch           HM-LC-SW2-PB-FM          0052 normal                         3     1-2 Sw,
  switch           HM-LC-Sw2PBU-FM          0101 normal                         1,3   1-2 Sw,
  switch           HM-LC-SW2-SM             000A normal                         1,3   1-2 Sw,
  switch           HM-LC-SW4-BA-PCB         00AB burst                          1,3   1-4 Sw,
  switch           HM-LC-SW4-DR             0061 normal                         1,3   1-4 Sw,
  switch           HM-LC-Sw4-DR-2           00D0 normal                         1,3   1-4 Sw,
  switch           HM-LC-SW4-PCB            002D normal                         1,3   1-4 Sw,
  switch           HM-LC-Sw4-PCB-2          00CE normal                         1,3   1-4 Sw,
  switch           HM-LC-SW4-SM             0003 normal                         1,3   1-4 Sw,
  switch           HM-LC-Sw4-SM-2           00CD normal                         1,3   1-4 Sw,
  switch           HM-LC-SW4-SM-ATMEGA168   0015 normal                         1,3   1-4 Sw,
  switch           HM-LC-SW4-WM             0066 normal                         1,3   1-4 Sw,
  switch           HM-LC-Sw4-WM-2           00CF normal                         1,3   1-4 Sw,
  switch           HM-MOD-Re-8              00BE burst                          1,3   1-8 Sw,
  switch           HM-SEC-SFA-SM            0050 normal                         1,3   1 Siren, 2 Flash,
  switch           PS-switch                8001 normal                         1,3   1-4 Sw,
  switch           ROTO_ZEL-STG-RM-FZS      007C normal                         1,3
  switch           ROTO_ZEL-STG-RM-FZS-2    00A2 normal                         1,3
  switch           Schueco_263-130          008B normal                         1,3
  switch           Schueco_263-131          008C normal                         1,3
  switch           Schueco_263-144          0092 config                         1,3
  thermostat       HM-CC-RT-DN              0095 config,wakeup,burstCond  00:10 1.2p.4p.5p.6p,3p.6p,1,3p.4 1 Weather, 2 Climate, 3 WindowRec, 4 Clima, 5 ClimaTeam, 6 remote,
  thermostat       HM-CC-RT-DN-BoM          00BD config,wakeup,burstCond  00:10 1.2p.4p.5p.6p,3p.6p,1,3p.4 1 Weather, 2 Climate, 3 WindowRec, 4 Clima, 5 ClimaTeam, 6 remote,
  thermostat       HM-CC-TC                 0039 config,wakeup,burstCond  00:10 2,2.3p,2 1 Weather, 2 Climate, 3 WindowRec,
  thermostat       HM-CC-VD                 003A config,wakeup            28:00 ,5
  thermostat       HM-TC-IT-WM-W-EU         00AD config,burst             00:10 1.2p.6p.7p,3p.6p,1,2.3p.7p,2,2 1 Weather, 2 Climate, 3 WindowRec, 6 remote, 7 SwitchTr,
  thermostat       ROTO_ZEL-STG-RM-FSA      007A config,wakeup            28:00 ,5
  thermostat       ROTO_ZEL-STG-RM-FWT      0079 config,wakeup,burstCond  00:10 2,2.3p,2 1 Weather, 2 Climate, 3 WindowRec,
  threeStateSensor HM-SCI-3-FM              005F config,wakeup            28:00 1,4   1-3 Sw,
  threeStateSensor HM-SEC-RHS               0030 config                   28:00 1,4
  threeStateSensor HM-SEC-RHS-2             00C3 config,wakeup            28:00 1,4
  threeStateSensor HM-SEC-SC                002F config                   28:00 1,4
  threeStateSensor HM-SEC-SC-2              00B1 config,wakeup,lazyConf   28:00 1,4
  threeStateSensor HM-SEC-SCo               00C7 config,wakeup,lazyConf   00:50 1,4
  threeStateSensor HM-SEC-TIS               0043 config,wakeup            28:00 1,4
  threeStateSensor HM-SEC-WDS               0045 config,wakeup            28:00 1,4
  threeStateSensor HM-SEC-WDS-2             00B2 config,wakeup            28:00 1,4
  threeStateSensor ROTO_ZEL-STG-RM-FDK      0081 config,wakeup            28:00 1,4
  threeStateSensor Roto_ZEL-STG-RM-FFK      0082 config,wakeup            28:00 1,4
  THSensor         ASH550                   000D config,wakeup,burstCond  00:10
  THSensor         ASH550I                  000E config,wakeup,burstCond  00:10
  THSensor         HM-WDC7000               0041 normal                   00:10 1,4
  THSensor         HM-WDS100-C6-O           0040 config,wakeup            00:10 ,1,1p
  THSensor         HM-WDS100-C6-O-2         00AE config,wakeup,burst      00:10 4
  THSensor         HM-WDS10-TH-O            003D config,burstCond,wakeup  00:10
  THSensor         HM-WDS20-TH-O            003C config,burstCond         00:10
  THSensor         HM-WDS30-OT2-SM          00A8 config,wakeup,burstCond  12:00       1 T1, 2 T2, 3 T1_T2, 4 T2_T1, 5 Event,
  THSensor         HM-WDS30-OT2-SM-2        0102 config,wakeup,burstCond  12:00       1 T1, 2 T2, 3 T1_T2, 4 T2_T1, 5 Event,
  THSensor         HM-WDS30-T-O             003E config,wakeup            00:10
  THSensor         HM-WDS40-TH-I            003F config,burstCond         00:10
  THSensor         HM-WDS40-TH-I-2          00BC config,burstCond         00:10
  THSensor         HM-WS550                 000B normal
  THSensor         HM-WS550LCB              0031 normal
  THSensor         HM-WS550LCW              0032 normal
  THSensor         HM-WS550Tech             002B normal
  THSensor         IS-WDS-TH-OD-S-R3        0048 config,wakeup,burstCond  00:10
  THSensor         KS550                    0007 config,wakeup            00:10 ,1,1p
  THSensor         KS550LC                  0033 config,wakeup            00:10 ,1,1p
  THSensor         KS550TECH                002C config,wakeup            00:10 ,1,1p
  THSensor         KS888                    001F config,wakeup            00:10 ,1,1p
  THSensor         PS-Th-Sens               8002 normal                         1,4   1-4 Sen,
  THSensor         S550IA                   000F config,wakeup            00:10
  THSensor         Schueco_263-157          0094 config,wakeup            00:10
  THSensor         Schueco_263-158          0093 config,wakeup,burstCond  00:10
  timer            SensoTimer-ST-6          00F3 config,burst                   1,5.6p.7p.8p.9p 1-2 Sw, 3-4 Sen, 5-7 Key, 8-9 ecoKey,
  tipTronic        Schueco_263-xxx          009B config,wakeup            28:00 1.2,1.3p 1 act, 2 sen, 3 sec,
  virtual          CCU-FHEM                 FFF0 normal                               1-50 Btn,
  winMatic         HM-SEC-WIN               0028 burst                          1,1   1 Win, 2 Akku,
                   WS888                    0022 normal                         1,3

Gruß Dietmar
FB7390, CUL, 2 FHT, FS20
modules: 98_WOL.pm, 98_Heating_Control.pm,   98_WeekdayTimer.pm, 98_RandomTimer.pm, 59_Twilight.pm

plombe

Beim Testen der Lib für HM-LC-SWX-SM stellte ich fest,  dass ein wiederholtes Pairing bei bereits gepairtem Gerät über den Config Button zum Aufhängen der Software
führt. In Device.h habe ich alle delay() durch _delay_ms() ersetzt. Damit ist das Problem behoben. War das o.k so ?

Hans-Georg

papa

Zitat von: plombe am 31 Januar 2017, 20:26:29
In Device.h habe ich alle delay() durch _delay_ms() ersetzt. Damit ist das Problem behoben. War das o.k so ?

Keine Ahnung. Werde dasmal so übernehmen. Was ich so auf die Schnelle im Web gefunden habe - die _delay_ms ist unabhängig von Interrupts.
BananaPi + CUL868 + CUL433 + HM-UART + 1Wire

CitationJet

#142
Tolles Projekt! Funktioniert auch ohne AES hervorragend. Die Pin-Definitionen konnte ich zur Benutzung mit einer nanoCUL umbauen, in der Radio_ProMini.cpp:
#define CC_GDO0_DDR            DDRD                   // GDO0 pin, signals received data
#define CC_GDO0_PORT           PORTD
#define CC_GDO0_PIN            PORTD3

#define CC_GDO0_PCICR          PCICR                  // GDO0 interrupt register
#define CC_GDO0_PCIE           PCIE2
#define CC_GDO0_PCMSK          PCMSK2                 // GDO0 interrupt mask
#define CC_GDO0_INT            PCINT19                  // pin interrupt
#define CC_GDO0_INTPIN         3

void CC1101::enableGDO0Int(void) {
  ::attachInterrupt(digitalPinToInterrupt(CC_GDO0_INTPIN), radioISR, FALLING);
}

void CC1101::disableGDO0Int(void) {
  ::detachInterrupt(digitalPinToInterrupt(CC_GDO0_INTPIN));
}


Leider habe ich mit AES im Beispiel HM-RC-4 ein paar Probleme:
in meiner VCCU steht als Attribut (Beispiel): hmKey      01:abcdef000102(usw...)
Dann muss ich im Kopf ja angeben:
#define USE_AES
#define HM_DEF_KEY 0xab,0xcd,0xef,0x00,0x01,0x02(usw...)
#define HM_DEF_KEY_INDEX 2

Da mag er nicht richtig signieren, wenn ich in FHEM für Device+Buttons aesCommReq auf 1 setze und einen Button betätige:
CUL_HM HM_789012 aesCommToDev: pending
CUL_HM HM_789012 aesCommToDev: pending
CUL_HM HM_789012 aesCommToDev: pending
CUL_HM HM_789012 aesCommToDev: pending
CUL_HM HM_789012 aesCommToDev: pending
CUL_HM HM_789012 aesCommToDev: pending

Umgekehrt habe ich mal set HM_789012 assignHmKey probiert, da meldet mir der Nano allerdings Signature FAILED zurück.
Habe schon probiert, in der Library den Homematic-Standardkey A4E375C6B09FD185F27C4E96FC273AE4 mit Index 0 zu hinterlegen, hat aber auch nicht funktioniert.
Ebenfalls nicht funktioniert hat das Umdrehen der Bytes, also im Beispiel oben
#define HM_DEF_KEY (usw...),0x02,0x01,0x00,0xef,0xcd,0xab

CitationJet

Als Nachtrag noch eine kurze Vorstellung, was ich vor habe:

Ich möchte das alte Keymatic-Codeschloss nachbauen, das ja leider nie in einer Homematic-Version produziert wurde.
Wie das ursprüngliche Gerät soll es batteriebetrieben und direkt mit der Keymatic koppelbar sein.
Mit den verschiedenen Kanälen kann man neben Schließen und Öffnen auch gleich die Türklingel realisieren.

Mir schwirren auch noch ein paar Ideen zur Erhöhung der Sicherheit durch den Kopf, wie eine Ableitung des Homematicschlüssels aus der Geheimzahl, wodurch der Schlüssel nicht im Klartext im EEPROM steht (obwohl es schon unwahrscheinlich ist, dass jemand sich die Mühe macht).

papa

#144
Der Standardkey sollte auf jeden Fall gehen. Am besten mal folgendes versuchen:

* Code mit Standardkey und Index 0 erstellen und flashen
* EProm komplett neu initialisieren - also den Config-Button mindestens 6 Sekunden drücken
* assignHmKey ausführen

Es müsste dann eine Debug-Ausgabe mit dem neuen Key und dem Index kommen.

Wenn der Key im Code geändert wird, muss auch der EProm neu initialisiert werden, da sonst die alten, gespeicherten Daten verwendet werden. Vielleicht sollte ich den Keyinhalt mit in die Berechnung der Prüfsumme aufnehmen, die beim Start prüft, ob der EProm initialisiert werden muss.

Edit: Der letzte Satz ist Blödsinn, da dann nach Setzen eines neuen Keys beim nächsten Start der EProm neu eingerichtetw wird.
BananaPi + CUL868 + CUL433 + HM-UART + 1Wire

CitationJet

#145
Danke - der Fehler lag wohl im Gerätetyp HM-RC-4. Es funktioniert prinzipiell wie es soll, nachdem ich den Gerätetyp im HM-RC-4-Beispielsketch auf HM-RC-Key4-3 (sdev.setModel(0x00,0xD6);) gestellt habe. Pairing mit Keymatic funktioniert auch, allerdings kann man nach Drücken des Configbuttons nur 1x ein Kommando pro Kanal senden.
Siehe Nachtrag ein Beitrag weiter

Zum Test habe ich in FHEM den Arduino (vorher 6 Sekunden Configbutton f. Reset) gepairt, ohne Peering mit der Keymatic. In der VCCU habe ich einen Testschlüssel 01:11111111111111111111111111111111 gesetzt, danach:
set HM_789012 assignHmKey
set HM_789012.* regSet sign on
attr HM_789012.* aesCommReq 1

Ist alles durchgelaufen und das Hinterlegen des Schlüssels wurde auf der seriellen Ausgabe gemeldet.

Wenn ich anschließend den Configbutton kurz drücke und danach eine Taste, passiert fehlerfrei folgendes:
### Devicelog:
2017-02-02_18:16:23 HM_789012 D-firmware: 1.1
2017-02-02_18:16:23 HM_789012 D-serialNr: papa333333
2017-02-02_18:16:23 HM_789012 CMDs_done
2017-02-02_18:16:26 HM_789012 aesCommToDev: pending
2017-02-02_18:16:26 HM_789012 aesCommToDev: ok
2017-02-02_18:16:26 HM_789012 battery: ok
2017-02-02_18:16:26 HM_789012 CMDs_done
2017-02-02_18:16:26 HM_789012 HM_789012_unlock Short

### CUL:
2017.02.02 18:16:23.581 4: TSCUL_Parse: rf_nanocul_868  244872 A FF01 03515364 00 1A 07 A000 789012 42F0FF 1100D67061706133333333333340040000 -61
2017.02.02 18:16:23.601 4: TSCUL_send:  rf_nanocul_868                         As 0A 07 8002 42F0FF 789012 00
2017.02.02 18:16:23.601 3: TSCUL_XmitDlyHM:  rf_nanocul_868  id:789012 dDly:83 toms:32
2017.02.02 18:16:23.718 4: TSCUL_Parse: rf_nanocul_868  245018 A FF03 03515484 01 0A 07 8002 42F0FF 789012 00 _CCAdly:4 _dhmSt:120 -138
2017.02.02 18:16:26.558 4: TSCUL_Parse: rf_nanocul_868  247858 A FF01 03518352 00 0B 0D A040 789012 42F0FF 0100 -65.5
2017.02.02 18:16:26.573 4: TSCUL_send:  rf_nanocul_868                         As 11 0D A002 42F0FF 789012 040F596B68091302
2017.02.02 18:16:26.574 3: TSCUL_XmitDlyHM:  rf_nanocul_868  id:789012 dDly:93 toms:33
2017.02.02 18:16:26.709 4: TSCUL_Parse: rf_nanocul_868  248009 A FF03 03518472 01 11 0D A002 42F0FF 789012 04 _CCAdly:4 _dhmSt:120 -138
2017.02.02 18:16:26.759 4: TSCUL_Parse: rf_nanocul_868  248050 A FF01 03518544 00 19 0D 8003 789012 42F0FF AAF19BB20CE4FBB77C14C65BA479F930 -59.5
2017.02.02 18:16:26.779 4: TSCUL_send:  rf_nanocul_868                         As 0E 0D 8002 42F0FF 789012 00604ce697
2017.02.02 18:16:26.779 3: TSCUL_XmitDlyHM:  rf_nanocul_868  id:789012 dDly:81 toms:33
2017.02.02 18:16:26.898 4: TSCUL_Parse: rf_nanocul_868  248198 A FF03 03518664 01 0E 0D 8002 42F0FF 789012 00 _CCAdly:4 _dhmSt:120 -138

### Seriell:
debounce
pressed
released
<- 1A 07 A0 00 78 90 12 42 F0 FF 11 00 D6 70 61 70 61 33 33 33 33 33 33 40 04 00 00
waitAck: 01

01 debounce
01 pressed
01 released
<- 0B 0D A0 40 78 90 12 42 F0 FF 01 00
Process Challenge - Key: 02
<- 19 0D 80 03 78 90 12 42 F0 FF AA F1 9B B2 0C E4 FB B7 7C 14 C6 5B A4 79 F9 30
waitAck: 01
01
-> 0E 0D 80 02 42 F0 FF 78 90 12 00 60 4C E6 97


Wenn ich allerdings einige Zeit später nochmal die gleiche Taste drücke, passiert dies:
### Devicelog:
2017-02-02_18:19:58 HM_789012 aesCommToDev: pending

### CUL:
2017.02.02 18:19:58.940 4: TSCUL_Parse: rf_nanocul_868  460238 A FF01 03730848 00 0B 0E A040 789012 42F0FF 0100 -50
2017.02.02 18:19:58.961 4: TSCUL_send:  rf_nanocul_868                         As 11 0E A002 42F0FF 789012 04310D5F91ECC602
2017.02.02 18:19:58.962 3: TSCUL_XmitDlyHM:  rf_nanocul_868  id:789012 dDly:83 toms:33
2017.02.02 18:19:59.088 4: TSCUL_Parse: rf_nanocul_868  460388 A FF03 03730968 01 11 0E A002 42F0FF 789012 04 _CCAdly:4 _dhmSt:120 -138
2017.02.02 18:19:59.324 4: TSCUL_Parse: rf_nanocul_868  460624 A FF03 03731204 01 11 0E A002 42F0FF 789012 04 _CCAdly:4 _dhmSt:356 -138
2017.02.02 18:19:59.559 4: TSCUL_Parse: rf_nanocul_868  460859 A FF03 03731440 01 11 0E A002 42F0FF 789012 04 _CCAdly:4 _dhmSt:592 -138
2017.02.02 18:19:59.760 1: TSCUL_ParseTsHM rf_nanocul_868 HM repeat failed sending to 789012/HM_789012: AFF00000E3C3600110EA00242F0FF78901204
2017.02.02 18:19:59.761 4: TSCUL_Parse: rf_nanocul_868  461060 A FF00 03731672 00 11 0E A002 42F0FF 789012 04 _sfail -138

### Seriell:
01 debounce
01 released
<- 0B 0E A0 40 78 90 12 42 F0 FF 01 00
Process Challenge - Key: 02
<- 19 0E 80 03 78 90 12 42 F0 FF 56 91 5E 03 78 93 FA A0 A4 1B 15 9F 15 9C A3 53
waitAck: 01
01

Anbei auch mein Sketch, bei dem ich die Button- und LED-Ports für das Ausführen auf einer nanoCUL-Hardware angepasst habe, und die geänderte Radio_ProMini.cpp für nanoCUL.

CitationJet

#146
Nachtrag: Das Bedienen der anderen Tasten funktioniert, egal wie oft, ziemlich genau 20 Sekunden lang, nachdem man den Configbutton kurz gedrückt hat. Anschließend kommen die aesCommToDev: pending Meldungen bei jedem Tastendruck, bis man erneut den Configbutton drückt. Das gleiche auch nach einem Powercycle des Arduino, man muss erst einmal den Configbutton kurz drücken, sonst kommen auch die Pending-Meldungen.

Edit: Ich nehme mal an, es hängt mit diesen Zeilen in MultiChannelDevice.h zusammen:
activity.stayAwake( seconds2ticks(20) ); // 20 seconds

Edit2: Mit folgendem Hack im Sketchfile in der BtnChannel-Klasse funktioniert es jetzt immer ohne Configbutton-Drücken:
  virtual void state(uint8_t s) {
    DHEX(number());
    Button::state(s);
    if( s == released ) {
      repeatcnt=0;
      msg.init(++msgcnt,number(),repeatcnt,false);
      device().sendPeerEvent(msg,*this);
      activity.stayAwake(millis2ticks(500));    // <- HACK
    }
    else if( s == longpressed ) {
      msg.init(++msgcnt,number(),repeatcnt++,true);
      device().sendPeerEvent(msg,*this);
      activity.stayAwake(millis2ticks(500));    // <- HACK
    }
  }

Ich vermute ohne den Hack ist das Radio nicht Awake und kann die AES-Signrequest nicht empfangen?

papa

#147
Hm - interessant. Die Abarbeitung der Aes-Signierung sollte eigentlich komplett in der Device::send() durchgeführt werden. Hier wird nach dem Senden einer Nachricht aktive auf die Antwort gewartet. Wenn es ein Ack ist geht es einfach raus. Ist es eine Aes-Challenge, wird diese abgearbeitet. Ich denke, hier liegt irgendwo der Fehler. Ich hatte letztens auch komischerweise Acks wo ich eigentlich Nacks erwartet hatte. Allerdings hatte ich noch keine Zeit, mir das mal genauer anzusehen. Unter Umständen gibt es noch Probleme in der waitResponse und der folgenden Auswertung.
BananaPi + CUL868 + CUL433 + HM-UART + 1Wire

papa

Ich habe Device::send() gerade gefixed. Bitte nochmal ohne den Hack probieren.
BananaPi + CUL868 + CUL433 + HM-UART + 1Wire

CitationJet

Funktioniert ohne den Hack leider nicht. Wieder AES Pendingmeldungen, die man per Configbuttondrücken für 20 Sekunden lösen kann.