Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added AVANTEK Wireless doorbell & LED night light #981

Merged
merged 52 commits into from
Jul 9, 2021

Conversation

HomeAutoUser
Copy link
Contributor

  • Please check if the PR fulfills these requirements
  • Tests for the changes have been added / modified (needed for for bug fixes / features)
  • commandref has been added / updated (needed for bug fixes / features)
  • CHANGED has been updated (needed for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    feature

  • What is the current behavior? (You can also link to an open issue here)
    no receive signal

  • What is the new behavior (if this is a feature change)?
    receive signal

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

  • Other information:

HomeAutoUser and others added 30 commits December 30, 2019 16:34
Bumps [shogo82148/actions-setup-perl](https://github.com/shogo82148/actions-setup-perl) from v1.9.7 to v1.10.0.
- [Release notes](https://github.com/shogo82148/actions-setup-perl/releases)
- [Commits](shogo82148/actions-setup-perl@v1.9.7...d206bd5)

Signed-off-by: dependabot[bot] <support@github.com>
…ogo82148/actions-setup-perl-v1.10.0

Bump shogo82148/actions-setup-perl from v1.9.7 to v1.10.0
 * added AVANTEK DB-LE
* added AVANTEK rfmode
@HomeAutoUser
Copy link
Contributor Author

@sidey79
als Testdaten kannst du die RAW nuzen aus dem Protokolldatei.
Bei Übernahme wird das JSON erweitert um diese Nachricht.

@sidey79
Copy link
Contributor

sidey79 commented Jun 21, 2021

@sidey79
als Testdaten kannst du die RAW nuzen aus dem Protokolldatei.
Bei Übernahme wird das JSON erweitert um diese Nachricht.

Wäre es möglich das JSON zuerst zu erweitern?
Dann hätten wir hier bereits die Testergebnisse zur Verfügung.

@HomeAutoUser
Copy link
Contributor Author

@@ -212,6 +216,15 @@ sub Set {
$msg .= ';';
IOWrite($hash, 'raw', $msg);
Log3 $name, 4, "$ioname: $name $msg";
} elsif ($protocol == 112) {; # only AVANTEK
my $msg = 'SN;R=';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was hältst Du von einem einzeiler um $msg zu bilden?
my $msg = qq[SN;R=;$repeats;D=$split[1];98ABCDE;]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Als Einzeiler ist es auch möglich.
Ich habe mich nach dem "Muster" des Bestandcodes orientiert, wo ich die Variable dann Schrittweise und sofort erkenntlich nacheinander fülle. Bei dem Einzeiler spart man Code und muss ggf 2x hinschauen.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Für mich als Einzeiler eher erkennbar, wie hier msg zusammengesetzt wird.
Das auf mehrere Zeilen verteilen hätte ich jetzt als schwerer lesbar erachtet .

So sind die Geschmäcker wohl verschieden :)

$msg .= $split[1];
$msg .= '98ABCDE'; # cc1101 RX FIFO 4,8 ..... Bytes
$msg .= ';';
IOWrite($hash, 'raw', $msg);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wäre hier nicht sendMsg eher angebracht anstelle von raw um zu senden? Vermutlich hast Du dir was dabei gedacht was ich nicht auf Anhieb sehe :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich bilde mir ein vor zu Bett gehen, das sendMsg etwas Aufsich hatte wieso ich dies nicht nutzte.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sidey79 der Grund ist in der Verarbeitung von sendMsg. Dieses versucht anhand der Pattern alles zusammen zu bauen. Das gibt es bei FSK nicht :-) .

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meinst Du damit, sendMSG kann derzeit kein FSK oder es gibt nichts zusammenzusetzen?
Zeile 221 sieht für mich auf den 1. Blick so aus, als ob dort etwas zusammengesetzt wird, was in sendMSG generisch erfolgen könnte.

Gibt es hier denn einen eklatanten Unterschied zu MC?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sidey79 der Unterschied besteht darin, das sendMSG aus der SD_ProtocolData.pm haben möchte wie Bsp:

        one             => [1,-8],  # 500,-4000
        zero            => [1,-4],  # 500,-2000
        sync            => [1,-18], # 500,-9000
        clockabs        => 500,

die Bsp. (Sync / Start/ ....) hier https://github.com/RFD-FHEM/RFFHEM/blob/master/FHEM/00_SIGNALduino.pm#L876-L917
benötigt werden. Diese gibt es aber nicht bei FSK:

      {
        name            => 'Avantek',
        comment         => 'Wireless doorbell & LED night light',
        id              => '112',
        knownFreqs      => '433.3',
        datarate        => '50.087',
        sync            => '0869',
        modulation      => '2-FSK',
        rfmode          => 'Avantek',
        register        => ['0001','0246','0301','0408','0569','06FF','0780','0802','0D10','0EAA','0F56','108A','11F8','1202','1322','14F8','1551','1916','1B43','1C40','20FB','2156','2211'],
        preamble        => 'P112#',
        clientmodule    => 'SD_BELL',
        length_min      => '16',
        length_max      => '16',
      },

Aus diesem Grunde wird die Routine raw genutzt.
Mit Unterschieden zu MC hat das nichts zu tun. Wenn du dir eine FSK Definition ansiehst, so siehst du den Unterschied zu ASK/OOK.

Die Routine sendMSG muss somit nicht für FSK abgeändert werden. Du würdest somit unnötig dort eingreifen.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich bin wohl mal wieder der Spielverderber. :( Sorry schon mal dafür.

Ich verstehe den Ansatz. Es sieht auf den 1. Blick nach einfach und funktional aus.
Zugegeben, es ist auch funktional und auch erst einmal einfach.,

Allerdings halte ich nichts davon, dass das logische Modul, Befehle der verwendeten Hardware an das System übergibt.
Dazu einen kleinen Ausflug in die Vergangenheit.
Als ich das Signalduino Modul angefangen habe zu entwickeln, gab es bereits logische Module, hardware und phyische Module.
Vieles war auf einen CUL ausgelegt. Mein Ziel war es, ein physiches Modul für eine andere Hardware zu entwicken. Logische Module wollte ich mit nutzen. Eines war dann das IT Modul. Super gedacht. Empfangen war dann auch rasch umgesetzt, aber senden klappte so nicht, denn das IT Modul hat die Befehle von der Hardware direkt selbst abgesendet.
Also erst mal wrapper code und einen CUL für das Modul emuliert. Glücklicherweise konnte dem logischen Modul beigebracht werden, dass es auch andere Hardware als einen CUL gibt.

Worauf ich hinaus will ist vermutlich klar. Das logische Modul sollte nicht direkte Hardware Befehle übergeben.
Intuitiv würde ich auch nie darauf kommen, dass ich MU, MS, MC über sendMsg senden kann, aber MN nicht.
Die Implementierung könnte ähnlich wie bei MC erfolgen. Hier wird ja auch nichts umgewandelt.

Ich habe mich mit FSK Senden nicht sonderlich intensiv beschäftigt, aber Sync und die passenden Register müssen ja vermutlich für das Protokoll / Frequenz passend gesetzt werden und da sollten wir durch das phyische Modul vornehmen lassen und nicht hart in das logische Modul verdrahten.
Das führt nur Dazu, dass eine ggf. Zukünftige Hardware oder Firmware zu Kompatibilitätsverlust führt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hallo Spielverderber @sidey79 grins

Ich denke zu verstehen was du erläutert hast.
Eine Nachbesserung erfolgte und ich hoffe nun es richtig umgesetzt zu haben nach deinen Vorstellungen.

Ich habe mich mit FSK Senden nicht sonderlich intensiv beschäftigt, aber Sync und die passenden Register müssen ja vermutlich für das Protokoll / Frequenz passend gesetzt werden und da sollten wir durch das phyische Modul vornehmen lassen und nicht hart in das logische Modul verdrahten.
Das führt nur Dazu, dass eine ggf. Zukünftige Hardware oder Firmware zu Kompatibilitätsverlust führt.

Vor dem Senden musst du das Register und Sync nicht setzen. Die Einstellungen sind schon vorgenommen mit dem rfmode Attribut übernommen wurden um überhaupt das Device zu empfangen.

@HomeAutoUser
Copy link
Contributor Author

Hand heb

Copy link
Contributor

@sidey79 sidey79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ich habe noch eine Frage,

an welcher Stelle wird der Sender auf die passende Betriebsart / Frequenz gestellt

@sidey79
Copy link
Contributor

sidey79 commented Jul 8, 2021

Ich habe noch eine Frage,

an welcher Stelle wird der Sender auf die passende Betriebsart / Frequenz gestellt

Okay, habe die vorherige Antwort noch mal gelesen. Bedeutet, der Empfänger muss zuvor mittels rfmode umgestellt werden, es ist nicht möglich den Empang auf z.B. OOK zu lassen und im Bedarfsfall dann beim Senden (so wie bei diversen anderen Protokollen) automatisch auf FSK umzustellen.

@HomeAutoUser HomeAutoUser merged commit 362d845 into RFD-FHEM:master Jul 9, 2021
@HomeAutoUser
Copy link
Contributor Author

Okay, habe die vorherige Antwort noch mal gelesen. Bedeutet, der Empfänger muss zuvor mittels rfmode umgestellt werden, es ist nicht möglich den Empang auf z.B. OOK zu lassen und im Bedarfsfall dann beim Senden (so wie bei diversen anderen Protokollen) automatisch auf FSK umzustellen.

Genau richtig. Du musst vorher wissen welche Hardware du hast weil der cc1101 sich nicht selbstständig umstellt. Man muss ja für die andere Modulation die Register umstellen.

Wenn du den Empfang auf OOK belässt und beim Senden auf FSK bringen möchtest, so müsste vor dem Senden immer der cc1101 umkonfiguriert werden. Das ganze geht einfacher mit mehreren cc1101. Da gibts schöne und einfache Umsetzungen smile

@HomeAutoUser HomeAutoUser deleted the master_Avantek branch July 9, 2021 08:38
@HomeAutoUser HomeAutoUser mentioned this pull request Aug 2, 2021
7 tasks
@sidey79 sidey79 mentioned this pull request Jan 16, 2022
sidey79 added a commit that referenced this pull request Jan 16, 2022
Release 3.5.2 
     10_SD_Rojaflex.pm 
          new: Module for rojaflex remote controls

     90_SIGNALduino_un.pm
          changed: fix some PerlCritic hints (#914)
          changed: revised commandref

     00_SIGNALduino.pm:
          feature: xFSK processing
          feature: Added support for directio and none.
          feature: Extension for "get sduino ccreg" (#918)
          feature: parse subs optimized (#926)
          feature: update reading  config when change settings (#948)
          feature: Allow incremental addition of match list entries (#1026)
          change: added N to send SN  xFSK sendCommand
          change: added new sub SIGNALduino_calcRSSI to simplification code
          change: revised Parse_MN and loglevel
          change: revised logoutput text SIGNALduino_Get_Command
          change: rename "get raw" to "get rawmsg" (#925)
          feature: added commandref rfmode & cc1101_reg_user
          feature: added hardware ESP32cc1101, MAPLEMINI_F103CB on attribute
          feature: added new attrib rfmode to changed to xFSK & revised commandref
          feature: added separat sub SIGNALduino_Attr_rfmode
          feature: added set cmd LaCrossePairForSec (for LaCrosse
          bugfix: SIGNALduino_CheckccConfResponse is more robust #1015 (#1031)
          bugfix: fix PERL WARNING (#895) (#972)
          bugfix: get ccreg command caused stacktrace #898
          bugfix: Bugfix define with hostname 901 (#904)
          bugfix: Wrong version assignment fixed
          Bugfix, module runs now without fhemweb instance 
          bugfix: display protocol list (#947)
          bugfix: require 99_Utils only if really needed (#950)
          bugfix: corrected incorrect logoutput (#951)
          bugfix: Fix Multiple send delay (#941)
          bugfix: Fixes high CPU and MEM usage in patternExists (#988)

  SD_Protocols.pm:
          change: moved subs for converting in own package
                  ConvLaCrosse, ConvKoppFreeControl and ConvPCA301
          bugfix: Hideki fix inverted message (#974)

  SD_ProtocolData.pm
          feature: added rfmode, register rubric & comments
          change: fix perlcritic Severity 3 - hard tabs
          feature: Added crc checksum verification Revolt (#956)

  14_SD_WS.pm: 
         feature: protocol 27 for sensor EFS-3110A (#890)
         feature: protocol 106 for GT-TMBBQ-0   
         feature: protocol 110 for ADE WS1907 Weather station (#970)
         feature: protocol 111 for TS-FT002 water tank level (#1000)
         feature: protocol 113 for GFGT 433 B1 Wireless Grill sensor (#1003)
         feature: new protocol 108 for BRESSER 5-in-1 Weather Center
                  and BRESSER Professional Rain Gauge (#973)
         feature: protocol 115 for Bresser 6-in-1 and 
                  5-in-1 Comfort Wetter Center (#1010)
         feature: new protocol 107 for Fine Offset WH51 (#1055)
         feature: new protocol 116 for Fine Offset WH57 (#1061)
         bugfix: Update protocol 64 for sensor WH2A (#1009)
         bugfix: Conrad S522 protocol 33 no reading batteryState (#1042)

  14_SD_WS07.pm: 
         feature: protocol definition 7.1 for Mebus HQ7312-2 (#1050)

  14_FLAMINGO.pm: 
         change: Perlcritic (#887)

  14_SD_UT.pm:
         change: PerlCritic (#877)
         feature: new protocol 105 for remote control BF-301
         feature: decode and send protocol 56 remote control AC114-01B (#910)
         feature: decode and send protocol for Visivo remote control
         feature: Remote control SEAV BeSmart S4 (#933)
         feature: new protocol 114 for TR401 (#1002)

 14_SD_BELL.pm:
         change: PerlCritic (#877)
         change: Adjusted little things (#937)
         feature: added AVANTEK Wireless doorbell & LED night light (#981)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants