AbfallentsorgungBerlin BSR, ALBA und BerlinRecycling - neue Module

Begonnen von RomanticBoy83, 17 Juni 2017, 00:32:23

Vorheriges Thema - Nächstes Thema

andies

Fehlte tatsächlich, die Kategorie heißt logischerweise WB. Habe ich eingebaut (in dieser Fassung wurde auch das Problem gelöst, dass ein update jedes Mal einen neuen Timer ausgelöst hat; jetzt gibt es nur einen alle X Stunden in der Definition). Anbei noch meine devices, zur Info
defmod Abfall BSR
attr Abfall addrKey <HIER addrkey EINTRAGEN>
attr Abfall comment HM = Hausmüll (Restmüll)\
BI = Biotonne\
WS = Wertstofftonne (Gelber Sack/Tonne)\
LT = Laubtonne (falls vorhanden)\
WB = Weihnachtsbaum
attr Abfall intervalDays 14
attr Abfall stateFormat -
und ich lasse mir Telegram zusenden sowie im Raum "Info" in rot anzeigen, ob was abgeholt wird:
defmod Abfall_notify notify Abfall:next_BI:.* {\
my $tomorrow = strftime("%Y-%m-%d",localtime(time+86400));;\
my @cats = ('HM','BI','WS','LT', 'WB');;\
my %names = (HM=>"Hausmüll",BI=>"Biotonne",WS=>"Wertstofftonne",LT=>"Laubtonne", WB=>"Weihnachtsbaum");;\
my @morgen;;\
foreach my $c(@cats){my $v = ReadingsVal("Abfall","next_$c","");;\
 push @morgen,$names{$c} if $v eq $tomorrow\
};;\
if (@morgen) {\
 my $display = join(", ",@morgen);;\
 my $telegram = 'Morgen: '.$display;;\
 fhem("attr -silent Abfall stateFormat <span style='color:#cc0000'>$display</span>");;\
 fhem("attr -silent Abfall room Info");;;;fhem("set TelegramBot _msg 🚮: $telegram");;\
} else { \
 fhem("attr -silent Abfall stateFormat -");;\
 fhem("deleteattr -silent Abfall room");;}\
}
attr Abfall_notify event-min-interval .*:7200
FHEM 6.3 auf RaspPi4 (Raspbian:  6.6.28+; Perl: v5.36.0)
SIGNALduino (433 MHz) und HM-UART (868 MHz), Sonoff, Blitzwolf, Somfy RTS, CAME-Gartentor, Volkszähler, Keyence-Sensor, Homematic-Sensoren und -thermostat, Ferraris-Zähler für Wasseruhr, Openlink-Nachbau Viessmann