Integration von MySensors in FHEM geplant?

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

Vorheriges Thema - Nächstes Thema

r_knipp

Zitat von: Beta-User am 13 Juni 2016, 13:37:08
Ein Beispiel (insbes. Post 5 und 6 (evtl. auch 4, der aber nur raw-Infos aufzählt)): http://www.remotecentral.com/cgi-bin/mboard/rc-discrete/thread.cgi?7297. Dort gibt es auch dezidierte Codes für "on" und "off".
Ach, das ist ja cool. Besten Dank für den Tip. Werde das mal ausprobieren.

torte

Hallo zusammen,

Vielen Dank.

Habe jetzt auf dem NodeMCU Wlan Gateway die MySensors Beta Library 2.0.0. Der TürSensor meldet nun wunderbar on off  :).

Habe aber zwei fragen.
1.)Angefangen hatte ich mit dem Sketch von Hexenmeister v1.0.1 und MySensors Library 1.5.4, beim kompilieren mit diesem Sketch kommt
es aber zu einem Fehler. Habe dann einfach den Mysensors GatewayESP8266 Sketch genommen mit diesem ging es dann ohne Probleme.
Ist das so okey? Weiß nicht ganz wofür die Anpassungen von Hexenmeister waren/sind.

2.)Wenn ich das Gateway vom Strom trenne und wieder verbinde, muss ich in FHEM erst beim Gateway auf Set Connect klicken damit
die Sensoren funktionieren, soll das so?

Vielen Dank noch mal für die freundliche Hilfe.

Schöne Grüße
Torte

hexenmeister

Zitat von: torte am 13 Juni 2016, 17:43:00
1.)Angefangen hatte ich mit dem Sketch von Hexenmeister v1.0.1 und MySensors Library 1.5.4, beim kompilieren mit diesem Sketch kommt
es aber zu einem Fehler. Habe dann einfach den Mysensors GatewayESP8266 Sketch genommen mit diesem ging es dann ohne Probleme.
Ist das so okey? Weiß nicht ganz wofür die Anpassungen von Hexenmeister waren/sind.
In der alten Version waren Zeilenumbrüche so, dass FHEM diese nicht verstand. In der neueren scheint auch so zu gehen.

Zitat von: torte am 13 Juni 2016, 17:43:00
2.)Wenn ich das Gateway vom Strom trenne und wieder verbinde, muss ich in FHEM erst beim Gateway auf Set Connect klicken damit
die Sensoren funktionieren, soll das so?
FHEM verbindet sich nicht zwischendurch von alleine mit dem Gateway. Du kannst das aber z.B. per AT-Befehl tun.
Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy

torte

Hallo Hexenmeiser, hallo alle anderen  :D

vielen Dank für die Erklärung.

AT habe ich bei mir jetzt eingerichtet, so das bei einem Fhemstart der Connect durchgeführt wird. Da bei mir das Gateway an der selben Stromquelle hängt wie der Raspi
reicht das ja dann so bei mir.(Wegen evtl. Stromausfall)

Danke an alle für die Aufklärung und Hilfe.

Grüße
Torte

hexenmeister

Bei FHEM-Start brauchst Du eigentlich keinen Connect, dieser passiert einmalig automatisch. Ein Neu-Connect brauchst du dann, wenn Gateway im laufenden Betrieb neugestartet wird.
Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy

torte

Noch besser  :) Hatte das so (Fhem neustart) nicht ausprobiert. Danke!

Beta-User

Zitat von: torte am 14 Juni 2016, 07:37:22
Da bei mir das Gateway an der selben Stromquelle hängt wie der Raspi
reicht das ja dann so bei mir.(Wegen evtl. Stromausfall)

Hallo torte,

eine Frage interessehalber: wenn sich beide Geräte in unmittelbarer Nähe zueinander befinden, warum verwendest Du dann ein WLAN-GW und kein serielles? Planst Du den ESP8266/NodeMCU zukünftig auch als MQTT-Broker zu nutzen, oder hattest Du ihn einfach daliegen bzw. gerade keinen Arduino zur Hand?
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

torte

Hi Beta-User,

das NodeMCU ist zur Zeit bei mir neben dem Raspi (oben im Büro, Speicher) an der Steckerleiste ich plane aber die Sensoren im ganzen Haus zu verteilen
(nach und nach) und da hab ich mir gedacht ist es am besten wenn ich das Gateway später dann in der Mitte des Hauses
je nach Empfangslage platziere. Da fand ich das WLan Gateway als beste Möglichkeit.

Auf die Sachen mit dem MQTT und Easy ESP bin ich gestern erst gestoßen, als ich mich nach dem MySensors Beta umgeschaut habe.
Da muss ich mich aber erstmal schlau machen, hab das noch nicht ganz geblickt, wie das mit den Sensoren usw. läuft.

Grüße
Torte

Beta-User

Zitat von: torte am 14 Juni 2016, 08:54:23
Hi Beta-User,

das NodeMCU ist zur Zeit bei mir neben dem Raspi (oben im Büro, Speicher) an der Steckerleiste ich plane aber die Sensoren im ganzen Haus zu verteilen
(nach und nach) und da hab ich mir gedacht ist es am besten wenn ich das Gateway später dann in der Mitte des Hauses
je nach Empfangslage platziere. Da fand ich das WLan Gateway als beste Möglichkeit.

Auf die Sachen mit dem MQTT und Easy ESP bin ich gestern erst gestoßen, als ich mich nach dem MySensors Beta umgeschaut habe.
Da muss ich mich aber erstmal schlau machen, hab das noch nicht ganz geblickt, wie das mit den Sensoren usw. läuft.

Grüße
Torte

OK, das ist plausibel mit der Funkabdeckung, den Gedanken hatte ich früher auch mal.
Andererseits könntest Du als Alternative dazu auch bei Bedarf eine/mehrere der Nodes als Repeater definieren (die dürfen halt nicht schlafen). Das mache ich im Moment so mit meinen "Keller"-Nodes, da hat eine einen NRF+ mit externer Antenne und bindet den Rest im UG/Außenbereich an, allerdings sind es noch nicht viele Nodes (dafür aber idR. mehrere Sensoren pro Node).

