Integration von MySensors in FHEM geplant?

Begonnen von fh555, 06 September 2014, 00:40:58

Vorheriges Thema - Nächstes Thema

Peter_64

Zitat von: hexenmeister am 11 September 2015, 10:40:03
Hi Robin,

ich habe mich mit dem Sketch noch nicht wirklich beschäftigt, daher, was ich jetzt schreibe ist 'glauben' und nicht 'wissen', ich bin mir aber recht sicher, dass da keine Vorkehrungen gegen Datenverlust vorhanden sind.
Ständiger Datentransfer ist dennoch relativ. Eine Verbindung muss stehen, die Daten fließen jedoch nur, wenn es was zu melden gibt. Die Übertragung ist natürlich gesichert (TCP) daher werden fehlerhafte Pakete erneut gesendet. Wenn die Verbindung jedoch ganz abbricht, dann kommt nichts mehr.
Das ist bei einem LAN-Gateway aber auch nicht anders. Da ich dort auch mit Abbrüchen zu kämpfen habe, habe ich in FHEM einen ständigen reconnect eingebaut (mit AT, jede Minute). Nicht schön, tut aber.

Ich würde gerne das auf MQTT umbauen, das dürfte deutlich sicherer sein. Mir fehlt aber, wie immer, an Zeit :(
Hallo Alex,
das Problem mit den Abbrüchen LAN Gateway habe ich auch. Welche Befehle startest Du mit Deinem at genau ?

Danke

Hauswart

Zitat von: gloob am 11 September 2015, 11:17:55
Hast du etwas verändert? Weil ich bekomme noch den gleichen Fehler. An was kann der Fehler liegen?
Ja, hatte ausversehen V_AMRED anstatt V_ARMED geschrieben. Hast du die neueste Version von Github heruntergeladen und ersetzt? Gleiche Fehlermeldungen?
1. Installation:
KNX, Tasmota (KNX), Sonos, Unifi

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

gloob

Hallo,

Ich hab die Datei über deinen Link geladen und komplett im FHEM Ordner ersetzt.
Nur den Fehler mit V_AMRED gibt es nicht mehr. Alle anderen sind noch vorhanden. Scheinbar gibt es die Variablen nicht.
Raspberry Pi 3 | miniCUL 433MHz | nanoCUL 868 MHz | nanoCUL 433 MHz | MySensors WLAN Gateway | LaCrosse WLAN Gateway | SignalESP 433 MHz | SignalESP 868 MHz | HM-MOD-UART WLAN Gateway | IR - 360 Grad WLAN Gateway

Hauswart

Zitat von: gloob am 11 September 2015, 13:01:14
Hallo,

Ich hab die Datei über deinen Link geladen und komplett im FHEM Ordner ersetzt. Einen Fehler mit V_AMRED scheint es auch nicht zu geben.
Kannst du mir bitte nochmal die aktuellen Fehlermeldung schicken?
1. Installation:
KNX, Tasmota (KNX), Sonos, Unifi

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

gloob

#394
2015.09.11 11:03:38 1: PERL WARNING: Terminating on signal SIGHUP(1)
2015.09.11 11:03:41 1: starting in console mode
2015.09.11 11:03:41 1: Including fhem.cfg
2015.09.11 11:03:41 3: telnetPort: port 7072 opened
2015.09.11 11:03:41 3: WEB: port 8083 opened
2015.09.11 11:03:41 3: WEBphone: port 8084 opened
2015.09.11 11:03:41 3: WEBtablet: port 8085 opened
2015.09.11 11:03:41 2: eventTypes: loaded 0 events from ./log/eventTypes.txt
2015.09.11 11:03:41 1: reload: Error:Modul 10_MYSENSORS_DEVICE deactivated:
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_PERCENTAGE" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_PERCENTAGE" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_ID" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_SETPOINT_HEAT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_FLOW_STATE" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_UNIT_PREFIX" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_LEVEL" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_LEVEL" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_UNIT_PREFIX" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_LEVEL" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_UNIT_PREFIX" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_RGB" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_RGB" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_RGBW" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_RGBW" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_RGB" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_RGB" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_SETPOINT_HEAT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_SETPOINT_COLD" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_FLOW_STATE" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_FLOW_MODE" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_SPEED" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_LEVEL" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_LEVEL" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_LEVEL" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.

2015.09.11 11:03:41 0: Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_PERCENTAGE" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_PERCENTAGE" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_ID" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_SETPOINT_HEAT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_FLOW_STATE" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_UNIT_PREFIX" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_LEVEL" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_LEVEL" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_UNIT_PREFIX" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_LEVEL" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_UNIT_PREFIX" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_RGB" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_RGB" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_RGBW" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_RGBW" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_RGB" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_RGB" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_SETPOINT_HEAT" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_SETPOINT_COLD" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_FLOW_STATE" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_FLOW_MODE" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_HVAC_SPEED" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_STATUS" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_LEVEL" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_LEVEL" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.
Bareword "V_LEVEL" not allowed while "strict subs" in use at ./FHEM/10_MYSENSORS_DEVICE.pm line 85, <$fh> line 38.

2015.09.11 11:03:41 1: Including ./log/fhem.save
2015.09.11 11:03:41 1: configfile: Cannot load module MYSENSORS_DEVICE
2015.09.11 11:03:41 3: initialUsbCheck return value: This command is not yet supported on windows
2015.09.11 11:03:41 2: Error messages while initializing FHEM: configfile: Cannot load module MYSENSORS_DEVICE
2015.09.11 11:03:41 0: Featurelevel: 5.6
2015.09.11 11:03:41 0: Server started with 9 defined entities (version $Id: fhem.pl 9163 2015-08-30 07:57:51Z rudolfkoenig $, os MSWin32, user PCE Pilot, pid 4004)



Startet FHEM bei dir ohne Probleme?
Raspberry Pi 3 | miniCUL 433MHz | nanoCUL 868 MHz | nanoCUL 433 MHz | MySensors WLAN Gateway | LaCrosse WLAN Gateway | SignalESP 433 MHz | SignalESP 868 MHz | HM-MOD-UART WLAN Gateway | IR - 360 Grad WLAN Gateway

gloob

Kann es sein dass eine Anpassung in der C:\fhem-5.6\FHEM\lib\Device\MySensors\Constants.pm noch fehlt?
Raspberry Pi 3 | miniCUL 433MHz | nanoCUL 868 MHz | nanoCUL 433 MHz | MySensors WLAN Gateway | LaCrosse WLAN Gateway | SignalESP 433 MHz | SignalESP 868 MHz | HM-MOD-UART WLAN Gateway | IR - 360 Grad WLAN Gateway

gloob

#396
Hallo

Nachdem ich jetzt die Constants.pm wie folgt angepasst habe scheint es FAST zu gehen

Änderung:

package Device::MySensors::Constants;

use List::Util qw(first);

#-- Message types
use constant {
  C_PRESENTATION => 0,
  C_SET          => 1,
  C_REQ          => 2,
  C_INTERNAL     => 3,
  C_STREAM       => 4,
};

use constant commands => qw( C_PRESENTATION C_SET C_REQ C_INTERNAL C_STREAM );

sub commandToStr($) {
  (commands)[shift];
}

#-- Variable types
use constant {
  V_TEMP        => 0,
  V_HUM         => 1,
  V_LIGHT       => 2,
  V_DIMMER      => 3,
  V_PRESSURE    => 4,
  V_FORECAST    => 5,
  V_RAIN        => 6,
  V_RAINRATE    => 7,
  V_WIND        => 8,
  V_GUST        => 9,
  V_DIRECTION   => 10,
  V_UV          => 11,
  V_WEIGHT      => 12,
  V_DISTANCE    => 13,
  V_IMPEDANCE   => 14,
  V_ARMED       => 15,
  V_TRIPPED     => 16,
  V_WATT        => 17,
  V_KWH         => 18,
  V_SCENE_ON    => 19,
  V_SCENE_OFF   => 20,
  V_HEATER      => 21,
  V_HEATER_SW   => 22,
  V_LIGHT_LEVEL => 23,
  V_VAR1        => 24,
  V_VAR2        => 25,
  V_VAR3        => 26,
  V_VAR4        => 27,
  V_VAR5        => 28,
  V_UP          => 29,
  V_DOWN        => 30,
  V_STOP        => 31,
  V_IR_SEND     => 32,
  V_IR_RECEIVE  => 33,
  V_FLOW        => 34,
  V_VOLUME      => 35,
  V_LOCK_STATUS => 36,
  V_DUST_LEVEL => 37,
  V_VOLTAGE     => 38,
  V_CURRENT     => 39,
  V_RGB      => 40,
  V_LEVEL      => 41,
  V_STATUS      => 42,
  V_RGBW => 43,
  V_PERCENTAGE => 44,
  V_ID => 45,
  V_UNIT_PREFIX => 46,
  V_HVAC_SETPOINT_HEAT => 47,
  V_HVAC_SETPOINT_COLD => 48,
  V_HVAC_FLOW_STATE => 49,
  V_HVAC_FLOW_MODE => 50,
  V_HVAC_SPEED => 51,
 
 
};

use constant variableTypes => qw{ V_TEMP V_HUM V_LIGHT V_DIMMER V_PRESSURE V_FORECAST V_RAIN
        V_RAINRATE V_WIND V_GUST V_DIRECTION V_UV V_WEIGHT V_DISTANCE
        V_IMPEDANCE V_ARMED V_TRIPPED V_WATT V_KWH V_SCENE_ON V_SCENE_OFF
        V_HEATER V_HEATER_SW V_LIGHT_LEVEL V_VAR1 V_VAR2 V_VAR3 V_VAR4 V_VAR5
        V_UP V_DOWN V_STOP V_IR_SEND V_IR_RECEIVE V_FLOW V_VOLUME V_LOCK_STATUS
        V_DUST_LEVEL V_VOLTAGE V_CURRENT V_RGB V_LEVEL V_STATUS V_RGBW V_PERCENTAGE V_ID
V_UNIT_PREFIX V_HVAC_SETPOINT_HEAT V_HVAC_SETPOINT_COLD V_HVAC_FLOW_STATE V_HVAC_FLOW_MODE
V_HVAC_SPEED};

sub variableTypeToStr($) {
  (variableTypes)[shift];
}

sub variableTypeToIdx($) {
  my $var = shift;
  return first { (variableTypes)[$_] eq $var } 0 .. scalar(variableTypes);
}

#-- Internal messages
use constant {
  I_BATTERY_LEVEL    => 0,
  I_TIME             => 1,
  I_VERSION          => 2,
  I_ID_REQUEST       => 3,
  I_ID_RESPONSE      => 4,
  I_INCLUSION_MODE   => 5,
  I_CONFIG           => 6,
  I_PING             => 7,
  I_PING_ACK         => 8,
  I_LOG_MESSAGE      => 9,
  I_CHILDREN         => 10,
  I_SKETCH_NAME      => 11,
  I_SKETCH_VERSION   => 12,
  I_REBOOT           => 13,
  I_STARTUP_COMPLETE => 14.
};

use constant internalMessageTypes => qw{ I_BATTERY_LEVEL I_TIME I_VERSION I_ID_REQUEST I_ID_RESPONSE
        I_INCLUSION_MODE I_CONFIG I_PING I_PING_ACK
        I_LOG_MESSAGE I_CHILDREN I_SKETCH_NAME I_SKETCH_VERSION
        I_REBOOT I_STARTUP_COMPLETE };

sub internalMessageTypeToStr($) {
  (internalMessageTypes)[shift];
}

#-- Sensor types
use constant {
  S_DOOR                  => 0,
  S_MOTION                => 1,
  S_SMOKE                 => 2,
  S_LIGHT                 => 3,
  S_DIMMER                => 4,
  S_COVER                 => 5,
  S_TEMP                  => 6,
  S_HUM                   => 7,
  S_BARO                  => 8,
  S_WIND                  => 9,
  S_RAIN                  => 10,
  S_UV                    => 11,
  S_WEIGHT                => 12,
  S_POWER                 => 13,
  S_HEATER                => 14,
  S_DISTANCE              => 15,
  S_LIGHT_LEVEL           => 16,
  S_ARDUINO_NODE          => 17,
  S_ARDUINO_REPEATER_NODE => 18,
  S_LOCK                  => 19,
  S_IR                    => 20,
  S_WATER                 => 21,
  S_AIR_QUALITY           => 22,
  S_CUSTOM                => 23,
  S_DUST                  => 24,
  S_SCENE_CONTROLLER      => 25,
  S_RGB_LIGHT             => 26,
  S_RGBW_LIGHT            => 27,
  S_COLOR_SENSOR          => 28,
  S_HVAC                  => 29,
  S_MULTIMETER            => 30,
  S_SPRINKLER             => 31,
  S_WATER_LEAK            => 32,
  S_SOUND                 => 33,
  S_VIBRATION             => 34,
  S_MOISTURE              => 35,
};

use constant sensorTypes => qw{ S_DOOR S_MOTION S_SMOKE S_LIGHT S_DIMMER S_COVER S_TEMP S_HUM S_BARO S_WIND
        S_RAIN S_UV S_WEIGHT S_POWER S_HEATER S_DISTANCE S_LIGHT_LEVEL S_ARDUINO_NODE
        S_ARDUINO_REPEATER_NODE S_LOCK S_IR S_WATER S_AIR_QUALITY S_CUSTOM S_DUST S_SCENE_CONTROLLER
S_RGB_LIGHT S_RGBW_LIGHT S_COLOR_SENSOR S_HVAC S_MULTIMETER S_SPRINKLER S_WATER_LEAK S_SOUND
S_VIBRATION S_MOISTURE};

sub sensorTypeToStr($) {
  (sensorTypes)[shift];
}

sub sensorTypeToIdx($) {
  my $var = shift;
  return first { (sensorTypes)[$_] eq $var } 0 .. scalar(sensorTypes);
}

#-- Datastream types
use constant {
  ST_FIRMWARE_CONFIG_REQUEST  => 0,
  ST_FIRMWARE_CONFIG_RESPONSE => 1,
  ST_FIRMWARE_REQUEST         => 2,
  ST_FIRMWARE_RESPONSE        => 3,
  ST_SOUND                    => 4,
  ST_IMAGE                    => 5,
};

use constant datastreamTypes => qw{ ST_FIRMWARE_CONFIG_REQUEST ST_FIRMWARE_CONFIG_RESPONSE ST_FIRMWARE_REQUEST ST_FIRMWARE_RESPONSE
        ST_SOUND ST_IMAGE };

sub datastreamTypeToStr($) {
  (datastreamTypes)[shift];
}

#-- Payload types
use constant {
  P_STRING  => 0,
  P_BYTE    => 1,
  P_INT16   => 2,
  P_UINT16  => 3,
  P_LONG32  => 4,
  P_ULONG32 => 5,
  P_CUSTOM  => 6,
};

use constant payloadTypes => qw{ P_STRING P_BYTE P_INT16 P_UINT16 P_LONG32 P_ULONG32 P_CUSTOM };

sub payloadTypeToStr($) {
  (payloadTypes)[shift];
}

sub subTypeToStr($$) {
  my $cmd = shift;
  my $subType = shift;
  # Convert subtype to string, depending on message type
  TYPE: {
    $cmd == C_PRESENTATION and do {
      $subType = (sensorTypes)[$subType];
      last;
    };
    $cmd == C_SET and do {
      $subType = (variableTypes)[$subType];
      last;
    };
    $cmd == C_REQ and do {
      $subType = (variableTypes)[$subType];
      last;
    };
    $cmd == C_INTERNAL and do {
      $subType = (internalMessageTypes)[$subType];
      last;
    };
    $subType = "<UNKNOWN_$subType>";
  } 
  return $subType;
}

use Exporter ('import');
@EXPORT = ();
@EXPORT_OK = (
  commands,
  variableTypes,
  internalMessageTypes,
  sensorTypes,
  datastreamTypes,
  payloadTypes,
  qw(commandToStr
    variableTypeToStr
    variableTypeToIdx
    internalMessageTypeToStr
    sensorTypeToStr
    sensorTypeToIdx
    datastreamTypeToStr
    payloadTypeToStr
    subTypeToStr
    commands
    variableTypes
    internalMessageTypes
    sensorTypes
    datastreamTypes
    payloadTypes
  ));

%EXPORT_TAGS = (all => [@EXPORT_OK]);

1;


Jetzt gibt es nur noch 2 Warnungen:


2015.09.11 11:38:25 1: PERL WARNING: Terminating on signal SIGHUP(1)
2015.09.11 11:38:31 1: starting in console mode
2015.09.11 11:38:31 1: Including fhem.cfg
2015.09.11 11:38:31 3: telnetPort: port 7072 opened
2015.09.11 11:38:31 3: WEB: port 8083 opened
2015.09.11 11:38:31 3: WEBphone: port 8084 opened
2015.09.11 11:38:31 3: WEBtablet: port 8085 opened
2015.09.11 11:38:31 2: eventTypes: loaded 0 events from ./log/eventTypes.txt
Use of uninitialized value in anonymous hash ({}) at ./FHEM/10_MYSENSORS_DEVICE.pm line 193, <$fh> line 38.
Use of uninitialized value in anonymous hash ({}) at ./FHEM/10_MYSENSORS_DEVICE.pm line 194, <$fh> line 38.
2015.09.11 11:38:31 1: Including ./log/fhem.save
2015.09.11 11:38:31 3: No I/O device found for MYSENSOR_102
2015.09.11 11:38:31 3: initialUsbCheck return value: This command is not yet supported on windows
2015.09.11 11:38:31 2: SecurityCheck:  WEB,WEBphone,WEBtablet has no basicAuth attribute. telnetPort has no password/globalpassword attribute.  Restart FHEM for a new check if the problem is fixed, or set the global attribute motd to none to supress this message.
2015.09.11 11:38:31 0: Featurelevel: 5.6
2015.09.11 11:38:31 0: Server started with 10 defined entities (version $Id: fhem.pl 9163 2015-08-30 07:57:51Z rudolfkoenig $, os MSWin32, user PCE Pilot, pid 3284)
Raspberry Pi 3 | miniCUL 433MHz | nanoCUL 868 MHz | nanoCUL 433 MHz | MySensors WLAN Gateway | LaCrosse WLAN Gateway | SignalESP 433 MHz | SignalESP 868 MHz | HM-MOD-UART WLAN Gateway | IR - 360 Grad WLAN Gateway

Hauswart

Zitat von: gloob am 11 September 2015, 13:49:17
Hallo

Nachdem ich jetzt die Constants.pm wie folgt angepasst habe scheint es FAST zu gehen

Änderung:

package Device::MySensors::Constants;

use List::Util qw(first);

#-- Message types
use constant {
  C_PRESENTATION => 0,
  C_SET          => 1,
  C_REQ          => 2,
  C_INTERNAL     => 3,
  C_STREAM       => 4,
};

use constant commands => qw( C_PRESENTATION C_SET C_REQ C_INTERNAL C_STREAM );

sub commandToStr($) {
  (commands)[shift];
}

#-- Variable types
use constant {
  V_TEMP        => 0,
  V_HUM         => 1,
  V_LIGHT       => 2,
  V_DIMMER      => 3,
  V_PRESSURE    => 4,
  V_FORECAST    => 5,
  V_RAIN        => 6,
  V_RAINRATE    => 7,
  V_WIND        => 8,
  V_GUST        => 9,
  V_DIRECTION   => 10,
  V_UV          => 11,
  V_WEIGHT      => 12,
  V_DISTANCE    => 13,
  V_IMPEDANCE   => 14,
  V_ARMED       => 15,
  V_TRIPPED     => 16,
  V_WATT        => 17,
  V_KWH         => 18,
  V_SCENE_ON    => 19,
  V_SCENE_OFF   => 20,
  V_HEATER      => 21,
  V_HEATER_SW   => 22,
  V_LIGHT_LEVEL => 23,
  V_VAR1        => 24,
  V_VAR2        => 25,
  V_VAR3        => 26,
  V_VAR4        => 27,
  V_VAR5        => 28,
  V_UP          => 29,
  V_DOWN        => 30,
  V_STOP        => 31,
  V_IR_SEND     => 32,
  V_IR_RECEIVE  => 33,
  V_FLOW        => 34,
  V_VOLUME      => 35,
  V_LOCK_STATUS => 36,
  V_DUST_LEVEL => 37,
  V_VOLTAGE     => 38,
  V_CURRENT     => 39,
  V_RGB      => 40,
  V_LEVEL      => 41,
  V_STATUS      => 42,
  V_RGBW => 43,
  V_PERCENTAGE => 44,
  V_ID => 45,
  V_UNIT_PREFIX => 46,
  V_HVAC_SETPOINT_HEAT => 47,
  V_HVAC_SETPOINT_COLD => 48,
  V_HVAC_FLOW_STATE => 49,
  V_HVAC_FLOW_MODE => 50,
  V_HVAC_SPEED => 51,
 
 
};

use constant variableTypes => qw{ V_TEMP V_HUM V_LIGHT V_DIMMER V_PRESSURE V_FORECAST V_RAIN
        V_RAINRATE V_WIND V_GUST V_DIRECTION V_UV V_WEIGHT V_DISTANCE
        V_IMPEDANCE V_ARMED V_TRIPPED V_WATT V_KWH V_SCENE_ON V_SCENE_OFF
        V_HEATER V_HEATER_SW V_LIGHT_LEVEL V_VAR1 V_VAR2 V_VAR3 V_VAR4 V_VAR5
        V_UP V_DOWN V_STOP V_IR_SEND V_IR_RECEIVE V_FLOW V_VOLUME V_LOCK_STATUS
        V_DUST_LEVEL V_VOLTAGE V_CURRENT V_RGB V_LEVEL V_STATUS V_RGBW V_PERCENTAGE V_ID
V_UNIT_PREFIX V_HVAC_SETPOINT_HEAT V_HVAC_SETPOINT_COLD V_HVAC_FLOW_STATE V_HVAC_FLOW_MODE
V_HVAC_SPEED};

sub variableTypeToStr($) {
  (variableTypes)[shift];
}

sub variableTypeToIdx($) {
  my $var = shift;
  return first { (variableTypes)[$_] eq $var } 0 .. scalar(variableTypes);
}

#-- Internal messages
use constant {
  I_BATTERY_LEVEL    => 0,
  I_TIME             => 1,
  I_VERSION          => 2,
  I_ID_REQUEST       => 3,
  I_ID_RESPONSE      => 4,
  I_INCLUSION_MODE   => 5,
  I_CONFIG           => 6,
  I_PING             => 7,
  I_PING_ACK         => 8,
  I_LOG_MESSAGE      => 9,
  I_CHILDREN         => 10,
  I_SKETCH_NAME      => 11,
  I_SKETCH_VERSION   => 12,
  I_REBOOT           => 13,
  I_STARTUP_COMPLETE => 14.
};

use constant internalMessageTypes => qw{ I_BATTERY_LEVEL I_TIME I_VERSION I_ID_REQUEST I_ID_RESPONSE
        I_INCLUSION_MODE I_CONFIG I_PING I_PING_ACK
        I_LOG_MESSAGE I_CHILDREN I_SKETCH_NAME I_SKETCH_VERSION
        I_REBOOT I_STARTUP_COMPLETE };

sub internalMessageTypeToStr($) {
  (internalMessageTypes)[shift];
}

#-- Sensor types
use constant {
  S_DOOR                  => 0,
  S_MOTION                => 1,
  S_SMOKE                 => 2,
  S_LIGHT                 => 3,
  S_DIMMER                => 4,
  S_COVER                 => 5,
  S_TEMP                  => 6,
  S_HUM                   => 7,
  S_BARO                  => 8,
  S_WIND                  => 9,
  S_RAIN                  => 10,
  S_UV                    => 11,
  S_WEIGHT                => 12,
  S_POWER                 => 13,
  S_HEATER                => 14,
  S_DISTANCE              => 15,
  S_LIGHT_LEVEL           => 16,
  S_ARDUINO_NODE          => 17,
  S_ARDUINO_REPEATER_NODE => 18,
  S_LOCK                  => 19,
  S_IR                    => 20,
  S_WATER                 => 21,
  S_AIR_QUALITY           => 22,
  S_CUSTOM                => 23,
  S_DUST                  => 24,
  S_SCENE_CONTROLLER      => 25,
  S_RGB_LIGHT             => 26,
  S_RGBW_LIGHT            => 27,
  S_COLOR_SENSOR          => 28,
  S_HVAC                  => 29,
  S_MULTIMETER            => 30,
  S_SPRINKLER             => 31,
  S_WATER_LEAK            => 32,
  S_SOUND                 => 33,
  S_VIBRATION             => 34,
  S_MOISTURE              => 35,
};

use constant sensorTypes => qw{ S_DOOR S_MOTION S_SMOKE S_LIGHT S_DIMMER S_COVER S_TEMP S_HUM S_BARO S_WIND
        S_RAIN S_UV S_WEIGHT S_POWER S_HEATER S_DISTANCE S_LIGHT_LEVEL S_ARDUINO_NODE
        S_ARDUINO_REPEATER_NODE S_LOCK S_IR S_WATER S_AIR_QUALITY S_CUSTOM S_DUST S_SCENE_CONTROLLER
S_RGB_LIGHT S_RGBW_LIGHT S_COLOR_SENSOR S_HVAC S_MULTIMETER S_SPRINKLER S_WATER_LEAK S_SOUND
S_VIBRATION S_MOISTURE};

sub sensorTypeToStr($) {
  (sensorTypes)[shift];
}

sub sensorTypeToIdx($) {
  my $var = shift;
  return first { (sensorTypes)[$_] eq $var } 0 .. scalar(sensorTypes);
}

#-- Datastream types
use constant {
  ST_FIRMWARE_CONFIG_REQUEST  => 0,
  ST_FIRMWARE_CONFIG_RESPONSE => 1,
  ST_FIRMWARE_REQUEST         => 2,
  ST_FIRMWARE_RESPONSE        => 3,
  ST_SOUND                    => 4,
  ST_IMAGE                    => 5,
};

use constant datastreamTypes => qw{ ST_FIRMWARE_CONFIG_REQUEST ST_FIRMWARE_CONFIG_RESPONSE ST_FIRMWARE_REQUEST ST_FIRMWARE_RESPONSE
        ST_SOUND ST_IMAGE };

sub datastreamTypeToStr($) {
  (datastreamTypes)[shift];
}

#-- Payload types
use constant {
  P_STRING  => 0,
  P_BYTE    => 1,
  P_INT16   => 2,
  P_UINT16  => 3,
  P_LONG32  => 4,
  P_ULONG32 => 5,
  P_CUSTOM  => 6,
};

use constant payloadTypes => qw{ P_STRING P_BYTE P_INT16 P_UINT16 P_LONG32 P_ULONG32 P_CUSTOM };

sub payloadTypeToStr($) {
  (payloadTypes)[shift];
}

sub subTypeToStr($$) {
  my $cmd = shift;
  my $subType = shift;
  # Convert subtype to string, depending on message type
  TYPE: {
    $cmd == C_PRESENTATION and do {
      $subType = (sensorTypes)[$subType];
      last;
    };
    $cmd == C_SET and do {
      $subType = (variableTypes)[$subType];
      last;
    };
    $cmd == C_REQ and do {
      $subType = (variableTypes)[$subType];
      last;
    };
    $cmd == C_INTERNAL and do {
      $subType = (internalMessageTypes)[$subType];
      last;
    };
    $subType = "<UNKNOWN_$subType>";
  } 
  return $subType;
}

use Exporter ('import');
@EXPORT = ();
@EXPORT_OK = (
  commands,
  variableTypes,
  internalMessageTypes,
  sensorTypes,
  datastreamTypes,
  payloadTypes,
  qw(commandToStr
    variableTypeToStr
    variableTypeToIdx
    internalMessageTypeToStr
    sensorTypeToStr
    sensorTypeToIdx
    datastreamTypeToStr
    payloadTypeToStr
    subTypeToStr
    commands
    variableTypes
    internalMessageTypes
    sensorTypes
    datastreamTypes
    payloadTypes
  ));

%EXPORT_TAGS = (all => [@EXPORT_OK]);

1;


Jetzt gibt es nur noch 2 Warnungen:

Sorry die Datei hatte ich ganz übersehen. Probiere mal: https://raw.githubusercontent.com/Kolbi/fhem-mirror/patch-1/fhem/FHEM/lib/Device/MySensors/Constants.pm
1. Installation:
KNX, Tasmota (KNX), Sonos, Unifi

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

fh168

Hallo Gemeinde,

wie versprochen habe ich mir das Gateway mit dem ESP12 mal nachgebaut.

Die Arduino Konsole gibt folgendes aus.

ESP8266 MySensors Gateway
Connecting to DerNetteNachbar
................................Connected!
IP: 192.168.178.42
0;0;3;0;9;gateway started, id=0, parent=0, distance=0
0;0;3;0;9;read: 100-100-0 s=3,c=1,t=16,pt=2,l=2,sg=0:1
100;3;1;0;16;1


und in fhem:

DEF
192.168.178.42:5003
DeviceName
192.168.178.42:5003
FD
66
NAME
gateway
NOTIFYDEV
global
NR
33
NTFY_ORDER
50-gateway
PARTIAL
STATE
startup complete
TYPE
MYSENSORS
ack
1
inclusion-mode
0
outstandingAck
0
version
1.4.1
Readings
connection
startup complete
2015-09-12 21:18:55
state
opened
2015-09-12 21:18:55


ich habe die IP in Fhem auch eingetragen, jedoch werden die Sensoren nicht erkannt.
Frage: ist der Sketch für die 1.5er Version

gibt es da sonst noch was zu beachten?

LG
/robin
Hue, Lacrosse, PCA301, MySensors, V 1.67 CUL 868 V3.4, Lacrosse-WLAN-Gateway, Tasmota RF-

hexenmeister

was heißt nicht erkannt? Hast Du sie angelegt und dein gateway als io eingetragen?
Zur Version: wenn Du mit 1.5-lib kompiliert hast, dann ist auch sketch 1.5.
Signierung wird jedoch (noch?) nicht unterstützt.
Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy

fh168

ich hatte meine mysensors mit dem lan gateway laufen.
jetzt habe ich einfach nur in den defs die ip geändert und neu gestartet.
die vorhandenen sensoren werden da nicht empfangen
Hue, Lacrosse, PCA301, MySensors, V 1.67 CUL 868 V3.4, Lacrosse-WLAN-Gateway, Tasmota RF-

hexenmeister

Doch, werden aber ignoriert. Es werden nur diejenigen von einem Gateway berücksichtigt, die diesen als io eingetragen haben.
Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy

hexenmeister

Zitat von: Peter_64 am 11 September 2015, 11:25:12
das Problem mit den Abbrüchen LAN Gateway habe ich auch. Welche Befehle startest Du mit Deinem at genau ?

Ist recht primitiv:
define trigger_ms_reconnect at +*00:01:00 set mysensors_lan connect
Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy

fh168

#403
Am ioDEV habe ich nichts geändert, heißt bei mir immer noch "gateway". Lediglich das alte Gateway habe ich auf disconneted gestellt, in den DEFS die neue IP vom WLAN-Gateway eingetragen und in Fhem abgespeichert.

Ich habe mal den softwaremäßigen inclusion mode eingeschaltet. Kann es sein, das die sensoren alle eine neue Kanal - ID bekommen haben?
Ich sehe am Blinken der WLAN-Diode auf dem ESP-12 das da was gesendet / empfangen wird, jedoch beim fhem kommt nix an.

Mein log in fhem mit verbose 5 schweigt sich auch aus.

2015.09.13 09:05:18 1: 192.168.178.42:5003 disconnected, waiting to reappear (gateway)
2015.09.13 09:05:20 1: 192.168.178.42:5003 reappeared (gateway)
2015.09.13 09:05:20 5: MYSENSORS send: Rx: fr=000 ci=000 c=003(C_INTERNAL    ) st=002(I_VERSION       ) ack=0 ''

2015.09.13 09:05:20 5: SW: 303b303b333b303b323b0a
2015.09.13 09:05:20 5: MYSENSORS/RAW: /0;0;3;0;14;Gateway startup complete.

2015.09.13 09:05:20 5: MYSENSORS Read: Rx: fr=000 ci=000 c=003(C_INTERNAL    ) st=014(I_STARTUP_COMPLETE) ack=0 'Gateway startup complete.'

sending systemCode[10011] unitCode[5] command[1]
sending systemCode[10011] unitCode[5] command[1]
sending systemCode[10011] unitCode[5] command[1]


telnet
Last login: Sun Sep 13 17:28:43 on ttys000
MacBookPro:~ Robin$ telnet 192.168.178.42 5003
Trying 192.168.178.42...
Connected to esp826601.fritz.box.
Escape character is '^]'.
0;0;3;0;14;Gateway startup complete.
103;1;1;0;23;128
100;3;1;0;16;0
100;3;1;0;16;1
1;0;1;0;23;102
100;3;1;0;16;0
1;0;1;0;23;103
1;0;1;0;23;75
100;3;1;0;16;1
1;0;1;0;23;75


im Telnet kommt alles an, nur in Fhem wird der Status nicht aktualisiert.
Hue, Lacrosse, PCA301, MySensors, V 1.67 CUL 868 V3.4, Lacrosse-WLAN-Gateway, Tasmota RF-

hexenmeister

So genau habe ich es nicht getestet. Im Telnet sehen die Ausgaben gut aus, FHEM schlücht das auch. Evtl. ein Problem mit 'line endings'. Ich muss mir das die tage genauer ansehen.
Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy