Hauptmenü

Relay Mysensors

Begonnen von Will, 24 November 2015, 23:21:00

Vorheriges Thema - Nächstes Thema

Will

Hallo zusammen,

habe mit dem Thema MYSENSORS angefangen - laeuft prinzipiell.

Habe nun ein Relay& Button aufgesetzt, kann auch ueber set MYSENSOR_103 set state1 on/off schalten.
im Event Monitor sehe ich
2015-11-24 23:14:56 MYSENSORS_DEVICE MYSENSOR_103 status1: 1107296256
Was bedeutet die Zahl
Was kann ich mit power1 machen?

Definition sieht so aus:
define MYSENSOR_103 MYSENSORS_DEVICE 103
attr MYSENSOR_103 IODev ESPGAteway
attr MYSENSOR_103 mapReading_power1 1 power
attr MYSENSOR_103 mapReading_status1 1 status
attr MYSENSOR_103 mode repeater
attr MYSENSOR_103 setReading_power1 1
attr MYSENSOR_103 setReading_status1 on,off
attr MYSENSOR_103 version 1.5.1

Danke.

W

porkman

Hi Will,

ich habe mir dieser Tage auch mal nen mysensors Gateway gebaut um meine seit langem rumliegenden nrf24 mal einer Verwendung zuzuführen, leider hab ich die gleichen Probleme wie Du. Hast Du evtl. schon eine Lösung gefunden? Die DS18B20 Temperatursensoren laufen bei mir prima in Verbindung mit nem ESP8266 (nodemcu) als WIFI Gateway. Auf den ESP hab ich den Sketch von Hexenmeister aufespielt. Hat sich an den Mysensors Modulen in FHEM was gravierendes geändert, seit Thunder1902 sein Tutorial verfasst hat?
Wer verwendet auch Mysensors in Verbindung mit Relais und Buttons und könnte mir auf die Sprünge helfen?

Herzliche Grüße
Hartmut

Will

Ich habe den sensor mittlerweile nicht mehr am laufen. Seit ich aber die nrf Module mit einem Kondensator ausgestattet habe, gibts eigentlich keine seltsamen Effekte mehr und Alles funktioniert wir es soll. Gruss W

Hauswart

#3
Probiert bitte mal diese Datei aus: https://raw.githubusercontent.com/Kolbi/fhem-mirror/Kolbi-patch-2/fhem/FHEM/10_MYSENSORS_DEVICE.pm sollte diese nicht gehen dann mal diese: https://raw.githubusercontent.com/Kolbi/fhem-mirror/master/fhem/FHEM/10_MYSENSORS_DEVICE.pm

Sollte das Problem lösen?



Auslöser ist folgendes https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MyMessage.h:
S_LIGHT, // Binary light or relay, V_STATUS (or V_LIGHT), V_WATT   
S_BINARY=3, // Binary light or relay, V_STATUS (or V_LIGHT), V_WATT (same as S_LIGHT)

In 10_MYSENSORS_DEVICE.pm stand bisher nur S_BINARY habe dies nun durch S_LIGHT ersetzt...


1. Installation:
KNX, Tasmota (KNX), Sonos, Unifi

2. Installation:
HM-CFG-USB, Unifi (, SIGNALduino 868, MySensors, SIGNALduino 433)

Omega

Das Problem mit den hohen Zahlen beim Status (status1: 1107296256) hatte ich auch.
In meiner Konstellation sowohl beim Relay als auch bei einem einfachen Schalter.

Auf der Sensorseite war alles ok, nachdem das Gateway  die Daten aber übertragen hatte, kamen dann in FHEM diese astronomischen Werte an.

Gelöst habe ich es durch Verwendung der MySensors-Development-Library und Anpassung der Sketche (Gateway und Sensor)  auf 2.0.0-beta. Arduino-IDE 1.6.5.
Für den Schalter habe ich dabei auch nicht mehr S_Door verwendet sondern S_BINARY (damit kommt direkt on/off im Status).
NUC6i3SYH (FHEM 5.8 in VM)
Homematic: HMLAN, HMUSB, HM-Sec-SD, HM-CC-RT-DN, HM-TC-IT, ... + diverse weitere
LaCrosseGateway, ESPEasy
ZWave

porkman

