RFD-FHEM / RFFHEM

Counterpart of SIGNALDuino, it's the code for FHEM to work with the data received from the uC
GNU General Public License v3.0
44 stars 33 forks source link

SD_GT feature request #1138

Closed elektron-bbs closed 1 year ago

elektron-bbs commented 1 year ago

Discussed in https://github.com/RFD-FHEM/RFFHEM/discussions/1137

Originally posted by **mithkr** December 29, 2022 Would it be possible to add an attr to the SD_GT 'all' button device to suppress state update for the other associated SD_GT devices [ABCD], so that the 'all' button can be used as 5th button via notify device to control different fhem devices.
elektron-bbs commented 1 year ago

Can we communicate in German?

elektron-bbs commented 1 year ago

Ich habe mir das Modul jetzt nochmal angesehen. Die Umsetzung deines Wunsches ist kein Problem. Allerdings verstehe ich den Sinn nicht ganz. Beim Senden aus FHEM wird ja trotzdem der Tastencode für all-on/off gesendet, so das alle Steckdosen darauf reagieren.

mithkr commented 1 year ago

Ich will nur die Fernbedienung nutzen und gar nicht die dazu gehörigen Steckdosen (sind teilweise eh schon defekt und nicht in Betrieb). Da das SD_GT Module die Tastendrücke der Fernbedinung erfasst und entsprechend Events auslöst, will ich diese Event nutzen um über ein notify Device andere FHEM Devices zu steuern (z.B. meine Shellies "defmod notify_SD_GT_D043C_D notify SD_GT_D043C_D set shelly_plug_s_b8640d $EVENT)". Aber aktuell erzeugt der Empfang der 'all' Taste nicht nur einen State Change für das 'all' device aus sondern ändert auch den State der 4 anderen Devices [ABCD], welche wiederum dann die zugeordneten notify Devices triggert. Ich würde aber gern den 'all' Button als unabhängigen 5 Button verwenden. Es geht um folgende Loop ab Zeile 367 von https://github.com/RFD-FHEM/RFFHEM/blob/master/FHEM/10_SD_GT.pm. Dort sollte per attr setting die loop deaktivierbar sein.

if (defined $level && $level eq 'all') { # received button all
        foreach my $d (keys %defs) { # sucht angelegte SD_GT mit gleichem Sytemcode 
            if(defined($defs{$d}) && $defs{$d}{TYPE} eq 'SD_GT' && $defs{$d}{DEF} =~ /$systemCode/xms && $defs{$d}{DEF} =~ /[ABCD]$/xms && ReadingsVal($d, 'state', $EMPTY) ne $state) {
                readingsSingleUpdate($defs{$d}, 'state' , $state , 1);
                DoTrigger($d, undef, 0);
                Log3 $name, 4, "$ioname: SD_GT_Parse received button $level, set $d $state";
            }
        }
    }
elektron-bbs commented 1 year ago

Ich habe mir schon so etwas in der Art gedacht. Ich werde ein Attribut "disableSetAllFunction" einbauen, das sowohl beim set als auch beim Empfang wirksam ist.

mithkr commented 1 year ago

Danke

elektron-bbs commented 1 year ago

Ich habe das Attribut jetzt vorerst in einem neuen Branch eingebaut. Installieren kannst du das Update mit folgendem Befehl:

update all https://raw.githubusercontent.com/RFD-FHEM/RFFHEM/master_SD_GT_feature/controls_signalduino.txt

Bitte mal testen und berichten.

mithkr commented 1 year ago

Danke, hab es gerade ausprobiert. Funktioniert wie gewünscht.

elektron-bbs commented 1 year ago

Die Änderung ist jetzt im Master-Branch. Ich schließe dieses Issue.