Wenn Du kein MQTT nutzen möchtest bzw. brauchst, halte ich den Weg über die Repeater und einem seriellen GW mittlerweile für robuster: (Jedenfalls bei mir) sind weniger Geräte in die gesamte Übertragungsstrecke eingebunden (mein WLAN macht die FB, und ich hätte auch Skrupel, den Sensorik-Teil über dasselbe WLAN-Netz laufen zu lassen wie den "normalen" Datenverkehr). Dazu müßte ich aber meinen RPi tauschen bzw. aufrüsten und konfigurieren, und das ist mir im Moment schlicht zu viel, obwohl auch das sicher keine große Sache wäre...

Grundsätzlich hatte ich das große Problem, dass ich die NRF+ überschätzt habe, was die Funkabdeckung angeht, aber dazu gibt es u.A. hier im Forum mittlerweile einige interessante Tipps, wie man dem beikommen kann (wenn auch nicht alle erprobt zu sein scheinen).  8)
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

LastActionHero

Hier, ich hab mal eine Frage, ich habe mir alles an Material für die MySensors geschichten gekauft und versuche gerade leidlich die Software zu installieren. Ich bekomme nichtmal den Gateway ans laufen...

Ich habe arduino IDE und die libaries (MySensors 2.0 und 1.5, beides jeweils einzeln versucht) installiert, die werden auch alle korrekt erkannt und im IDE angezeigt.
Ich habe einen Arduino UNO mit W5100 Ethernet Shield und einem NRF24L01.

Wenn ich den Scetch von der MySensors Homepage nehme, alles so verkabel wie auf der homepage geschrieben bekomme ich beim kompilieren ständig die fehlermeldung MySigningNone.h: No such file or directory. quottiere ich das aus, gehts mit der nächsten datei weiter die im include steht.

nehme ich in der IDE den beispiel sketch für Ethernet Gateway, klappt das hochladen, aber die verkabelung wie auf der webseite geschrieben stimmt nicht und im serial monitor kommt nur kauderwelsch. passe ich die pins im sketch an (Der uno hat ja keinen pin 16),  erhalte ich folgenden Fehlercode

Zitat0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
0;255;3;0;9;TSM:INIT
0;255;3;0;9;TSM:RADIO:OK
0;255;3;0;9;TSM:GW MODE
0;255;3;0;9;TSM:READY
IP: 192.168.5.223
0;255;3;0;9;No registration required
0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
0;255;3;0;9;TSP:MSG:READ 0-0-0 s=0,c=0,t=0,pt=0,l=0,sg=0:
0;255;3;0;9;!TSP:MSG:PVER mismatch
0;255;3;0;9;TSP:MSG:READ 0-0-0 s=0,c=0,t=0,pt=0,l=0,sg=0:
0;255;3;0;9;!TSP:MSG:PVER mismatch
0;255;3;0;9;TSP:MSG:READ 0-0-0 s=0,c=0,t=0,pt=0,l=0,sg=0:

weiß da jemand weiter?  :(

LastActionHero

Hat sich erledigt, kabel waren doch falsch angepinnt... Schande über mich...

Ranseyer

#821
Ich könnte einen Tipp gebrauchen zu diesen Einträgen im FHEM Log:

Zitat2016.07.21 15:00:13 3: MYSENSORS: ignoring internal-msg from unknown radioId 101, childId 255 for
2016.07.21 15:00:19 3: MYSENSORS: ignoring internal-msg from unknown radioId 101, childId 255 for
2016.07.21 15:00:25 3: MYSENSORS: ignoring internal-msg from unknown radioId 101, childId 255 for
2016.07.21 15:00:31 3: MYSENSORS: ignoring internal-msg from unknown radioId 101, childId 255 for
2016.07.21 15:01:22 3: MYSENSORS: ignoring internal-msg from unknown radioId 101, childId 255 for
2016.07.21 15:01:33 3: MYSENSORS: ignoring internal-msg from unknown radioId 101, childId 255 for

Ich bin dazu zurück auf einen fertigen Stand eines Sensors:
/**
* The MySensors Arduino library handles the wireless radio link and protocol
* between your home built sensors/actuators and HA controller of choice.
* The sensors forms a self healing radio network with optional repeaters. Each
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
* network topology allowing messages to be routed to nodes.
*
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
*
* Documentation: http://www.mysensors.org
* Support Forum: http://forum.mysensors.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
*******************************
*
* REVISION HISTORY
* Version 1.0 - Henrik Ekblad
*
* DESCRIPTION
* Weather station sensor example using BMP085 and DHT-11 or DHT-22 module
* http://www.mysensors.org/build/pressure
* http://www.mysensors.org/build/humidity
*
* WIRING
* DHT Sensor
* PIN2 D3 Arduino
* 10k resistor between PIN1 and PIN2
*
* BMP Sensor
* SCL A5 Arduino
* SDA A4 Arduino
*/

// Enable debug prints to serial monitor
//#define MY_DEBUG

// Enable and select radio type attached
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69

#include <SPI.h>
#include <MySensors.h>

#include <Wire.h>
#include <Adafruit_BMP085.h>
#include <DHT.h> 
#include <BH1750.h>



// Set this to true if you want to send values altough the values did not change.
// This is only recommended when not running on batteries.
const bool SEND_ALWAYS = true;

// Adapt this constant: set it to the altitude above sealevel at your home location.
const float SEALEVEL = 688; // meters above sealevel

// Constant for the world wide average pressure
const float SEALEVEL_PRESSURE = 1013.25;

// ----------------------------------------------------------------------------
// Child sensor ids
#define CHILD_ID_BARO 0
#define CHILD_ID_TEMP1 1
#define CHILD_ID_HUM 2
#define CHILD_ID_TEMP2 3

// ----------------------------------------------------------------------------
// DHT-11/22
#define HUMIDITY_SENSOR_DIGITAL_PIN 3

DHT dht;
float lastTemp;
float lastHum;
boolean metric = true;
MyMessage msgHum(CHILD_ID_HUM, V_HUM);
MyMessage msgTemp(CHILD_ID_TEMP2, V_TEMP);

// ----------------------------------------------------------------------------
// BMP085
unsigned long SLEEP_TIME1 = 30000; // 1 minute required for forecast algorithm
unsigned long SLEEP_TIME2 = 30000; // 1 minute required for forecast algorithm

Adafruit_BMP085 bmp = Adafruit_BMP085();    // Digital Pressure Sensor


/*
DP/Dt explanation
0 = "Stable Weather Pattern"
1 = "Slowly rising Good Weather", "Clear/Sunny "
2 = "Slowly falling L-Pressure ", "Cloudy/Rain "
3 = "Quickly rising H-Press",     "Not Stable"
4 = "Quickly falling L-Press",    "Thunderstorm"
5 = "Unknown (More Time needed)
*/

const char *weatherStrings[] = { "stable", "sunny", "cloudy", "unstable", "thunderstorm", "unknown" };
enum FORECAST
{
  STABLE = 0,     // Stable weather
  SUNNY = 1,      // Slowly rising HP stable good weather
  CLOUDY = 2,     // Slowly falling Low Pressure System, stable rainy weather
  UNSTABLE = 3,   // Quickly rising HP, not stable weather
  THUNDERSTORM = 4, // Quickly falling LP, Thunderstorm, not stable
  UNKNOWN = 5     // Unknown, more time needed
};

const char *situationStrings[] = { "very low", "low", "normal", "high", "very high" };
enum WEATHER_SITUATION
{
  VERY_LOW_PRESSURE = 0,    // p > -7.5hPa
  LOW_PRESSURE = 1,     // p > -2.5hPa
  NORMAL_PRESSURE = 2,    // p < +/-2.5hPa 
  HIGH_PRESSURE = 3,      // p > +2.5hPa
  VERY_HIGH_PRESSURE = 4,   // p > +7.5hPa
};

float lastPressure = -1;
float lastPressureTemp = -1;
int lastForecast = -1;
int lastSituation = NORMAL_PRESSURE;

const int LAST_SAMPLES_COUNT = 5;
float lastPressureSamples[LAST_SAMPLES_COUNT];

// get kPa/h be dividing hPa by 10
#define CONVERSION_FACTOR (1.0/10.0)

int minuteCount = 0;
bool firstRound = true;

// average value is used in forecast algorithm.
float pressureAvg;
// average after 2 hours is used as reference value for the next iteration.
float pressureAvg2;
float dP_dt;

MyMessage tempMsg(CHILD_ID_TEMP1, V_TEMP);
MyMessage pressureMsg(CHILD_ID_BARO, V_PRESSURE);
MyMessage forecastMsg(CHILD_ID_BARO, V_FORECAST);
MyMessage situationMsg(CHILD_ID_BARO, V_VAR1);
MyMessage forecastMsg2(CHILD_ID_BARO, V_VAR2);


void initPressureSensor()
{
  if (!bmp.begin())
  {
    Serial.println(F("Could not find a valid BMP085 sensor, check wiring!"));
    while (1) {}
  }
}

void initHumiditySensor()
{
  dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN);
}

void setup()
{
  initPressureSensor();
  initHumiditySensor();
  metric = getConfig().isMetric;
}

void presentation()
{
  sendSketchInfo("Weather Station Sensor", "1.0");

  present(CHILD_ID_BARO, S_BARO);
  present(CHILD_ID_TEMP1, S_TEMP);
  present(CHILD_ID_HUM, S_HUM);
  present(CHILD_ID_TEMP2, S_TEMP);
}

int getWeatherSituation(float pressure)
{
  int situation = NORMAL_PRESSURE;

  float delta = pressure - SEALEVEL_PRESSURE;
  if (delta > 7.5)
  {
    situation = VERY_HIGH_PRESSURE;
  }
  else if (delta > 2.5)
  {
    situation = HIGH_PRESSURE;
  }
  else if (delta < -7.5)
  {
    situation = VERY_LOW_PRESSURE;
  }
  else if (delta < -2.5)
  {
    situation = LOW_PRESSURE;
  }
  else
  {
    situation = NORMAL_PRESSURE;
  }

  return situation;
}

// The BMP provides a temperature value, too!
bool updatePressureSensor()
{
  bool changed = false;

  //sealevel pressure p0 from absolute pressure.
  float pressure = bmp.readSealevelPressure(SEALEVEL) / 100.0;
  float temperature = bmp.readTemperature();
  if (!metric)
  {
    // Convert to fahrenheit
    temperature = temperature * 9.0 / 5.0 + 32.0;
  }

  int forecast = sample(pressure);
  int situation = getWeatherSituation(pressure);


  if (SEND_ALWAYS || (temperature != lastPressureTemp))
  {
    changed = true;
    lastPressureTemp = temperature;
    #ifdef MY_DEBUG
    Serial.print(F("Temperature = "));
    Serial.print(temperature);
    Serial.println(metric ? F(" *C") : F(" *F"));
    #endif
    if (!send(tempMsg.set(lastPressureTemp, 1)))
    {
      lastPressureTemp = -1.0;
    }
  }

  if (SEND_ALWAYS || (pressure != lastPressure))
  {
    changed = true;
    lastPressure = pressure;
    #ifdef MY_DEBUG
    Serial.print(F("sealevel Pressure = "));
    Serial.print(pressure);
    Serial.println(F(" hPa"));
    #endif
    if (!send(pressureMsg.set(lastPressure, 1)))
    {
      lastPressure = -1.0;
    }
  }

  if (SEND_ALWAYS || (forecast != lastForecast))
  {
    changed = true;
    lastForecast = forecast;
    #ifdef MY_DEBUG
    Serial.print(F("Forecast = "));
    Serial.println(weatherStrings[forecast]);
    #endif
    if (send(forecastMsg.set(weatherStrings[lastForecast])))
    {
      if (!send(forecastMsg2.set(lastForecast)))
      {
      }
    }
    else
    {
      lastForecast = -1.0;
    }
  }

  if (SEND_ALWAYS || (situation != lastSituation))
  {
    changed = true;
    lastSituation = situation;
    #ifdef MY_DEBUG
    Serial.print(F("Situation = "));
    Serial.println(situationStrings[situation]);
    #endif
    if (!send(situationMsg.set(lastSituation, 0)))
    {
      lastSituation = -1.0;
    }
  }


  return changed;
}

// The dht provides a temperature, too!
bool updateHumiditySensor()
{
  bool changed = false;

  float temperature = dht.getTemperature();
  float humidity = dht.getHumidity();

  if (!isnan(temperature))
  {
    if (SEND_ALWAYS || (temperature != lastTemp))
    {
      lastTemp = temperature;
      if (!metric)
      {
        temperature = dht.toFahrenheit(temperature);
      }

      changed = true;
      #ifdef MY_DEBUG
      Serial.print(F("T: "));
      Serial.println(temperature);
      #endif
      if (!send(msgTemp.set(temperature, 1)))
      {
        lastTemp = -1.0;
      }
    }
  }
  else
  {
    Serial.println(F("Failed reading temperature from DHT"));
  }
 
 
  if (!isnan(humidity))
  {
    if (SEND_ALWAYS || (humidity != lastHum))
    {
      lastHum = humidity;
      changed = true;
      #ifdef MY_DEBUG
      Serial.print(F("H: "));
      Serial.println(humidity);
      #endif
      if (!send(msgHum.set(lastHum, 1)))
      {
        lastHum = -1.0;
      }
    }
  }
  else
  {
    Serial.println(F("Failed reading humidity from DHT"));
  }
 
  return changed;
}

void loop()
{
  updatePressureSensor();
  sleep(SLEEP_TIME1);
  updateHumiditySensor();
  sleep(SLEEP_TIME2);
}


float getLastPressureSamplesAverage()
{
  float lastPressureSamplesAverage = 0;
  for (int i = 0; i < LAST_SAMPLES_COUNT; i++)
  {
    lastPressureSamplesAverage += lastPressureSamples[i];
  }

  lastPressureSamplesAverage /= LAST_SAMPLES_COUNT;

  // Uncomment when dubugging
  //Serial.print(F("### 5min-Average:"));
  //Serial.print(lastPressureSamplesAverage);
  //Serial.println(F(" hPa"));

  return lastPressureSamplesAverage;
}



// Algorithm found here
// http://www.freescale.com/files/sensors/doc/app_note/AN3914.pdf
// Pressure in hPa -->  forecast done by calculating kPa/h
int sample(float pressure)
{
  // Calculate the average of the last n minutes.
  int index = minuteCount % LAST_SAMPLES_COUNT;
  lastPressureSamples[index] = pressure;

  minuteCount++;
  if (minuteCount > 185)
  {
    minuteCount = 6;
  }

  if (minuteCount == 5)
  {
    pressureAvg = getLastPressureSamplesAverage();
  }
  else if (minuteCount == 35)
  {
    float lastPressureAvg = getLastPressureSamplesAverage();
    float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR;
    if (firstRound) // first time initial 3 hour
    {
      dP_dt = change * 2; // note this is for t = 0.5hour
    }
    else
    {
      dP_dt = change / 1.5; // divide by 1.5 as this is the difference in time from 0 value.
    }
  }
  else if (minuteCount == 65)
  {
    float lastPressureAvg = getLastPressureSamplesAverage();
    float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR;
    if (firstRound) //first time initial 3 hour
    {
      dP_dt = change; //note this is for t = 1 hour
    }
    else
    {
      dP_dt = change / 2; //divide by 2 as this is the difference in time from 0 value
    }
  }
  else if (minuteCount == 95)
  {
    float lastPressureAvg = getLastPressureSamplesAverage();
    float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR;
    if (firstRound) // first time initial 3 hour
    {
      dP_dt = change / 1.5; // note this is for t = 1.5 hour
    }
    else
    {
      dP_dt = change / 2.5; // divide by 2.5 as this is the difference in time from 0 value
    }
  }
  else if (minuteCount == 125)
  {
    float lastPressureAvg = getLastPressureSamplesAverage();
    pressureAvg2 = lastPressureAvg; // store for later use.
    float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR;
    if (firstRound) // first time initial 3 hour
    {
      dP_dt = change / 2; // note this is for t = 2 hour
    }
    else
    {
      dP_dt = change / 3; // divide by 3 as this is the difference in time from 0 value
    }
  }
  else if (minuteCount == 155)
  {
    float lastPressureAvg = getLastPressureSamplesAverage();
    float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR;
    if (firstRound) // first time initial 3 hour
    {
      dP_dt = change / 2.5; // note this is for t = 2.5 hour
    }
    else
    {
      dP_dt = change / 3.5; // divide by 3.5 as this is the difference in time from 0 value
    }
  }
  else if (minuteCount == 185)
  {
    float lastPressureAvg = getLastPressureSamplesAverage();
    float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR;
    if (firstRound) // first time initial 3 hour
    {
      dP_dt = change / 3; // note this is for t = 3 hour
    }
    else
    {
      dP_dt = change / 4; // divide by 4 as this is the difference in time from 0 value
    }
    pressureAvg = pressureAvg2; // Equating the pressure at 0 to the pressure at 2 hour after 3 hours have past.
    firstRound = false; // flag to let you know that this is on the past 3 hour mark. Initialized to 0 outside main loop.
  }

  int forecast = UNKNOWN;
  if (minuteCount < 35 && firstRound) //if time is less than 35 min on the first 3 hour interval.
  {
    forecast = UNKNOWN;
  }
  else if (dP_dt < (-0.25))
  {
    forecast = THUNDERSTORM;
  }
  else if (dP_dt > 0.25)
  {
    forecast = UNSTABLE;
  }
  else if ((dP_dt > (-0.25)) && (dP_dt < (-0.05)))
  {
    forecast = CLOUDY;
  }
  else if ((dP_dt > 0.05) && (dP_dt < 0.25))
  {
    forecast = SUNNY;
  }
  else if ((dP_dt >(-0.05)) && (dP_dt < 0.05))
  {
    forecast = STABLE;
  }
  else
  {
    forecast = UNKNOWN;
  }

  // Uncomment when dubugging
  // Serial.print(F("Forecast at minute "));
  // Serial.print(minuteCount);
  // Serial.print(F(" dP/dt = "));
  // Serial.print(dP_dt);
  // Serial.print(F("kPa/h --> "));
  // Serial.println(weatherStrings[forecast]);

  return forecast;
}


Inclusion Mode ist aktiviert.
MySensors ist auf Stand V2.0 Das Gateway ist etwas älter,

Das Device 101 gab es schon ein paar Mal. Allerdings habe ich die FHEM-Config dazu bewusst nicht gespeichert sondern FHEM neu gestartet ohne Speichern.
Beim Start von FHEM meint er:
Zitat2016.07.21 12:58:07 2: Messages collected while initializing FHEM: ./log/fhem.save: Please define MYSENSOR_101 first Please define MYSENSOR_101 first Please define MYSENSOR_101 first Please define MYSENSOR_101 first Please define MYSENSOR_101 first

Wenn ich allerding den Arduino vorher getestetnen Sernsors (mit Hexenmeisters Sketch) nehme sehe ich sofort das Device 101...


ed: Also vor allem die Frage ob das Problem in FHEM oder in der Firmware zu suchen ist...
FHEM mit FTUI. Homematic-Funk für Thermostate und Licht. MySensors als Basis für eigene HW.
Zentrale ist der MAPLE-CUL mit RFM69+HModUART-AddOn.
Doku zu meinen Projekten: Github/Ranseyer. Platinen falls verfügbar gerne auf Anfrage.
Support: gerne wenn ich Zeit+Lust habe im Forum. Nicht per PN!

Ranseyer

Da ich mySensors nicht dringend brauche (bis jetzt), habe ich das Gateway auch mal auf Stand V2 gebracht. Das Ergebnis war das selbe, der Sketch vom Hexenmeister funktioniert und der Sensor auf Basis mySensors 1.5 wird erkannt.

Mein (vorerst) unveränderter Sketch auf Basis V2 wird nicht erkannt.Statt dessen erhalte ich bei Verbose=5 folgende Logeinträge:
(Quelle für den Sketch:
2016.07.22 08:51:24 5: MYSENSORS/RAW: /0;255;3;0;5;0

2016.07.22 08:51:24 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=005(I_INCLUSION_MODE) ack=0 '0'

2016.07.22 08:51:24 5: MYSENSORS send: Rx: fr=000 ci=255 c=-01(''            ) st=005(''              ) ack=0 '1'

2016.07.22 08:51:24 5: SW: 303b3235353b2d313b303b353b310a
2016.07.22 08:51:29 5: MYSENSORS/RAW: /0;255;3;0;9;TSP:MSG:READ 101-101
2016.07.22 08:51:29 5: MYSENSORS/RAW: 0;255;3;0;9;TSP:MSG:READ 101-101/-255 s=255,c=3,t=7,pt=0,l=0,sg=0
2016.07.22 08:51:29 5: MYSENSORS/RAW: 0;255;3;0;9;TSP:MSG:READ 101-101-255 s=255,c=3,t=7,pt=0,l=0,sg=0/:
0;255;3;0;9;TSP:MSG:BC
0;255;3
2016.07.22 08:51:29 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'TSP:MSG:READ 101-101-255 s=255,c=3,t=7,pt=0,l=0,sg=0:'

2016.07.22 08:51:29 5: MYSENSORS gateway MySensGW: TSP:MSG:READ 101-101-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
2016.07.22 08:51:29 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'TSP:MSG:BC'

2016.07.22 08:51:29 5: MYSENSORS gateway MySensGW: TSP:MSG:BC
2016.07.22 08:51:29 5: MYSENSORS/RAW: 0;255;3/;0;9;TSP:MSG:FPAR REQ (sender=10
2016.07.22 08:51:29 5: MYSENSORS/RAW: 0;255;3;0;9;TSP:MSG:FPAR REQ (sender=10/1)
0;255;3;0;9;TSP:CHKUPL:OK
0;2
2016.07.22 08:51:29 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'TSP:MSG:FPAR REQ (sender=101)'

2016.07.22 08:51:29 5: MYSENSORS gateway MySensGW: TSP:MSG:FPAR REQ (sender=101)
2016.07.22 08:51:29 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'TSP:CHKUPL:OK'

2016.07.22 08:51:29 5: MYSENSORS gateway MySensGW: TSP:CHKUPL:OK
2016.07.22 08:51:29 5: MYSENSORS/RAW: 0;2/55;3;0;9;TSP:MSG:GWL OK

2016.07.22 08:51:29 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'TSP:MSG:GWL OK'

2016.07.22 08:51:29 5: MYSENSORS gateway MySensGW: TSP:MSG:GWL OK
2016.07.22 08:51:29 5: MYSENSORS/RAW: /0;255;3;0;9;TSP:MSG:SEND 0-0-101
2016.07.22 08:51:29 5: MYSENSORS/RAW: 0;255;3;0;9;TSP:MSG:SEND 0-0-101/-101 s=255,c=3,t=8,pt=1,l=1,sg=0
2016.07.22 08:51:29 5: MYSENSORS/RAW: 0;255;3;0;9;TSP:MSG:SEND 0-0-101-101 s=255,c=3,t=8,pt=1,l=1,sg=0/,ft=0,st=ok:0

2016.07.22 08:51:29 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'TSP:MSG:SEND 0-0-101-101 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=ok:0'

2016.07.22 08:51:29 5: MYSENSORS gateway MySensGW: TSP:MSG:SEND 0-0-101-101 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=ok:0
2016.07.22 08:51:31 5: MYSENSORS/RAW: /0;255;3;0;9;TSP:MSG:READ 101-101
2016.07.22 08:51:31 5: MYSENSORS/RAW: 0;255;3;0;9;TSP:MSG:READ 101-101/-0 s=255,c=3,t=24,pt=1,l=1,sg=0:
2016.07.22 08:51:31 5: MYSENSORS/RAW: 0;255;3;0;9;TSP:MSG:READ 101-101-0 s=255,c=3,t=24,pt=1,l=1,sg=0:/1
0;255;3;0;9;TSP:MSG:PINGED (ID
2016.07.22 08:51:31 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'TSP:MSG:READ 101-101-0 s=255,c=3,t=24,pt=1,l=1,sg=0:1'

2016.07.22 08:51:31 5: MYSENSORS gateway MySensGW: TSP:MSG:READ 101-101-0 s=255,c=3,t=24,pt=1,l=1,sg=0:1
2016.07.22 08:51:31 5: MYSENSORS/RAW: 0;255;3;0;9;TSP:MSG:PINGED (ID/=101, hops=1)

2016.07.22 08:51:31 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'TSP:MSG:PINGED (ID=101, hops=1)'

2016.07.22 08:51:31 5: MYSENSORS gateway MySensGW: TSP:MSG:PINGED (ID=101, hops=1)
2016.07.22 08:51:31 5: MYSENSORS/RAW: /0;255;3;0;9;TSP:MSG:SEND 0-0-101
2016.07.22 08:51:31 5: MYSENSORS/RAW: 0;255;3;0;9;TSP:MSG:SEND 0-0-101/-101 s=255,c=3,t=25,pt=1,l=1,sg=
2016.07.22 08:51:31 5: MYSENSORS/RAW: 0;255;3;0;9;TSP:MSG:SEND 0-0-101-101 s=255,c=3,t=25,pt=1,l=1,sg=/0,ft=0,st=ok:1

2016.07.22 08:51:31 5: MYSENSORS Read: Rx: fr=000 ci=255 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'TSP:MSG:SEND 0-0-101-101 s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=ok:1'

2016.07.22 08:51:31 5: MYSENSORS gateway MySensGW: TSP:MSG:SEND 0-0-101-101 s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=ok:1



Also habe ich nochmals genauer geforscht und herausgefunden dass mein Mustersketch nur dann funktioniert wenn alle Sensoren korrekt angeschlossen sind.
Das habe ich nun nachgeholt. Folge: Der Sensor wird von FHEM erkannt. (in meinen Augen schlechter Code, somit wird das eines der nächsten Themen sein)

Also ist meine Frage erst mal erledigt.
Ich könnte einen Tipp gebrauchen zu diesen Einträgen im FHEM Log:

Ich bin dazu zurück auf einen fertigen Stand eines Sensors:
/**
* The MySensors Arduino library handles the wireless radio link and protocol
* between your home built sensors/actuators and HA controller of choice.
* The sensors forms a self healing radio network with optional repeaters. Each
* repeater and gateway builds a routing tables in EEPROM which keeps track of the
* network topology allowing messages to be routed to nodes.
*
* Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
* Copyright (C) 2013-2015 Sensnology AB
* Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
*
* Documentation: http://www.mysensors.org
* Support Forum: http://forum.mysensors.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
*******************************
*
* REVISION HISTORY
* Version 1.0 - Henrik Ekblad
*
* DESCRIPTION
* Weather station sensor example using BMP085 and DHT-11 or DHT-22 module
* http://www.mysensors.org/build/pressure
* http://www.mysensors.org/build/humidity
*
* WIRING
* DHT Sensor
* PIN2 D3 Arduino
* 10k resistor between PIN1 and PIN2
*
* BMP Sensor
* SCL A5 Arduino
* SDA A4 Arduino
*/

// Enable debug prints to serial monitor
//#define MY_DEBUG

// Enable and select radio type attached
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69

#include <SPI.h>
#include <MySensors.h>

#include <Wire.h>
#include <Adafruit_BMP085.h>
#include <DHT.h> 
#include <BH1750.h>



// Set this to true if you want to send values altough the values did not change.
// This is only recommended when not running on batteries.
const bool SEND_ALWAYS = true;

// Adapt this constant: set it to the altitude above sealevel at your home location.
const float SEALEVEL = 688; // meters above sealevel

// Constant for the world wide average pressure
const float SEALEVEL_PRESSURE = 1013.25;

// ----------------------------------------------------------------------------
// Child sensor ids
#define CHILD_ID_BARO 0
#define CHILD_ID_TEMP1 1
#define CHILD_ID_HUM 2
#define CHILD_ID_TEMP2 3

// ----------------------------------------------------------------------------
// DHT-11/22
#define HUMIDITY_SENSOR_DIGITAL_PIN 3

DHT dht;
float lastTemp;
float lastHum;
boolean metric = true;
MyMessage msgHum(CHILD_ID_HUM, V_HUM);
MyMessage msgTemp(CHILD_ID_TEMP2, V_TEMP);

// ----------------------------------------------------------------------------
// BMP085
unsigned long SLEEP_TIME1 = 30000; // 1 minute required for forecast algorithm
unsigned long SLEEP_TIME2 = 30000; // 1 minute required for forecast algorithm

Adafruit_BMP085 bmp = Adafruit_BMP085();    // Digital Pressure Sensor


/*
DP/Dt explanation
0 = "Stable Weather Pattern"
1 = "Slowly rising Good Weather", "Clear/Sunny "
2 = "Slowly falling L-Pressure ", "Cloudy/Rain "
3 = "Quickly rising H-Press",     "Not Stable"
4 = "Quickly falling L-Press",    "Thunderstorm"
5 = "Unknown (More Time needed)
*/

const char *weatherStrings[] = { "stable", "sunny", "cloudy", "unstable", "thunderstorm", "unknown" };
enum FORECAST
{
  STABLE = 0,     // Stable weather
  SUNNY = 1,      // Slowly rising HP stable good weather
  CLOUDY = 2,     // Slowly falling Low Pressure System, stable rainy weather
  UNSTABLE = 3,   // Quickly rising HP, not stable weather
  THUNDERSTORM = 4, // Quickly falling LP, Thunderstorm, not stable
  UNKNOWN = 5     // Unknown, more time needed
};

const char *situationStrings[] = { "very low", "low", "normal", "high", "very high" };
enum WEATHER_SITUATION
{
  VERY_LOW_PRESSURE = 0,    // p > -7.5hPa
  LOW_PRESSURE = 1,     // p > -2.5hPa
  NORMAL_PRESSURE = 2,    // p < +/-2.5hPa 
  HIGH_PRESSURE = 3,      // p > +2.5hPa
  VERY_HIGH_PRESSURE = 4,   // p > +7.5hPa
};

float lastPressure = -1;
float lastPressureTemp = -1;
int lastForecast = -1;
int lastSituation = NORMAL_PRESSURE;

const int LAST_SAMPLES_COUNT = 5;
float lastPressureSamples[LAST_SAMPLES_COUNT];

// get kPa/h be dividing hPa by 10
#define CONVERSION_FACTOR (1.0/10.0)

int minuteCount = 0;
bool firstRound = true;

// average value is used in forecast algorithm.
float pressureAvg;
// average after 2 hours is used as reference value for the next iteration.
float pressureAvg2;
float dP_dt;

MyMessage tempMsg(CHILD_ID_TEMP1, V_TEMP);
MyMessage pressureMsg(CHILD_ID_BARO, V_PRESSURE);
MyMessage forecastMsg(CHILD_ID_BARO, V_FORECAST);
MyMessage situationMsg(CHILD_ID_BARO, V_VAR1);
MyMessage forecastMsg2(CHILD_ID_BARO, V_VAR2);


void initPressureSensor()
{
  if (!bmp.begin())
  {
    Serial.println(F("Could not find a valid BMP085 sensor, check wiring!"));
    while (1) {}
  }
}

void initHumiditySensor()
{
  dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN);
}

void setup()
{
  initPressureSensor();
  initHumiditySensor();
  metric = getConfig().isMetric;
}

void presentation()
{
  sendSketchInfo("Weather Station Sensor", "1.0");

  present(CHILD_ID_BARO, S_BARO);
  present(CHILD_ID_TEMP1, S_TEMP);
  present(CHILD_ID_HUM, S_HUM);
  present(CHILD_ID_TEMP2, S_TEMP);
}

int getWeatherSituation(float pressure)
{
  int situation = NORMAL_PRESSURE;

  float delta = pressure - SEALEVEL_PRESSURE;
  if (delta > 7.5)
  {
    situation = VERY_HIGH_PRESSURE;
  }
  else if (delta > 2.5)
  {
    situation = HIGH_PRESSURE;
  }
  else if (delta < -7.5)
  {
    situation = VERY_LOW_PRESSURE;
  }
  else if (delta < -2.5)
  {
    situation = LOW_PRESSURE;
  }
  else
  {
    situation = NORMAL_PRESSURE;
  }

  return situation;
}

// The BMP provides a temperature value, too!
bool updatePressureSensor()
{
  bool changed = false;

  //sealevel pressure p0 from absolute pressure.
  float pressure = bmp.readSealevelPressure(SEALEVEL) / 100.0;
  float temperature = bmp.readTemperature();
  if (!metric)
  {
    // Convert to fahrenheit
    temperature = temperature * 9.0 / 5.0 + 32.0;
  }

  int forecast = sample(pressure);
  int situation = getWeatherSituation(pressure);


  if (SEND_ALWAYS || (temperature != lastPressureTemp))
  {
    changed = true;
    lastPressureTemp = temperature;
    #ifdef MY_DEBUG
    Serial.print(F("Temperature = "));
    Serial.print(temperature);
    Serial.println(metric ? F(" *C") : F(" *F"));
    #endif
    if (!send(tempMsg.set(lastPressureTemp, 1)))
    {
      lastPressureTemp = -1.0;
    }
  }

  if (SEND_ALWAYS || (pressure != lastPressure))
  {
    changed = true;
    lastPressure = pressure;
    #ifdef MY_DEBUG
    Serial.print(F("sealevel Pressure = "));
    Serial.print(pressure);
    Serial.println(F(" hPa"));
    #endif
    if (!send(pressureMsg.set(lastPressure, 1)))
    {
      lastPressure = -1.0;
    }
  }

  if (SEND_ALWAYS || (forecast != lastForecast))
  {
    changed = true;
    lastForecast = forecast;
    #ifdef MY_DEBUG
    Serial.print(F("Forecast = "));
    Serial.println(weatherStrings[forecast]);
    #endif
    if (send(forecastMsg.set(weatherStrings[lastForecast])))
    {
      if (!send(forecastMsg2.set(lastForecast)))
      {
      }
    }
    else
    {
      lastForecast = -1.0;
    }
  }

  if (SEND_ALWAYS || (situation != lastSituation))
  {
    changed = true;
    lastSituation = situation;
    #ifdef MY_DEBUG
    Serial.print(F("Situation = "));
    Serial.println(situationStrings[situation]);
    #endif
    if (!send(situationMsg.set(lastSituation, 0)))
    {
      lastSituation = -1.0;
    }
  }


  return changed;
}

// The dht provides a temperature, too!
bool updateHumiditySensor()
{
  bool changed = false;

  float temperature = dht.getTemperature();
  float humidity = dht.getHumidity();

  if (!isnan(temperature))
  {
    if (SEND_ALWAYS || (temperature != lastTemp))
    {
      lastTemp = temperature;
      if (!metric)
      {
        temperature = dht.toFahrenheit(temperature);
      }

      changed = true;
      #ifdef MY_DEBUG
      Serial.print(F("T: "));
      Serial.println(temperature);
      #endif
      if (!send(msgTemp.set(temperature, 1)))
      {
        lastTemp = -1.0;
      }
    }
  }
  else
  {
    Serial.println(F("Failed reading temperature from DHT"));
  }
 
 
  if (!isnan(humidity))
  {
    if (SEND_ALWAYS || (humidity != lastHum))
    {
      lastHum = humidity;
      changed = true;
      #ifdef MY_DEBUG
      Serial.print(F("H: "));
      Serial.println(humidity);
      #endif
      if (!send(msgHum.set(lastHum, 1)))
      {
        lastHum = -1.0;
      }
    }
  }
  else
  {
    Serial.println(F("Failed reading humidity from DHT"));
  }
 
  return changed;
}

void loop()
{
  updatePressureSensor();
  sleep(SLEEP_TIME1);
  updateHumiditySensor();
  sleep(SLEEP_TIME2);
}


float getLastPressureSamplesAverage()
{
  float lastPressureSamplesAverage = 0;
  for (int i = 0; i < LAST_SAMPLES_COUNT; i++)
  {
    lastPressureSamplesAverage += lastPressureSamples[i];
  }

  lastPressureSamplesAverage /= LAST_SAMPLES_COUNT;

  // Uncomment when dubugging
  //Serial.print(F("### 5min-Average:"));
  //Serial.print(lastPressureSamplesAverage);
  //Serial.println(F(" hPa"));

  return lastPressureSamplesAverage;
}



// Algorithm found here
// http://www.freescale.com/files/sensors/doc/app_note/AN3914.pdf
// Pressure in hPa -->  forecast done by calculating kPa/h
int sample(float pressure)
{
  // Calculate the average of the last n minutes.
  int index = minuteCount % LAST_SAMPLES_COUNT;
  lastPressureSamples[index] = pressure;

  minuteCount++;
  if (minuteCount > 185)
  {
    minuteCount = 6;
  }

  if (minuteCount == 5)
  {
    pressureAvg = getLastPressureSamplesAverage();
  }
  else if (minuteCount == 35)
  {
    float lastPressureAvg = getLastPressureSamplesAverage();
    float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR;
    if (firstRound) // first time initial 3 hour
    {
      dP_dt = change * 2; // note this is for t = 0.5hour
    }
    else
    {
      dP_dt = change / 1.5; // divide by 1.5 as this is the difference in time from 0 value.
    }
  }
  else if (minuteCount == 65)
  {
    float lastPressureAvg = getLastPressureSamplesAverage();
    float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR;
    if (firstRound) //first time initial 3 hour
    {
      dP_dt = change; //note this is for t = 1 hour
    }
    else
    {
      dP_dt = change / 2; //divide by 2 as this is the difference in time from 0 value
    }
  }
  else if (minuteCount == 95)
  {
    float lastPressureAvg = getLastPressureSamplesAverage();
    float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR;
    if (firstRound) // first time initial 3 hour
    {
      dP_dt = change / 1.5; // note this is for t = 1.5 hour
    }
    else
    {
      dP_dt = change / 2.5; // divide by 2.5 as this is the difference in time from 0 value
    }
  }
  else if (minuteCount == 125)
  {
    float lastPressureAvg = getLastPressureSamplesAverage();
    pressureAvg2 = lastPressureAvg; // store for later use.
    float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR;
    if (firstRound) // first time initial 3 hour
    {
      dP_dt = change / 2; // note this is for t = 2 hour
    }
    else
    {
      dP_dt = change / 3; // divide by 3 as this is the difference in time from 0 value
    }
  }
  else if (minuteCount == 155)
  {
    float lastPressureAvg = getLastPressureSamplesAverage();
    float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR;
    if (firstRound) // first time initial 3 hour
    {
      dP_dt = change / 2.5; // note this is for t = 2.5 hour
    }
    else
    {
      dP_dt = change / 3.5; // divide by 3.5 as this is the difference in time from 0 value
    }
  }
  else if (minuteCount == 185)
  {
    float lastPressureAvg = getLastPressureSamplesAverage();
    float change = (lastPressureAvg - pressureAvg) * CONVERSION_FACTOR;
    if (firstRound) // first time initial 3 hour
    {
      dP_dt = change / 3; // note this is for t = 3 hour
    }
    else
    {
      dP_dt = change / 4; // divide by 4 as this is the difference in time from 0 value
    }
    pressureAvg = pressureAvg2; // Equating the pressure at 0 to the pressure at 2 hour after 3 hours have past.
    firstRound = false; // flag to let you know that this is on the past 3 hour mark. Initialized to 0 outside main loop.
  }

  int forecast = UNKNOWN;
  if (minuteCount < 35 && firstRound) //if time is less than 35 min on the first 3 hour interval.
  {
    forecast = UNKNOWN;
  }
  else if (dP_dt < (-0.25))
  {
    forecast = THUNDERSTORM;
  }
  else if (dP_dt > 0.25)
  {
    forecast = UNSTABLE;
  }
  else if ((dP_dt > (-0.25)) && (dP_dt < (-0.05)))
  {
    forecast = CLOUDY;
  }
  else if ((dP_dt > 0.05) && (dP_dt < 0.25))
  {
    forecast = SUNNY;
  }
  else if ((dP_dt >(-0.05)) && (dP_dt < 0.05))
  {
    forecast = STABLE;
  }
  else
  {
    forecast = UNKNOWN;
  }

  // Uncomment when dubugging
  // Serial.print(F("Forecast at minute "));
  // Serial.print(minuteCount);
  // Serial.print(F(" dP/dt = "));
  // Serial.print(dP_dt);
  // Serial.print(F("kPa/h --> "));
  // Serial.println(weatherStrings[forecast]);

  return forecast;
}


Inclusion Mode ist aktiviert.
MySensors ist auf Stand V2.0 Das Gateway ist etwas älter,

Das Device 101 gab es schon ein paar Mal. Allerdings habe ich die FHEM-Config dazu bewusst nicht gespeichert sondern FHEM neu gestartet ohne Speichern.
Beim Start von FHEM meint er: 

Wenn ich allerding den Arduino vorher getestetnen Sernsors (mit Hexenmeisters Sketch) nehme sehe ich sofort das Device 101...


ed: Also vor allem die Frage ob das Problem in FHEM oder in der Firmware zu suchen ist...
[/quote]
FHEM mit FTUI. Homematic-Funk für Thermostate und Licht. MySensors als Basis für eigene HW.
Zentrale ist der MAPLE-CUL mit RFM69+HModUART-AddOn.
Doku zu meinen Projekten: Github/Ranseyer. Platinen falls verfügbar gerne auf Anfrage.
Support: gerne wenn ich Zeit+Lust habe im Forum. Nicht per PN!

Gizmoh

Hallo zusammen,

ich habe nun auch versucht bei mir MySensors zum laufen zu bringen.
Dabei habe ich einen RPi an dem das NRF Funkmodul hängt und auch per FHEM angesprochen werden kann. Gateway hat den Status "opened" und die Version 1.4, installiert habe ich es am RPi hier nach:
https://github.com/mysensors/Raspberry

Dazu habe ich einen Sensebender Micro Sensor zum testen. Dort habe ich bisher nur den Beispiel Sketch drauf gespielt (https://www.mysensors.org/hardware/micro#example-sketch) und monitore ihn über die Arduino Software.

Autocreate ist sowohl in FHEM als auch für den Gateway aktiviert, nur das Device wird nicht angelegt. Ich bekomme im Log nur die Meldungen
016.09.25 16:11:17 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:11:27 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:11:33 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:11:42 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:11:49 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:11:58 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:12:06 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:12:14 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:12:22 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:12:32 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for


Ich habe den Sensor schon mehrfach neu angesteckt, position verändert, Eeprom gelöscht, aber komme einfach nicht weiter.

Könnt ihr mir hier helfen?

Danke und viele Grüße
Gizmoh

schka17

Zitat von: Gizmoh am 25 September 2016, 16:13:58
Hallo zusammen,

ich habe nun auch versucht bei mir MySensors zum laufen zu bringen.
Dabei habe ich einen RPi an dem das NRF Funkmodul hängt und auch per FHEM angesprochen werden kann. Gateway hat den Status "opened" und die Version 1.4, installiert habe ich es am RPi hier nach:
https://github.com/mysensors/Raspberry

Dazu habe ich einen Sensebender Micro Sensor zum testen. Dort habe ich bisher nur den Beispiel Sketch drauf gespielt (https://www.mysensors.org/hardware/micro#example-sketch) und monitore ihn über die Arduino Software.

Autocreate ist sowohl in FHEM als auch für den Gateway aktiviert, nur das Device wird nicht angelegt. Ich bekomme im Log nur die Meldungen
016.09.25 16:11:17 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:11:27 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:11:33 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:11:42 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:11:49 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:11:58 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:12:06 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:12:14 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:12:22 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for
2016.09.25 16:12:32 3: MYSENSORS: ignoring internal-msg from unknown radioId 100, childId 255 for


Ich habe den Sensor schon mehrfach neu angesteckt, position verändert, Eeprom gelöscht, aber komme einfach nicht weiter.

Könnt ihr mir hier helfen?

Danke und viele Grüße
Gizmoh
Das Problem liegt nicht am Sensor, dein Gateway kennt den Sensor nicht. Hast du den inclusion mode aktiviert?


Sent from my iPad using Tapatalk
M: Thinclient x64 Debian | CUL FS20, HMS100WD, HMS100TF, HMS100T, HMS100CO, S300, S555TH | OWServer DS1420, DS18B20, DS2408 | RFXCOM UVN128, THWR800, THGR228N,RTGR328, PCR800 |Jeelink PCA301 EC3000|CUNO+IR|HMLAN|HMUSB|CUL433 Somfy|mySensors|espEasy
S1:Raspberry mit BPM810, Jeelink EC3000