#5
Zitat von: Hauswart am 03 Februar 2016, 08:55:54
Probiert bitte mal diese Datei aus: https://raw.githubusercontent.com/Kolbi/fhem-mirror/Kolbi-patch-2/fhem/FHEM/10_MYSENSORS_DEVICE.pm sollte diese nicht gehen dann mal diese: https://raw.githubusercontent.com/Kolbi/fhem-mirror/master/fhem/FHEM/10_MYSENSORS_DEVICE.pm

Sollte das Problem lösen?

Auslöser ist folgendes https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MyMessage.h:
S_LIGHT, // Binary light or relay, V_STATUS (or V_LIGHT), V_WATT   
S_BINARY=3, // Binary light or relay, V_STATUS (or V_LIGHT), V_WATT (same as S_LIGHT)

In 10_MYSENSORS_DEVICE.pm stand bisher nur S_BINARY habe dies nun durch S_LIGHT ersetzt...

Hallo Hauswart,

bei den beiden von Dir vorgeschlagenen Files krieg ich Errors im Log und das Modul wird von FHEM auf deactivated gesetzt. Meine, eher eindimensionalen, Perl Kentnisse reichen da leider nicht zum Debuggen  ::)
Kolbi-patch-2/fhem/FHEM/10_MYSENSORS_DEVICE.pm:
2016.02.03 18:00:22 1: PERL WARNING: Subroutine MYSENSORS_DEVICE_Initialize redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 34.
2016.02.03 18:00:22 1: PERL WARNING: Subroutine Define redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 182.
2016.02.03 18:00:22 1: PERL WARNING: Subroutine UnDefine redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 199.
2016.02.03 18:00:22 1: PERL WARNING: Subroutine Set redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 205.
2016.02.03 18:00:22 1: PERL WARNING: Subroutine Attr redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 250.
2016.02.03 18:00:22 1: PERL WARNING: Subroutine onGatewayStarted redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 372.
2016.02.03 18:00:22 1: PERL WARNING: Subroutine onPresentationMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 376.
2016.02.03 18:00:22 1: PERL WARNING: Subroutine onSetMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 433.
2016.02.03 18:00:22 1: PERL WARNING: Subroutine onRequestMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 446.
2016.02.03 18:00:22 1: PERL WARNING: Subroutine onInternalMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 461.
2016.02.03 18:00:22 1: PERL WARNING: Subroutine sendClientMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 557.
2016.02.03 18:00:22 1: PERL WARNING: Subroutine rawToMappedReading redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 564.
2016.02.03 18:00:22 1: PERL WARNING: Subroutine mappedReadingToRaw redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 575.
2016.02.03 18:00:22 1: reload: Error:Modul 10_MYSENSORS_DEVICE deactivated:
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86.
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86.
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86.
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86.
Bareword "VAR1" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86.


...und bei der Kolbi/fhem-mirror/master/fhem/FHEM/10_MYSENSORS_DEVICE.pm:

2016.02.03 17:54:57 1: reload: Error:Modul 10_MYSENSORS_DEVICE deactivated:
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 263.
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 263.
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 263.
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 263.
Bareword "VAR1" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 263.

2016.02.03 17:54:57 0: Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 263.
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 263.
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 263.
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 263.
Bareword "VAR1" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 263.

Subroutine MYSENSORS_DEVICE_Initialize redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 34, <$fh> line 290.
Subroutine Define redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 182, <$fh> line 290.
Subroutine UnDefine redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 199, <$fh> line 290.
Subroutine Set redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 205, <$fh> line 290.
Subroutine Attr redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 250, <$fh> line 290.
Subroutine onGatewayStarted redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 372, <$fh> line 290.
Subroutine onPresentationMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 376, <$fh> line 290.
Subroutine onSetMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 433, <$fh> line 290.
Subroutine onRequestMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 446, <$fh> line 290.
Subroutine onInternalMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 461, <$fh> line 290.
Subroutine sendClientMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 557, <$fh> line 290.
Subroutine rawToMappedReading redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 564, <$fh> line 290.
Subroutine mappedReadingToRaw redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 575, <$fh> line 290.
2016.02.03 17:54:57 1: reload: Error:Modul 10_MYSENSORS_DEVICE deactivated:
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 290.
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 290.
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 290.
Bareword "V_LIGHT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 290.
Bareword "VAR1" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 86, <$fh> line 290.


Muss V_LIGHT und VAR1 evtl noch in die Constants.pm rein? (fhem update hab ich erst gestern laufen lassen, sollte soweit aktuell sein)
Ich hab die MySensors Arduino Library v1.5 mit der IDE 1.6.7 im Einsatz. Muss ich evtl. da noch was anpassen?
Besten Dank für die Unterstützung!

CU
Hartmut

@Omega: 2.0.0-beta? Könnte ich auch mal testen. Wobei mein Nodemcu Wifi Gateway mit der akutellen Firmware seit Tagen sehr stabil und zufriedenstellend mit meinen DS1820 Temperature-Nodes läuft.

Omega

Mein DHT22 lief auch problemlos - nur eben beim Schalter und beim Relais hatte ich diese merkwürdigen Werte. Und die haben sich leider manchmal auch noch geändert, ansonsten hätte ich mit eventMap ja einfach eine Umsetzung machen können.
NUC6i3SYH (FHEM 5.8 in VM)
Homematic: HMLAN, HMUSB, HM-Sec-SD, HM-CC-RT-DN, HM-TC-IT, ... + diverse weitere
LaCrosseGateway, ESPEasy
ZWave

Hauswart

1. Installation:
KNX, Tasmota (KNX), Sonos, Unifi

2. Installation:
HM-CFG-USB, Unifi (, SIGNALduino 868, MySensors, SIGNALduino 433)

porkman

Hi Hauswart,

hab die Files mal getestet, krieg aber leider immer noch ein paar Errors, V_LIGHT braucht offenbar noch nen Verweis in Constants.pm?
#-- Variable types
use constant {
  V_TEMP               => 0,
  V_HUM                => 1,
  V_STATUS             => 2,
  V_PERCENTAGE         => 3, <----- muss hier evtl. V_LIGHT hin?
  V_PRESSURE           => 4,
  V_FORECAST           => 5,


Anyway, ich hab glaubich zwischenzeitlich das Problem eingekreist. Es scheint an der Arduino-Mysensors Lib 1.5.x zu liegen, welche ich bisher verwendet habe um meine Nodes zu betanken. Nachdem ich meinen Relay/Button Node mit Dev-Version 2.0.0-beta gebacken hab, funzt alles wie erwartet und die Stati wechseln sauber zwischen 0 und 1.
Hier mal die Logschnipsel:
Mit den 1.5.x Libs schaut das Log so aus:
2016.02.11 18:36:41 5: MYSENSORS/RAW: /1;1;1;0;2;1083047937

2016.02.11 18:36:41 5: MYSENSORS Read: Rx: fr=001 ci=001 c=001(C_SET         ) st=002(V_STATUS        ) ack=0 '1083047937'

2016.02.11 18:36:42 5: MYSENSORS/RAW: /1;1;1;0;2;1083047936

2016.02.11 18:36:42 5: MYSENSORS Read: Rx: fr=001 ci=001 c=001(C_SET         ) st=002(V_STATUS        ) ack=0 '1083047936'

Mit der 2.0.0-beta:
2016.02.11 18:41:08 5: MYSENSORS/RAW: /1;1;1;0;2;0

2016.02.11 18:41:08 5: MYSENSORS Read: Rx: fr=001 ci=001 c=001(C_SET         ) st=002(V_STATUS        ) ack=0 '0'

2016.02.11 18:41:08 5: MYSENSORS/RAW: /1;1;1;0;2;1

2016.02.11 18:41:08 5: MYSENSORS Read: Rx: fr=001 ci=001 c=001(C_SET         ) st=002(V_STATUS        ) ack=0 '1'


Ich denke da können die FHEM Module eher nix dafür, bzw. liesse sich in FHEM vermutlich nichts ummappen, da sich die Zahlenwerte immer wieder änderten...
...trozdem allerbesten Dank für Deinen Support!

Herzliche Grüße
Hartmut

Hauswart

Gerade nochmal in der API nachgeschaut: http://www.mysensors.org/download/serial_api_15 Theoretisch ist V_LIGHT sogar veraltet und durch V_STATUS ersetzt worden...
1. Installation:
KNX, Tasmota (KNX), Sonos, Unifi

2. Installation:
HM-CFG-USB, Unifi (, SIGNALduino 868, MySensors, SIGNALduino 433)