jp112

HomeMatic Anzahl benötigter Batterien berechnen

Feb 18th, 2018
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 3.59 KB | None | 0 0
  1. string cr2016 = "HM-RC-4\tHM-RC-4-B\tHM-RC-Key3\tHM-RC-Key3-B\tHM-RC-P1\tHM-RC-Sec3\tHM-RC-Sec3-B";
  2. string cr2032 = "HM-PB-2-WM\tHM-PB-4-WM\tHM-PBI-4-FM\tHM-SCI-3-FM\tHM-Sec-TiS\tHM-SwI-3-FM\tHM-Sec-TiS";
  3. string lr14x2 = "HM-Sec-Sir-WM\tHM-OU-CFM-TW";
  4. string lr44x2 = "HM-Sec-SC\tHM-Sec-SC2\tHM-Sec-SC-2\tHM-Sec-RHS";
  5. string lr6x2 = "HM-CC-VD\tHM-CC-RT-DN\tHM-Sec-WDS\tHM-Sec-WDS-2\tHM-CC-TC\tHM-Dis-TD-T\tHB-UW-Sen-THPL-I\tHM-TC-IT-WM-W-EU\tHM-WDS40-TH-I\tHM-WDS40-TH-I-2\tHM-WDS10-TH-O\tHmIP-SMI\tHMIP-eTRV\tHM-WDS30-OT2-SM-2\tHmIP-SMO\tHmIP-SMO-A\tHmIP-SPI\tHmIP-STHD";
  6. string lr6x3 = "HM-Sec-MDIR\tHM-Sec-MDIR-2\tHM-Sec-SD\tHM-Sec-Key\tHM-Sec-Key-S\tHM-Sec-Key-O\tHM-Sen-Wa-Od\tHM-Sen-MDIR\tHM-Sen-MDIR-O\tHM-Sen-MDIR-O-2\tHM-WDS100-C6-O\tHM-WDS100-C6-O-2\tHM-WDS100-C6-O-2\tHmIP-ASIR";
  7. string lr6x4 = "HM-CCU-1\tHM-ES-TX-WM\tHM-WDC7000";
  8. string lr3x1 = "HM-RC-4-2\tHM-RC-4-3\tHM-RC-Key4-2\tHM-RC-Key4-3\tHM-RC-Sec4-2\tHM-RC-Sec4-3\tHM-Sec-RHS-2\tHM-Sec-SCo\tHmIP-KRC4\tHmIP-KRCA\tHmIP-RC8\tHmIP-SRH\tHMIP-SWDO";
  9. string lr3x2 = "HM-Dis-WM55\tHM-Dis-EP-WM55\tHM-PB-2-WM55\tHM-PB-2-WM55-2\tHM-PB-6-WM55\tHM-PBI-2-FM\tHM-RC-8\tHM-Sen-DB-PCB\tHM-Sen-EP\tHM-Sen-MDIR-SM\tHM-Sen-MDIR-WM55\tHM-TC-IT-WM-W-EU\tHM-WDS30-T-O\tHM-WDS30-OT2-SM\tHmIP-STH\tHMIP-WRC2\tHMIP-WRC6\tHMIP-WTH\tHMIP-WTH-2";
  10. string lr3x3 = "HM-PB-4Dis-WM\tHM-PB-4Dis-WM-2\tHM-RC-Dis-H-x-EU\tHM-Sen-LI-O";
  11. string lr3x3a = "HM-RC-19\tHM-RC-19-B\tHM-RC-12\tHM-RC-12-B\tHM-RC-12-W";
  12. string block9 = "HM-LC-Sw1-Ba-PCB\tHM-LC-Sw4-PCB\tHM-MOD-EM-8\tHM-MOD-Re-8\tHM-Sen-RD-O\tHM-OU-CM-PCB\tHM-LC-Sw4-WM";
  13. string fixed    = "HM-Sec-SD-2\tHMIP-SWSD";
  14. string recharge = "HM-Sec-Win\tHM-Sec-SFA-SM";
  15. integer num_lr3 = 0;
  16. integer num_lr3a = 0;
  17. integer num_lr6 = 0;
  18. integer num_lr14 = 0;
  19. integer num_lr44 = 0;
  20. integer num_cr2016 = 0;
  21. integer num_cr2032 = 0;
  22. integer num_block9 = 0;
  23. integer num_fixed = 0;
  24. integer num_recharge = 0;
  25.  
  26. object devs = dom.GetObject( ID_DEVICES );
  27. string dev = "";
  28. foreach (dev, devs.EnumIDs()) {
  29.   object oDev = dom.GetObject(dev);
  30.   string index;
  31.   foreach (index, cr2016) {if (index == oDev.HssType()) {num_cr2016 = num_cr2016 + 1;}}
  32.   foreach (index, cr2032) {if (index == oDev.HssType()) {num_cr2032 = num_cr2032 + 1;}}
  33.   foreach (index, lr14x2) {if (index == oDev.HssType()) {num_lr14 = num_lr14 + 2;}}
  34.   foreach (index, lr44x2) {if (index == oDev.HssType()) {num_lr44 = num_lr44 + 2;}}
  35.   foreach (index, lr6x2) {if (index == oDev.HssType()) {num_lr6 = num_lr6 + 2;}}
  36.   foreach (index, lr6x3) {if (index == oDev.HssType()) {num_lr6 = num_lr6 + 3;}}
  37.   foreach (index, lr6x4) {if (index == oDev.HssType()) {num_lr6 = num_lr6 + 4;}}
  38.   foreach (index, lr3x1) {if (index == oDev.HssType()) {num_lr3 = num_lr3 + 1;}}
  39.   foreach (index, lr3x2) {if (index == oDev.HssType()) {num_lr3 = num_lr3 + 2;}}
  40.   foreach (index, lr3x3) {if (index == oDev.HssType()) {num_lr3 = num_lr3 + 3;}}
  41.   foreach (index, lr3x3a) {if (index == oDev.HssType()) {num_lr3a = num_lr3a + 1;}}
  42.   foreach (index, block9) {if (index == oDev.HssType()) {num_block9 = num_block9 + 1;}}
  43.   foreach (index, fixed) {if (index == oDev.HssType()) {num_fixed = num_fixed + 1;}}
  44.   foreach (index, recharge) {if (index == oDev.HssType()) {num_recharge = num_recharge + 1;}}
  45. }
  46.  
  47. WriteLine("Anzahl CR2016 = "#num_cr2016);
  48. WriteLine("Anzahl CR2032 = "#num_cr2032);
  49. WriteLine("Anzahl LR03   = "#num_lr3);
  50. WriteLine("Anzahl LR06   = "#num_lr6);
  51. WriteLine("Anzahl LR14   = "#num_lr14);
  52. WriteLine("Anzahl LR44   = "#num_lr44);
  53. WriteLine("Anzahl LR3a   = "#num_lr3a);
  54. WriteLine("Anzahl 9VBlock= "#num_block9);
  55. WriteLine("Anzahl Fixed  = "#num_fixed);
  56. WriteLine("Anzahl Rechar.= "#num_recharge);
Advertisement
Add Comment
Please, Sign In to add comment