Von Tom, 3 Monate vorher, geschrieben in Bash.
Einbetten
  1. !- Batteriestatus Devices Telegram Benachrichtigung
  2. string chatid = "-xxxxxxxxxxxxxx"; ! chat_id des Empfängers
  3. string botAPI = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"; ! API des eingerichteten Bots
  4.  
  5. !- Fensterkontakte und Thermostate
  6. real ftkbz = (dom.GetObject(ID_CHANNELS)).Get("FTK-BZ:0").DPByHssDP("OPERATING_VOLTAGE").Value().ToString(1);
  7. real ftksz = (dom.GetObject(ID_CHANNELS)).Get("FTK-SZ:0").DPByHssDP("OPERATING_VOLTAGE").Value().ToString(1);
  8. real ftkwz = (dom.GetObject(ID_CHANNELS)).Get("FTK-WZ:0").DPByHssDP("OPERATING_VOLTAGE").Value().ToString(1);
  9. real hkaz = (dom.GetObject(ID_CHANNELS)).Get("HZ-AZ:0").DPByHssDP("OPERATING_VOLTAGE").Value().ToString(1);
  10. real hkbz = (dom.GetObject(ID_CHANNELS)).Get("HZ-BZ:0").DPByHssDP("OPERATING_VOLTAGE").Value().ToString(1);
  11. real hksz = (dom.GetObject(ID_CHANNELS)).Get("HZ-SZ:0").DPByHssDP("OPERATING_VOLTAGE").Value().ToString(1);
  12. real hkwz = (dom.GetObject(ID_CHANNELS)).Get("HZ-WZ:0").DPByHssDP("OPERATING_VOLTAGE").Value().ToString(1);
  13.  
  14. string nachricht = "<b>*Batteriestatus*</b>
  15. ----- <b>FTK + Thermostate</b> -----
  16. FTK Bad:   "# ftkbz #"V
  17. FTK SZ:    "# ftksz #"V
  18. FTK WZ:    "# ftkwz #"V
  19. HZ AZ:     "# hkaz #"V
  20. HZ Bad:    "# hkbz #"V
  21. HZ SZ:     "# hksz #"V
  22. HZ WZ:     "# hkwz #"V";
  23.  
  24. (dom.GetObject(ID_DATAPOINTS).Get("CUxD.CUX2801001:1.CMD_EXEC")).State("extra/curl -s -k https://api.telegram.org/bot"#botAPI#"/sendMessage -d text='"#nachricht.ToUTF8()#"' -d chat_id="#chatid#" -d parse_mode=html");
captcha