Posts

Es werden Posts vom Januar, 2020 angezeigt.

SMA Wechselrichter / Daten der Photovoltaik Anlage und einer BYD Batterie auslesen

Bild
SMA Wechselrichter / Daten der Photovoltaik Anlage und einer BYD Batterie auslesen Ich wollte für eine DAKboard Integration auf meinem eigenen Raspberry Pi Dashboard gern die Daten der Photovoltaikanlage anzeigen. Ich habe einen Sunny Home Manager 2.0, einen Sunny Boy Storage 2.5 und einen Sunny Tripower 7000TL-20. Das ganze wird dann noch durch eine BYD Batterie ergänzt. Die Grundidee war nun, via Webrequest an den JSON Stream zu kommen. Ich mache es kurz - es ist/war ein Desaster. Die Daten sind zwar irgendwie über die Homepage abgreifbar ( https://www.sunnyportal.com/homemanager ), jedoch benötigt man dafür einen Login, und dieser ist leider nur via Web-Form Login machbar. Streckenweise hat es funktioniert, dann wieder stundenlang gar nicht. Manchmal habe ich JSON Werte nur mit null gefüllt zurück bekommen. Ich habe das basteln in diese Richtung dann nach 2 Tagen aufgegeben. Nun mache ich es anders. Über die öffentlich freigegebene Seite der Anlage bekommt man Dat...

CloudRadar - mailq check with Python

Bild
To create a custom check for CloudRadar to check you mailq size. This check allows to create a custom check at CloudRadar to check the mailq size. This is only about the number of mails in the queue. If this exceeds a limit, a warning or an error will be send to CloudRadar. #!/usr/bin/env python import requests import json import sys import subprocess # # Mailqueue check # # Your token of the custom check token = 'XXXXXXX' # Name of the custom check. Needs to be created on my.cloduradar.io first! check = 'mailq' # URL of cloudradars data hub. No need to change. url = "https://hub.cloudradar.io/cct/" # Max numbers of mails in queue before warning threshold = 4 alerts = [] warnings = [] payload = dict() p = subprocess.Popen('mailq | grep -c "^[A-F0-9]"', stdout=subprocess.PIPE, shell=True) (output, err) = p.communicate() payload[check+'.mailq'] = int(output) if int(output) > threshold:   ale...