Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. parachutesj
    3. Posts
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by parachutesj

    • RE: fallback MQTT gateway

      I didn't find a solution to this on gateway code. What I did and seems to be working more or less.

      I have two instances running MQTT and OpenHAB. One is active, other is inactive. Both obviously do have separate IP addresses, however I have managed with "keepalive" to put a virtual IP in front. All I had to do was reflashing my gateway to the virtual IP.
      So if one of the nodes is going down, the other one becomes the master and binds to the virtual IP.
      In addition to have this seemless, the MQTT servers have a subscription to the other one. This solves the issue, that in case of a failure, there is no current data on that instance.
      OpenHAB itself was always setup in a manner that I am able to run two instances (development and production) side by side and get updates on stats of all items.

      On hardware level, I run a server on Ubuntu with VirtualBox where the instances run. On top, I have another standy node running on a RasPi.

      posted in Feature Requests
      parachutesj
      parachutesj
    • RE: MySensors --> MQTT --> OpenHab 2.5

      @TRS-80 sorry should have been more specific and edited my post above. I don't know if it still sucks but in the beginning it wasn't working very well and I didn't want to change all my configuration just to have exactly the same. Still a question of time.
      So I stick with MQTT 1 without MySensors binding - same, just what you have started with, stick with it until there is a real need.

      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: MySensors --> MQTT --> OpenHab 2.5

      @TRS-80 true, MQTT v1. The updated binding sucks IMHO
      EDIT: I should have been more specific. The MQTT binding was not migrated to 2.x for a long time and over time I got a lot of connected things via MQTT. Once 2.x was released it wasn't really stable in the beginning and later it was just not worth to do the upgrade IMHO. Once OH 3.x comes out and we have to adapt again, I might think about a migration but until then, I am happy with MQTT 1

      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: Looking for recommendations, advice, and insights

      @iamtheghost I am running exactly what you tried. Started with OpenHAB 1.x and migrated to 2.x. The serial gateway was exchanged with MQTT due to "open standard". I struggled a lot with hardware issues for actuators with relays but besides it always worked very well and reliable.
      Just for sensor data, I cannot think of something better than MySensors.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Looking for a door monitor setup/circuit

      @jamzm what are you looking for in particular?
      I use a ProMini with the Door/Window/Button switch. The sketch is modified to always sleep and wake up on change. (https://www.mysensors.org/build/binary), with a reed switch (https://www.aliexpress.com/item/32468849883.html?spm=a2g0s.9042311.0.0.27424c4dYn4UwZ)

      The sensor is powered with two AAA batteries. The case is actually from a real door/alarm system from aliexpress which I first wanted to hack but then decided to strip the electrnics out and build it myself. I use a NC reed switch to save additional power (when door is closed mainly).

      If you are interested more in the other part of my answer, I use OpenHAB as a controller. I have extensive rules to react base on an "uncontrolled" opening of a door or window.
      This could be anything from turning lights on to send an email to your phone, triggering an external security company or enabling your sprinkler 😉

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Looking for a door monitor setup/circuit

      I have multiple door/window sensors on 2 AAA batteries and they last forever. They permanently sleep and only send an update on change (open or close) and go back to sleep immediately. Within my controller I can track or take further actions e.g. trigger an alarm, send an email or turn lights on or whatever can be imagined. I would not mix up „dumb“ sensors with piezo buzzers etc. this will need additional power and space at the door/window and at the end it is much more efficient if you have a central control.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: MySensors --> MQTT --> OpenHab 2.5

      @P72endragon
      I also use MQTT instead of the binding. Major reason: when I started, it wasn't out and I had the serialGW connected. Once realized I want the controller in a different place, I switched to MQTT and never regret. I feel I have more control with the text files than I have with the UI-driven way.

      First of all, I highly recommend you download MQTT-spy or similar, this will help a lot in figuring out the right notation in OpenHAB. It will just listen to the traffic and log it. You could also use it to send test messages etc.

      Example:
      Gateway configuration

      // Set this node's subscribe and publish topic prefix
      #define MY_MQTT_PUBLISH_TOPIC_PREFIX "hefti-out"
      #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "hefti-in"
      
      // Set MQTT client id
      #define MY_MQTT_CLIENT_ID "hefti-1"
      

      Node configuration (temperature sensor)

      #define CHILD_ID_TEMP 1
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      present(CHILD_ID_TEMP, S_TEMP);
      

      OH example.items

      Number  roofTemp01              "Temperature roof [%.1f °C]" <temperature> (Temperature, Outdoor) {mqtt="<[mosquitto:hefti-out/101/1/1/0/0:state:default]"}
      

      MQTT spy of a recent message:
      mqtt-spy.JPG
      That is basically it. Depending on how you want to display the result (sitemap, PaperUI etc). As you see, the item is displayed in Temperature and Outdoor but you could also specify it directly in the sitemap but I guess this is going too far here.
      Hope that helped.

      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: Serial GW and motion sensor functionning, but no activity between them

      @Rolland don't bother with official Arduino (imho). the clones work flawless. I have a lot here in my home and they work well. It is just not worth it to pay 10x the price

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Serial GW and motion sensor functionning, but no activity between them

      @Rolland unfortunately I have to confirm what @skywatch said: the radios are crap. I had those and never made good experience with them. Also the amplified long range radios are not really needed in most cases and if, then they need a really good power source to run otherwise I never got stable connections.
      Besides, any cheap NRF24 from China worked quite well for me. Some very few were faulty but if you get 10 for 7 USD you can live with that
      https://www.aliexpress.com/item/32518935864.html?spm=a2g0o.productlist.0.0.686fe77cXL8wSb&algo_pvid=ad7873cd-c5ff-4de5-8f42-f1648f896a0b&algo_expid=ad7873cd-c5ff-4de5-8f42-f1648f896a0b-1&btsid=0ab6d70515882563711402031e6ae8&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_
      Not saying those are the best, but easier than the PA-ones.

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Serial GW and motion sensor functionning, but no activity between them

      almost forgot:
      to just eliminate the issues with ID, missing controller etc. You could test the radios with a simple NRF24 test script, just google "NRF24 test code" and you will find a bunch to test if the communication works between nodes and radios are ok.

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Serial GW and motion sensor functionning, but no activity between them

      @mfalkvidd true.
      this is the log if the radio works and it does not have an ID. just uploaded to a blank Nano

      0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
      3 TSM:INIT
      4 TSF:WUR:MS=0
      11 TSM:INIT:TSP OK
      13 TSM:FPAR
      15 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      1024 TSF:MSG:READ,0-0-255,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      1029 TSF:MSG:FPAR OK,ID=0,D=1
      2022 TSM:FPAR:OK
      2023 TSM:ID
      2024 TSM:ID:REQ
      2027 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
      4034 TSM:ID
      4035 TSM:ID:REQ
      4037 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
      6045 TSM:ID
      6046 TSM:ID:REQ
      6048 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
      

      and like this if the NODE_ID was set (here to 155)

      0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
      3 TSM:INIT
      4 TSF:WUR:MS=0
      11 TSM:INIT:TSP OK
      13 TSM:INIT:STATID=155
      15 TSF:SID:OK,ID=155
      16 TSM:FPAR
      53 TSF:MSG:SEND,155-155-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      146 TSF:MSG:READ,0-0-155,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      151 TSF:MSG:FPAR OK,ID=0,D=1
      2060 TSM:FPAR:OK
      2061 TSM:ID
      2062 TSM:ID:OK
      2064 TSM:UPL
      2067 TSF:MSG:SEND,155-155-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      2079 TSF:MSG:READ,0-0-155,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      2084 TSF:MSG:PONG RECV,HP=1
      2086 TSM:UPL:OK
      2088 TSM:READY:ID=155,PAR=0,DIS=1
      2093 TSF:MSG:SEND,155-155-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      2100 TSF:MSG:READ,0-0-155,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      2108 TSF:MSG:SEND,155-155-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1
      2116 TSF:MSG:SEND,155-155-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      4125 TSF:MSG:SEND,155-155-0-0,s=255,c=3,t=11,pt=0,l=13,sg=0,ft=0,st=OK:Motion Sensor
      4134 TSF:MSG:SEND,155-155-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
      4143 TSF:MSG:SEND,155-155-0-0,s=1,c=0,t=1,pt=0,l=0,sg=0,ft=0,st=OK:
      4149 MCO:REG:REQ
      4155 TSF:MSG:SEND,155-155-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      4170 TSF:MSG:READ,0-0-155,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      4175 MCO:PIM:NODE REG=1
      4177 MCO:BGN:STP
      4178 MCO:BGN:INIT OK,TSP=1
      0
      4188 TSF:MSG:SEND,155-155-0-0,s=1,c=1,t=16,pt=0,l=1,sg=0,ft=0,st=OK:0
      4194 MCO:SLP:MS=120000,SMS=0,I1=1,M1=1,I2=255,M2=255
      4199 MCO:SLP:TPD
      

      if I "kill" the radio, it looks like this, which is still different than what @Rolland got. But would be worth a try to replace the radio.

      0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
      3 TSM:INIT
      4 TSF:WUR:MS=0
      11 !TSM:INIT:TSP FAIL
      12 TSM:FAIL:CNT=1
      14 TSM:FAIL:PDT
      
      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Serial GW and motion sensor functionning, but no activity between them

      @Rolland and you should put this into your code from both (if not there yet)

      #define MY_DEBUG 
      
      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Serial GW and motion sensor functionning, but no activity between them

      @Rolland as far as I know, you need a controller which assigns the node ID's - this of course means that you need a fully functioning setup from the beginning e.g. your gateway connected to a controller.
      As a workaround you could specify the node ID manually. see my other post.

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Serial GW and motion sensor functionning, but no activity between them

      try and put this into your code of the node

      #define MY_NODE_ID 2
      

      replace the number (2) for each further node with numbers between 1 and 255

      what happens then?

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: TV on/off monitor using TV USB port

      @rvendrame battery powered should work. Always sleep and only wake on change. My door/window sensors run ‚since forever‘ on the first battery.

      posted in Hardware
      parachutesj
      parachutesj
    • RE: TV on/off monitor using TV USB port

      @tomvanderputte I don‘t think it will harm the hardware if it powers down. I just don‘t like „to be out of control“. You don‘t know if it powered down or just dropped a heartbeat. Also I do some things in the evening once the TV powers down. This will obvious be delayed if you just kill the node and for traffic pollution you should not send updates to often.

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Serial GW and motion sensor functionning, but no activity between them

      @Rolland
      Did you give your node an ID?
      You could set via code or burn into ROM. This is needed. Can you post your node-code?

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: TV on/off monitor using TV USB port

      @tomvanderputte
      I don‘t like the idea of shutting off the node once USB power turns off... but you could use the Expire-Binding in OH for finding out.
      I‘d rather mount a photo cell to the front LED (if it turns off once powerded on) or on a scart interface, you could sense power once turned on. Or of course the USB if it turns on/off.

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Can I run multiple Analog capacitive moisture sensors per nano

      I am not sure if this is feasible to have 25' cables... Each needs 3 wires to connect.
      I am running the capacitive soil sensors in single mode with 3.3V ProMini on Battery. I do not see issues having 2-3 sensors per Arduino but more seems to be a wiring nightmare all over the garden.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Anyone help with 4 relays please?

      @petr-nosek
      sure with the 2nd power supply it looks different. However mine were all in-wall and there is just not enough space for this.

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Anyone help with 4 relays please?

      I tried so much and never reproduced it. had a test setup with a 4 and 8–way relay switching every couple of seconds something. Guess what: after 10 days I gave up because it worked flawless. But then again under load it failed.
      But everything except relays work very reliable.

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Anyone help with 4 relays please?

      come back in a year and let us know 🙂

      Well, I have only two single relay nodes left in my setup (lamps). They work good without issues, but need to mention that those are solid state.

      posted in Troubleshooting
      parachutesj
      parachutesj
    • fallback MQTT gateway

      would it be somehow possible to change the MQTT gateway that it accepts a second broker IP in case connection to primary is lost?

      I am trying to have my setup more reliable in case something brakes.

      posted in Feature Requests
      parachutesj
      parachutesj
    • RE: BME280 on batt. sleep question

      I have basically the same setup.
      BME280 powered by solar and saves for the night into a 3.7V cell.
      I use a proMini 3V
      In addition, I have a second temp sensor (dallas) and a rain sensor attached.
      The pressure sensor is doing some calculation for forecast. Also battery monitoring to know if there is still enough energy. But the solar cells are usually enough. during winter when there is some snow it might get drained.
      It is sending the values from all sensors every 180000ms (3 minutes) and then going back to sleep. Also if it starts raining, the sensor has an interrupt and sends immediately.
      For charing, I use this board:
      https://www.aliexpress.com/item/32230225249.html?spm=a2g0s.9042311.0.0.27424c4dbHQ48S

      Running flawless since quite some time.

      Here is my code - it needs cleanup but I am too lazy

      // 2.4. add sun sensor and shorten to 2 min intervall
      
      #define MY_RADIO_NRF24
      #define MY_DEBUG
      //fix node id = 101 Wetter Station Dach
      #include <SPI.h>
      #include <MySensors.h>
      //#include <DHT.h>
      // #include <Bounce2.h>
      // #include <BH1750.h>
      #include <Wire.h>
      #include <DallasTemperature.h>
      #include <OneWire.h>
      #include <Vcc.h>
      #include <Adafruit_Sensor.h>
      #include <Adafruit_BME280.h> // I had to change I2C address in library for 0x76 (line 32)
      //   #include <Adafruit_BMP085.h>
      
      Adafruit_BME280 bme; // I2C
      
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      #define CHILD_ID_PRESS 2
      #define CHILD_ID_FORECAST 3
      //#define CHILD_ID_LIGHT 2
      // #define CHILD_ID_BARO 3
      #define CHILD_ID_BTEMP 4
      #define CHILD_ID_STEMP 5
      #define CHILD_ID_RAIN 6
      #define CHILD_ID_VOLT 7
      #define SENSOR A0
      #define P0 1010.6
      
      #define DIGITAL_INPUT_RAIN_SENSOR 3
      //#define HUMIDITY_SENSOR_DIGITAL_PIN 4
      //#define INTERRUPT DIGITAL_INPUT_RAIN_SENSOR-2
      #define COMPARE_TEMP 0 // Send temperature only if changed? 1 = Yes 0 = No
      
      #define ONE_WIRE_BUS 8 // Pin where dallase sensor is connected 
      #define MAX_ATTACHED_DS18B20 16
      
      
      const char *weather[] = { "stable", "sunny", "cloudy", "unstable", "thunderstorm", "unknown" };
      enum FORECAST
      {
        STABLE = 0,      // "Stable Weather Pattern"
        SUNNY = 1,      // "Slowly rising Good Weather", "Clear/Sunny "
        CLOUDY = 2,     // "Slowly falling L-Pressure ", "Cloudy/Rain "
        UNSTABLE = 3,   // "Quickly rising H-Press",     "Not Stable"
        THUNDERSTORM = 4, // "Quickly falling L-Press",    "Thunderstorm"
        UNKNOWN = 5     // "Unknown (More Time needed)
      };
      
      
      // for forecast - untouched by me :)
      
        float lastPressure = -1;
        float lastTemp = -1;
        int lastForecast = -1;
        const int LAST_SAMPLES_COUNT = 5;
        unsigned long  mySleep = 180000; //180000 are 3 minutes
        float lastPressureSamples[LAST_SAMPLES_COUNT];
        // this CONVERSION_FACTOR is used to convert from Pa to kPa in forecast algorithm
        // 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;
      
      
      
      
      //Bounce debouncer = Bounce();
      boolean metric = true;
      int altitude = 1500; // 741 feet above sealevel
      //float lastBmpTemp = -1;
      //float lastPressure = -1;
      float lastHum = -1;
      //float lastTemp = -1;
      //int BATTERY_SENSE_PIN = A1;
      int lastRainValue = -1;
      int lastBatteryPcnt = 0;
      int updateAll = 60;
      int updateCount = 0;
      uint16_t lastLux;
      unsigned long SLEEP_TIME = 180000; //3 minutes
      
      int rainCounter = 0;
      
      float lastTemperature[MAX_ATTACHED_DS18B20];
      int numSensors = 1;
      bool receivedConfig = false;
      
      float oldVolts = 0;
      const float VccExpected   = 3.1;
      const float VccCorrection = 3.1 / 3.1; // Measured Vcc by multimeter divided by reported Vcc
      Vcc vcc(VccCorrection);
      static int oldBatteryPcnt = 0;
      
      //Adafruit_BMP085 bmp = Adafruit_BMP085();
      //  BH1750 lightSensor;
      //DHT dht;
      //  MySensor gw;
      
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature.
      
      
      
      
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      //MyMessage msgLux(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
      // MyMessage msgBtemp(CHILD_ID_BTEMP, V_TEMP);
      MyMessage msgPress(CHILD_ID_PRESS, V_PRESSURE);
      MyMessage msgForecast(CHILD_ID_FORECAST, V_FORECAST);
      MyMessage msgRain(CHILD_ID_RAIN, V_RAIN);
      MyMessage msgSunTemp(CHILD_ID_STEMP, V_TEMP);
      MyMessage msgVolt(CHILD_ID_VOLT, V_VOLTAGE);
      
      void before()
      {
        // Startup up the OneWire library
        sensors.begin();
      }
      
      void setup()
      {
        // requestTemperatures() will not block current thread
        sensors.setWaitForConversion(false);
        //dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN);
         if (!bme.begin())
         {
          Serial.println("BME init failed!");
          while (1);
         }
        else Serial.println("BME init success!");
        
        ServerUpdate(); // for first data reading and sending to controler
        wait(2000);
        ServerUpdate();
      
        pinMode(DIGITAL_INPUT_RAIN_SENSOR, INPUT);
        // Activate internal pull-up
        digitalWrite(DIGITAL_INPUT_RAIN_SENSOR, HIGH);
      
        // use the 1.1 V internal reference
      #if defined(__AVR_ATmega2560__)
        analogReference(INTERNAL1V1);
      #else
        analogReference(INTERNAL);
      #endif
      }
      
      void presentation()
      {
        analogReference(INTERNAL);
      
      
        //     bmp.begin();
        sendSketchInfo("Weather Sensor", "2.01");
        present(CHILD_ID_HUM, S_HUM);
        present(CHILD_ID_TEMP, S_TEMP);
        present(CHILD_ID_PRESS, S_BARO);
        //  present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
        //   present(CHILD_ID_BARO, S_BARO);
        //  present(CHILD_ID_BTEMP, S_TEMP);
        present(CHILD_ID_RAIN, S_MOTION);
      
        present(CHILD_ID_STEMP, S_TEMP);
        present(CHILD_ID_VOLT, S_MULTIMETER);
        //pinMode(DIGITAL_INPUT_RAIN_SENSOR, INPUT);
        //      lightSensor.begin();
        metric = true;
      }
      
      
      
      void loop()
      {
      
      ServerUpdate();
        updateCount += 1;
        Serial.println("aufgewacht...");
      
        if (updateCount == updateAll) {
          lastTemp = -1;
          lastHum = -1;
          // lastLux = -1;
          //  lastBmpTemp = -1;
          //    lastPressure = -1;
          lastRainValue = -1;
          //   lastBatteryPcnt = -1;
          updateCount = 0;
        }
      
      /*
        
        delay(dht.getMinimumSamplingPeriod());
        float temperature = dht.getTemperature();
        if (isnan(temperature)) {
          lastTemp = -1;
        } else if (temperature != lastTemp) {
          lastTemp = temperature;
          if (!metric) {
            temperature = temperature * 1.8 + 32.0;
          }
          send(msgTemp.set(temperature, 1));
        }
        float humidity = dht.getHumidity();
        if (isnan(humidity)) {
          lastHum = -1;
        } else if (humidity != lastHum) {
          lastHum = humidity;
          send(msgHum.set(humidity, 1));
        }
      
        
      */
        /*  uint16_t lux = analogRead(SENSOR);
          // Serial.println("LUX: "+ String(lux));
          if (lux != lastLux) {
              send(msgLux.set(lux));
              lastLux = lux;
          }
      
        */
      
        /*
          float pressure = bmp.readSealevelPressure(altitude) * 0.01;
      
      
          float bmptemp = bmp.readTemperature();
          if (!metric) {
          bmptemp = bmptemp * 1.8 + 32.0;
          }
          if (bmptemp != lastBmpTemp) {
          gw.send(msgBtemp.set(bmptemp,1));
          lastBmpTemp = bmptemp;
          }
          if (pressure != lastPressure) {
          gw.send(msgPressure.set(pressure, 0));
          lastPressure = pressure;
          }
      
        */
        int rainValue = digitalRead(DIGITAL_INPUT_RAIN_SENSOR);
        wait(100);
      
        if (rainValue != lastRainValue) {
          send(msgRain.set(rainValue == 0 ? 1 : 0));
          lastRainValue = rainValue;
          Serial.println("RegenWert geaendert");
        }
        else if (rainCounter >= 5) //update rain every 10 minutes
        {
          send(msgRain.set(rainValue == 0 ? 1 : 0));
          rainCounter = 1;
          //Serial.println("rainCounter > als Wert");
        }
        else
        {
          rainCounter++;
          //Serial.println("rainCounter ++" + String(rainCounter));
      
        }
      
        /*
          int sensorValue = analogRead(BATTERY_SENSE_PIN);
          float voltage= sensorValue * (5.0 / 1023.0);
          Serial.println("sens:" +String (sensorValue));
          Serial.println("V:" +String (voltage));
          int batteryPcnt = (sensorValue - batteryBasement) * batteryConstant;
      
          if (lastBatteryPcnt != batteryPcnt) {
          gw.sendBatteryLevel(batteryPcnt);
          lastBatteryPcnt = batteryPcnt;
          }
        */
      
        // Fetch temperatures from Dallas sensors
        sensors.requestTemperatures();
        // query conversion time and sleep until conversion completed
        int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
        // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
        wait(conversionTime);
      
        // Read temperatures and send them to controller
        for (int i = 0; i < numSensors && i < MAX_ATTACHED_DS18B20; i++) {
      
          // Fetch and round temperature to one decimal
          float sunTemperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric ? sensors.getTempCByIndex(i) : sensors.getTempFByIndex(i)) * 10.)) / 10.;
      
          // Only send data if temperature has changed and no error
      #if COMPARE_TEMP == 1
          if (lastTemperature[i] != sunTemperature && sunTemperature != -127.00 && sunTemperature != 85.00) {
      #else
          if (sunTemperature != -127.00 && sunTemperature != 85.00) {
      #endif
      
            // Send in the new temperature
            send(msgSunTemp.setSensor(5).set(sunTemperature, 1));
            // Save new temperatures for next compare
            lastTemperature[i] = sunTemperature;
          }
        }
      
        //Serial.println("wait...");
        //wait(5000);
      
        //BAtterie
        int batteryPcnt = (int)vcc.Read_Perc(VccExpected);
        float volts = (float)vcc.Read_Volts();
        int myPerc = volts * 100 / VccExpected;
        Serial.print("Battery percent: ");
        Serial.print(myPerc);
        Serial.println(" %");
      
        Serial.print("Volts: ");
        Serial.print(volts);
        send(msgVolt.set(volts,1));
        Serial.println(" V");
        if (oldBatteryPcnt != myPerc)
        {
          sendBatteryLevel(myPerc);
          oldBatteryPcnt = myPerc;
        }
      
      
        Serial.println("sleep now...");
        sleep(1, CHANGE, SLEEP_TIME);
        //sleep(SLEEP_TIME);
      
      
        //delay(5000);
      }
      
      
      void ServerUpdate() // used to read sensor data and send it to controller
      {
        double T, P, H;
        T=bme.readTemperature();
        P=bme.readPressure()/100.0+52.7;
        H=bme.readHumidity();
        
          int forecast = sample(P);
            send(msgTemp.set(T, 1));
            send(msgPress.set(P, 1));
            send(msgHum.set(H,1));
            send(msgForecast.set(weather[forecast]));
            
         // unmark for debuging
            Serial.print("T = \t"); Serial.print(T, 1); Serial.print(" degC\t");
            Serial.print("P = \t"); Serial.print(P, 1); Serial.print(" mBar\t");
            Serial.print("P = \t"); Serial.print(H, 1); Serial.print(" relH\t");
            Serial.print("F = \t"); Serial.print(weather[forecast]); Serial.println(" ?");
      }
      
      float getLastPressureSamplesAverage()
      {
        float lastPressureSamplesAverage = 0;
        for (int i = 0; i < LAST_SAMPLES_COUNT; i++)
        {
          lastPressureSamplesAverage += lastPressureSamples[i];
        }
        lastPressureSamplesAverage /= LAST_SAMPLES_COUNT;
      
        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 debugging
        //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(weather[forecast]);
      
        return forecast;
      }
      
      posted in Hardware
      parachutesj
      parachutesj
    • RE: What multimeter should i wish for?

      I have upgraded to a Fluke 87 and super happy a while ago. It is overkill for a hobby but most likely the last one I’ve bought.
      Highly recommended

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: 2 Arduinos using the one radio. Possible?

      Well I think this is a workaround because something which should work doesn't for you. I would rather try to find out why your sensor doesn't work in first place. When sharing a radio, it adds complexity rather than reducing it.

      What's the issue?
      I have multiple LED-strips with a motion sensor and they work quite well. However having a good power source is a must, the LED might drain quite some energy.

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Ethernet W5100 gateway IP problem

      power issue was my 1st thought. I had that before when it wasn't good enough.
      I just experienced also an issue with a gateway, I had to specify the MAC address (change to whatever you like)

      #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xAD
      

      BR
      SJ

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: [SOLVED] huge delay with multiple gateways

      @yveaux I think this was the issue.
      I just found that

      #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xAD
      

      will specify the MAC.
      After adding it, no more issues. Changed back to same topics on both gateways, seems this is no problem.

      Even the gateways received different IPs via DHCP, they had the same MAC. Haven't seen an issue in any logs.
      I am not sure about long term, but short it works now. Let me see if it is a permanent fix.
      Still pretty strange that I receive different IPs from my router for the same MAC.
      Sometimes these are the easy fixes...

      Thanks for your help!

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: [SOLVED] huge delay with multiple gateways

      thank you @Yveaux
      I changed it. Still same issue. I do not see any in the logs now. So I have different topics, different channels. both here.
      Both have different client ids, both different IP's
      I am lost.
      As soon as I connect the 2nd gateway to the network, turning on/off in sequence of one node works a few times, after 5/7 iterations it stops, then after a few seconds all messages appear in the gateway log, also on my mqtt-spy. So there is somewhere a hickup.
      after disconnection, I can turn on/off 40-50 times and no issues at all.

      looks like it is mosquitto as MQTT broker.

      Can we specify the mac address? maybe there is the problem with the "cheap" network adapters...

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: [SOLVED] huge delay with multiple gateways

      hi @electrik
      this is the log of the 2nd gateway. I am only receiving messages sent from the controller to the nodes, the temp sensors etc. on the other network are not visible on the 2nd gateway. They are both in the same room, now. So from radio perspective I think it is fine.

      node 121 is the only one which should be dealt with this 2nd gateway.

      If I understand it correct, for node 112 received comand to turn the lights on. The gateway says it is UNKNOWN and 112 is not reachable. So far so good.
      Question is, does it also arrive on 1st gateway? what is it doing with it...
      I think the "simple" fix will be changing the topic. Then it should be fine.
      However still thinking that there is something odd

      0;255;3;0;9;TSF:MSG:READ,121-121-0,s=1,c=1,t=0,pt=7,l=5,sg=0:25.1
      0;255;3;0;9;Sending message on topic: hefti-out/121/1/1/0/0
      0;255;3;0;9;TSF:MSG:READ,121-121-0,s=0,c=1,t=1,pt=7,l=5,sg=0:56.5
      0;255;3;0;9;Sending message on topic: hefti-out/121/0/1/0/1
      0;255;3;0;9;TSF:MSG:READ,121-121-0,s=255,c=3,t=0,pt=1,l=1,sg=0:96
      0;255;3;0;9;Sending message on topic: hefti-out/121/255/3/0/0
      0;255;3;0;9;Message arrived on topic: hefti-in/112/0/1/0/3
      0;255;3;0;9;!TSF:MSG:SEND,0-0-112-112,s=0,c=1,t=3,pt=0,l=2,sg=0,ft=0,st=NACK:62
      0;255;3;0;9;Message arrived on topic: hefti-in/113/0/1/0/3
      0;255;3;0;9;!TSF:RTE:113 UNKNOWN
      0;255;3;0;9;!TSF:MSG:SEND,0-0-113-113,s=0,c=1,t=3,pt=0,l=2,sg=0,ft=0,st=NACK:79
      0;255;3;0;9;Message arrived on topic: hefti-in/117/0/1/1/2
      0;255;3;0;9;!TSF:RTE:117 UNKNOWN
      0;255;3;0;9;!TSF:MSG:SEND,0-0-117-117,s=0,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=NACK:1
      0;255;3;0;9;Message arrived on topic: hefti-in/102/0/1/1/2
      0;255;3;0;9;!TSF:RTE:102 UNKNOWN
      0;255;3;0;9;!TSF:MSG:SEND,0-0-102-102,s=0,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=NACK:1
      0;255;3;0;9;Message arrived on topic: hefti-in/113/0/1/0/3
      0;255;3;0;9;!TSF:RTE:113 UNKNOWN
      0;255;3;0;9;!TSF:MSG:SEND,0-0-113-113,s=0,c=1,t=3,pt=0,l=1,sg=0,ft=0,st=NACK:0
      0;255;3;0;9;Message arrived on topic: hefti-in/112/0/1/0/3
      0;255;3;0;9;!TSF:MSG:SEND,0-0-112-112,s=0,c=1,t=3,pt=0,l=1,sg=0,ft=0,st=NACK:0```
      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: [SOLVED] huge delay with multiple gateways

      @electrik thanks.
      I would hope that they are just connected to the one they can talk to (via radio), right?
      Anyhow it is a bit complicated to debug them, they are in places where I cannot bring my PC.

      When I uploaded the 2nd one and had the first sensor ready, I noted in the log, that also messages from other sensors appeared but mentioned something that I cannot remember but something like "ignoring message".

      So this would be very strange if this is an issue as repeater nodes are all over the place and never had any issues.
      I am just thinking how many people do have a similar setup with gateways on different IDs and same MQTT topic.

      Will try to change the topic, then I can also get some hints from the log potentially.

      posted in Troubleshooting
      parachutesj
      parachutesj
    • [SOLVED] huge delay with multiple gateways

      Hi there!

      I have one MQTT gateway. All worked very well. Then added a 2nd gateway on a different channel and in my basement. There is no radio contact between the two.
      My configuration:

      // Set this node's subscribe and publish topic prefix
      #define MY_MQTT_PUBLISH_TOPIC_PREFIX "hefti-out"
      #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "hefti-in"

      // Set MQTT client id
      #define MY_MQTT_CLIENT_ID "hefti-3"

      both Gateways have different client IDs, but same publish/subscribe topics.

      It sometimes takes up to 30 seconds until a message is received by a sensor node (turning lights on), sometimes it is fast. turn it on/off several times, works very unpredictable.

      After pulling the plug on the 2nd gateway, all works again.

      Any ideas? Do I need to choose different publish/subscribe ID's for this? Or possibly QOS of the MQTT broker?

      Thanks!
      SJ

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Can one arduino present multiple devices?

      @zboblamont I have to agree to this.
      With OpenHAB, every child is more or less treated as an individual device (item). No matter if there is one or 100 connected to one arduino.
      On the other hand, I do not think that more powerful devices will change dramatically. I think with sensor networks, decentralization and loose coupling with a gateway which just translates it into a common language is what is key. Putting additional intelligence into the nodes or gateways is not what I would expect and want.
      I am running a lot on mySensors. But I also do have other brands deplyed. It is quite easy to exchange one against the other. The logic and intelligence is in the controller which makes it most flexible.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Can one arduino present multiple devices?

      @alowhum most of the time it is the other way round that there are not enough input pins on the arduino to connect all sensors.
      I never had an issue with childs and what is the difference on controller side?

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Reliable 5v buck converter recommendations?

      @zboblamont well, looks like you thought it through. I should move my write access of the RPi also to an HDD, currently just limiting and having a 2nd on standby in case my master fails.
      Never had any boot issues though.

      Back to the topic:
      I have a solar charged weather station and had some issues on reliability. Did quite some testing and ended up building it new. The battery is a simple lion 3.7/4.2 and solar panels usually have much higher output. So bought this and did work well
      https://www.aliexpress.com/item/DC-6-24V-12V-24v-to-5V-USB-Output-charger-step-down-Power-Module-Mini-DC/32692500351.html?spm=2114.search0104.3.110.7d863cbbudQu7N&ws_ab_test=searchweb0_0,searchweb201602_2_10065_10068_10890_5730315_319_10546_317_10548_5728815_10696_453_10084_454_10083_10618_5729215_10307_537_536_10134_5733215_5733315_328_10059_10884_5733115_10887_100031_5733415_321_322_5732515_10103_5733515_5733615-10890,searchweb201603_55,ppcSwitch_0&algo_expid=7e5645cc-8270-475b-97a5-d40894e33c53-15&algo_pvid=7e5645cc-8270-475b-97a5-d40894e33c53

      not sure if this has enough amps for a RPi

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Reliable 5v buck converter recommendations?

      I have a powerbank with a USB-DC adapter connected to my RPi. Most likely the battery will die when I do not expect it to happen...
      However you spoke about 100% reliability. Whatever you'll build in front of the RPi, it will not be safe enough: At some point, the RPi will fail with its SD-card.
      So for me, thinking too much is overkill. There are too many points of failure unfortunately. And if main power is down, a battery powered RPi and sensors don't help much, the pumps, motors and other stuff will be out of service anyway.
      Sorry for OT.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Anyone help with 4 relays please?

      @petr-nosek my problem was maily unrealiability. They worked for minutes or weeks and then stopped (or anything in between).
      All other nodes work flawless.
      Maybe give it a try at next project

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Anyone help with 4 relays please?

      If this really solves the problem...would have saved me a lot of headaches. Got rid of all my relay nodes in the meantime.

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: BME280 How to use it outdoors

      @karl261 said in BME280 How to use it outdoors:

      Now after 2-3 month more outside the sensor seems to be finally dead.

      Quite old thread, but wanted to provide an update:
      I have a BME280 up and running since about 1 year now. It is in the weather station outside on the roof. It is vented very well but protected from direct exposure to sun, wind and rain. Readings are reliable. What I did is treating the whole board except the sensor chip with this:
      https://de.aliexpress.com/item/2pcs-lot-Genuine-Kafuter-k-705-RTV-Silicone-Rubber-Electronic-Glue-Sealant-Transparent-Organosilicon-45g/32649754904.html?spm=a2g0s.9042311.0.0.27424c4d0W1ssb

      posted in Hardware
      parachutesj
      parachutesj
    • RE: remote control design idea

      sometimes it is good to write it down...
      would it work, if I have the push buttons in series with some resistors on an analog input (to read which button was pressed, different values, based on resistance) and connect it in parallel to digital D2 to send the interrupt?
      That should work...

      posted in Development
      parachutesj
      parachutesj
    • remote control design idea

      Dears
      I know my idea is not really a sensor but as I have quite a few sensor nodes deployed I wanted to make it easy and reuse the framework.

      My challenge and I am a bit out of ideas is, I want to build a kind of remote control with multiple push buttons, in theory I have digital pins 2-7 available. This would be ok. However as it should be battery powered, I wanted to put it to sleep. But then a wake-up only works on D2/D3.
      Shift registers also do not seem to work, at least what I found out as it would not send the interrupt correctly to wake it up.

      The best I came up so far: motion sensor to wake it up and then go to sleep again after a certain time. But then it needs to be picked up and cannot be used when it is laying on a table.

      Any thoughts?

      cheers,
      SJ

      posted in Development
      parachutesj
      parachutesj
    • RE: Recommendation for motorized roller blinds solution (actual motor, like somfy, rollertrol, ebay...)

      @dakipro well WAF is important. Mine complained a lot when things didn't work but as it is quite stable she enjoys it but would never state that 😉

      A perfect solution is always very difficult to achieve. However when looking at my office where all blinds are triggered at the same time on any side of the building, it never works well and just annoyes anyone.
      Here at home, it works in most cases but you could always tune a bit. That is what I meant with "starting with azimuth and forget about elevation". There are cases in early morning during bright winter days when sun rises there is sun shining and blinding us at the dining room table. temperature difference is too low and it would not react. Two possibilities:
      a) manually trigger or
      b) build an even more complex rule (which I did).

      But these are cosmetics. And one could not predict all cases over 365 days in all possible weather situations.

      Regarding dead switch:
      I do not have any logic in my actuators. Fullstop!
      All comes from openHAB.
      First of all I do have one master switch, this kills everything. No actuator can be triggered automatically (sometimes important for WAF).
      Second there are certain conditions which cannot be overruled: e.g. if it starts raining, the roof windows close also when the wind speed is above trigger, rollershutters go up. These are mainly in order to prevent damage (except when master switch - rule 1 - is off).

      And then the rest could be easily achieved. If done with MySensors, just send an additional fake state back to the controller when you manually trigger something and then check in your rules:

      //light goes on
      send( myLightSwitch.set(1) );
      send( myManualStatus.set(1) );
      

      Then check in your rules if that value for myManualStatus is 1 or 0.

      I work for example with my rollershutters like this: when it goes down automatically, it goes to 85%. If it shall go up, I also check if it is at 85% - if not, then someone set it manually and I do not move it. Chances are pretty high, that if it is triggered manually it is not at 85% and rather at 84 or 86 or even something completely different.
      But then when sun sets, it overrides again and automatic kicks in again.

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Recommendation for motorized roller blinds solution (actual motor, like somfy, rollertrol, ebay...)

      @neverdie I am not that smart, just using the library from my controller: the astro binding for openHAB. It returns any time of the day the sun position based on your location. So what I do is basically check for any window* in the house if azimuth is between two values and if true checking in addition if sun is shining and when both are true, the rollershutter will go down. When sun stops shining or the sun has moved away, it will go up again.
      Elevation is no big deal in my case, only on the western side in late afternoon during winter months but for a start, I would recommend working with azimuth only.
      Also the inputs for down and up should have different values (e.g. going down > 10 degree; going up < 8 degree) otherwise they might constantly go down/up when reaching the peaks.
      And to make it more complicated, I also added conditions if someone is present, if it is raining, wind is too strong etc.

      Elevation is mainly used to trigger sunrise and sunset events (open in the morning, close in the evening)

      *for practical reasons I have groups based on the side of the house, but then doing different things.

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Recommendation for motorized roller blinds solution (actual motor, like somfy, rollertrol, ebay...)

      @dakipro why bother with individual sensors at the windows? You can calculate the sun position (azimuth and elevation) any time during the day and check if it would be possible for the sun to shine into the room. And in second step you only need to know if sun is shining or it is cloudy. Simplest way is using an online weather service. However I noted that this is not very reliable. My solution is based on MySensors:
      It is a weather station with some sensors (rain, temp, pressure). I've started with a light sensor but found it very unreliable also protection from environment is difficult.

      So at the end my sun senors is quite simple. One dallas sensor exposed to the sun and a second one in the shade. If the difference is high enough, sun is shining. Depending on your geographical location and preferences values might vary but for me (Zurich, CH) 10 degree celsius seems to be a good value.

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Retrieve sensor values from sensors on OpenHab request

      either what @gohan said or persist the values in OH

      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: Sensor is offline for some time

      All:
      thank you for your contributions. I think I have finally fixed the problem. It was due to the input side from solar and I had overvoltage shutting down my charge control board. This is quite strange as it has been running for a longer period and then stopped. Maybe it altered and at some point the tolerance went down.
      Anyhow it is logical: When I had good sun, I measured 6.2V on the input side which seems to be too much for the board - even the solar panels are all rated at 5V.
      I added a voltage regulator making sure the solar output is max 5V. Since then it seems to be stable.
      Of course this is not optimal as this is causing some loss.
      Does anyone have a potentially better solar charger control board for an input of around 4-9 V to charge a 3.7 LiPo?
      Currently using those: LiPoCharger AliExpress

      Cheers
      SJ

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Recommendation for motorized roller blinds solution (actual motor, like somfy, rollertrol, ebay...)

      @dakipro I do have somfy motors wired to the control panels everywhere. The motors itself are very good. There are also newer ones I think which can be controlled wireless in case you do not have the wires yet or would need to wire it. then it only needs power at the window.

      For controlling, I used to have mysensors, but never had very reliable results. Potentially my bad electronic skills and switched to comercial solution lately (Homematic).

      for controlling, you might need to look into this:
      https://github.com/marvinroger/arduino-shutters

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Sensor is offline for some time

      and on a side note: my solar panels are total overkill, it charges for only a very short time during day until the battery is charged completely.
      Thinking of a heater for my rain sensor now...

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Sensor is offline for some time

      @gohan
      quick update:
      I already had a LDxxx33 in order to have a stable output for my NRF24 radio. Connected the VCC to this source too and since then it works. So it really seems that it overpowered the Arduino.
      Also switched the SolarPanel on but need to wait a few more days with good weather in order to have a "final" conclusion.

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Sensor is offline for some time

      @gohan @sundberg84 thank you both for your inputs.

      I think I have a design issue here.
      I originally had changed the weather station a few times in the beginning and the brain was a Nano. At some point I figured that I wanted to rebuilt it, make it "cleaner". Eventually I changed the DHT22 to a BME and the Nano to a Pro Mini 3.3V

      My solar panels deliver 5V and the charging circuit feeds a 3.6V 18650 and charge cut off is 4.2V

      I looked at my battery percentage and any time I get an interrupt in transfer is when it reaches 116% (which is based on 3.6V =100% => 4.2V )
      That also fits to current weather situation: Anytime around noon it has enough sun rays to charge the battery.

      The question is, what is wrong? Either the charging circuit is behaving strange when it reaches cut off or 4.2V are too much for the Arduino?

      That of course was no issue with the Nano and explains a bit.
      If I remember correctly, I desoldered the power regulator on the Arduino (need to check next time I get it down).
      Does anyone know what is the max Voltage until it fails?

      At least I have some glues what to change: I think I can put in a new Pro Mini with power regulator and go via RAW pin, the consumption will be higher but still ok I guess.
      And second option would be working on the charging side, however this is a bit more complicated during winter time as I don't know what is wrong.

      The solar panels are currently disconnected, since then it runs as expected and updates every 3 minutes, voltage still at 4.2V

      Here's a pic of it - not very nice but (mostly) functional
      alt text
      It fell down during a storm until I found a better solution and the solar panels are getting old. New one is already here but needs to be attached...

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Sensor is offline for some time

      @sundberg84 it is on my roof so measuring in real world conditions will be difficult. I will try what I can find out. No access at the moment due to boring day job 😉
      When I took it down (on Sunday), I had it inside (with no sun exposure) and opened the case. I found that all still was up and battery voltage was ok. As soon as I hit reset it was back ok. It took me about 1 hour more until it was back on the roof. So I am not so sure if it was the reset, the missing sun exposure or whatever.
      So I monitored it yesterday. Again at around noon it stopped and got back online after 1.5h. Will see what it does today.
      But I think first will be adding a new gateway on different channel connected to my PC in order to do some tracing.
      To your question: I am not sure if it is communicating directly with the gateway or via a repeater node. As I am using MQTT there is no information when I receive the message at my controller. I think I could debug the gateway in order to find out. Or ist there some other possibility?

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Sensor is offline for some time

      just a quick update: it failed again. I just looked at the monitor and last update was at 12:42pm - no update in last 45 minutes. All other sensors still report. And there is no sun today.
      oh boy, I have no idea. Maybe I replace parts and see what happens.

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Sensor is offline for some time

      @sundberg84
      it does not use a lot power at all. It sleeps for most of the time. I do not remember the exact figures but it would be ok without solar for at least one year.
      So the only correlation I could see is that when it starts charging and there is enough power via solar available, it is causing some side effects lately.
      I do not have the most efficient solar panel and mabye aging caused it to be weaker. It is quite cloudy today - maybe it is running then. Let's see

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Sensor is offline for some time

      @sundberg84 that's a good point. The battery was full when I first noted it and checked it. So it seems that it charges enough in order to get it running.
      I am no expert but the coldest temp is not around noon, so basically it fails when it is getting warmer. Is this a typical scenario or should the voltage drop when it is coldest?

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Sensor is offline for some time

      yes, I am using NRF24 on my nodes.
      I was thinking of creating a 2nd gateway with a different channel and connect the weather station to this in order to rule out interference - however it is still strange that I get around all 3 minutes a connection and then for 1-2 hours not even one.
      I honestly suspect a hardware issue which is caused by temperature/humidity/sun...

      posted in Troubleshooting
      parachutesj
      parachutesj
    • Sensor is offline for some time

      I have a weather station with multiple sensors with battery and solar power on my roof. Worked for quite a long time but since a few days I see that communication stops in the early afternoon. After 1-2 hours it is back to normal. All other sensors still work so I assume it must be the sensor node itself or some interference around.
      The strange thing is, due to winter light is limited and just when there is some sun it does not work (not clear if sun is causing the problem yet). As it worked in summer I think this should not be an issue except the solar panels are defect.
      I unplugged them yesterday but still the same issue.

      Basically it is a box out of wood connected dallas temp sensor, rain sensor, bht and solar panel feeding a 3.7 battery. Controlled by a pro mini with 3.3 V

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Fewer home automation postings? What's behind it?

      I don't know anything about numbers but can speak for myself: Since I got almost everything possible and useful set up, there is not so much left to discuss.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: No luck with ethernet Gateway

      @sigolhi do you have enough power? It seems USB does not be sufficient for me

      posted in Troubleshooting
      parachutesj
      parachutesj
    • RE: Why I quit using MySensors for actuators

      @NeverDie that sounds promising. Is there a document/ discussion available on the details?

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Why I quit using MySensors for actuators

      update on my above post:
      Another node started to act crazy, had to restart it several times (simple relay with one lamp attached). Then my gateway failed shortly after. I had to restart everything. By chance I realigned the antenna and since then all runs quite stable. This drives me crazy...

      Regarding the "new" solution I am currently trying: Exchanged one of the problematic nodes with a Wemos D1 mini. Runs without any issue since 2 months.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Why I quit using MySensors for actuators

      @Yveaux I wan't to believe this. However the sensors recover. IF it fails once, and then send again 5 mins later and it is successful - I guess most of us can live with this. E.g. I do have a rain sensor which sends via interrupt changed state. So as soon as it starts raining I get the update and close my roof windows. This NEVER failed. So I would say even if I do not know if some measurements are getting lost - I never noticed it. Also the other sensors seem quite stable.

      But as @NeverDie said, when an actuator fails, the light is not on etc. and you notice it immediately. The strange thing is, when they fail, they hardly recover themselves. Sometimes it works, sometime it doesn't.

      So for my rollershutters, in my rules from home automation (openHAB), I always send a "STOP" before reducing the chance that the next comand fails. This helped a lot but is just a workaround and not helping always. And then there are the situations, when they seem to "lock" and nothing helps and as soon as I press a physical button, it is working again (or do a arduino reset).
      I also debugged it and had the serial connected while that happend but it looked like no signal arrived at the node. So it failed somewhere in between.

      I think it could be the whole setup of the gateway. Either power supply, arduino, antenna, powermode or the alignment... but why happens it only on some nodes and not on others? And I have changed basically everything in the meantime.

      I just don't have the energy at the moment to further research on the topic. Appreciate your comments and suggestions

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Why I quit using MySensors for actuators

      @petewill don't get me wrong, I love this project and impressed by all the positive things. It is just that I - with my limited skills and resources - not able to get a decent stable state. I wan't it to be perfect.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Why I quit using MySensors for actuators

      @NeverDie I do not have the tools to analyze this. I checked the information from the router and there was a sketch scanning the frequencies which I tried and picked a channel which seems to be ok. After a while I changed is to 2 or 3 different values with similar results. Changing it again will be painful.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Mysensorized Roomba

      @gohan ESP is probably a good alternative. but then again you could also buy an after market wireless module for your roomba.
      I am not sure about the serial output, but I think it is 5v.

      but there is plenty of space for a nano or pro mini. wemos mini or nodemcu should also fit

      posted in My Project
      parachutesj
      parachutesj
    • RE: Why I quit using MySensors for actuators

      @msmacs did that, changed channels a few times, even the ones which are not so legal here to test but haven't seen any positive effects.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Mysensorized Roomba

      @moskovskiy82 I did not change too much compared to @EmielA on the code. worked pretty good until I bought a new roomba recently. Haven't tried it on the 980 yet:

      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      // Enable repeater functionality for this node
      #define MY_REPEATER_FEATURE
      
      #define CHILD_ID_BATT_TEMP          100  // Id of the 2nd msg1_3
      #define CHILD_ID_BATT_PROC          101   // Id of the 2nd msg1_4
      #define CHILD_ID_BATT_VOLT          102   // Id of the 2nd msg1_2
      #define CHILD_ID_BATT_AH            103   // Id of the 2nd msg2_5
      #define CHILD_ID_BATT_CHARGE_TYPE   104   // Id of the 2nd msg1_1
      #define CHILD_ID_BATT_CHARGE_SOURCE 105   // Id of the 2nd msg2_2
      
      
      #include <MySensors.h>
      #include <SoftwareSerial.h>
      
      //#define RELAY_1  5  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      //#define NUMBER_OF_RELAYS 2 // Total number of attached relays
      //#define RELAY_ON 1  // GPIO value to write to turn on attached relay
      //#define RELAY_OFF 0 // GPIO value to write to turn off attached relay
      
      #define NUMBER_OF_FUNCTION 7 
      #define NUMBER_OF_SENSORS 6
      #define ROOMBA_READ_TIMEOUT 300
      #define ROOMBA_WAKE_COUNT 10
      int ddPin = 6;
      
      int rxPin = 3;
      int txPin = 4;
      int ledPin = 13;
      
      SoftwareSerial roomba(rxPin, txPin);
      
      const char SWITCH_NAMES[NUMBER_OF_FUNCTION][14] = { "Roomba-Stop","Roomba-Dock","Roomba-Clean","Roomba-Spot","Roomba-Max","Roomba-Power","Roomba-Play" };
      const char SENSORS_NAMES[NUMBER_OF_SENSORS][24] = { "Roomba-Batt-Temp","Roomba-Batt-Proc","Roomba-Batt-Volt", "Roomba-Batt-mAH" , "Roomba-Batt-CHt" , "Roomba-Batt-CHs" };
      
      
      uint8_t buf[52];
      boolean lowBattery = true; // Acts as a debounce
      long battery_Current_mAh = 0;
      long battery_Total_mAh = 0;
      long battery_percent = 0;
      boolean DeadBattery = false;
      boolean FullBattery = true;
      unsigned long chargingState = 0;
      long voltage = 0;
      long temp = 0;
      long OiMode = 0;
      long ChargeSource = 0;
      
      long sensorfrequency = 300000; // 300000 = 5 min - frequency the sensors are read
      long lastsensorread = 0; // when were the sensors read the last time
      unsigned long lastsensorssend = 0;
      
      const char ChargeTypes[6][34] = { "Not charging","Reconditioning Charging","Full Charging","Trickle Charging","Waiting","Charging Fault Condition" };
      const char OiTypes[4][14] = { "Off","Passive","Safe","Full" };
      
      int packetSizes[58] = {
          0,0,0,0,0,0, //1-6
          1,1,1,1,1,1,1,1,1,1,1,1, //7-18
          2,2, //19-20
          1, //21
          2,2, //22-23
          1, //24
          2,2,2,2,2,2,2, //25-31
          1, //32
          2, //33
          1,1,1,1,1, //34-38
          2,2,2,2,2,2, //39-44
          1, //45
          2,2,2,2,2,2, //46-51
          1,1, //52-53
          2,2,2,2, //54-57
          1 //58
      };
      #define bumpright (sensorbytes[0] & 0x01)
      #define bumpleft  (sensorbytes[0] & 0x02)
      
      
      MyMessage msg1_3(CHILD_ID_BATT_TEMP, V_TEMP); //status of Temperature
      MyMessage msg1_4(CHILD_ID_BATT_PROC, V_PH); //status of Charge [%]
      MyMessage msg1_2(CHILD_ID_BATT_VOLT, V_VOLTAGE); //status of Voltage
      MyMessage msg2_5(CHILD_ID_BATT_AH, V_CURRENT); //status of mAH
      MyMessage msg1_1(CHILD_ID_BATT_CHARGE_TYPE, V_TEXT); //status of charget type
      MyMessage msg2_2(CHILD_ID_BATT_CHARGE_SOURCE, V_TEXT); //status of charger source
      
      void setup() {
          pinMode(ddPin, OUTPUT);
          digitalWrite(ddPin, LOW);
          Serial.begin(115200);
          while (!Serial) {
              ; // wait for serial port to connect. Needed for native USB port only
          }
          roomba.begin(115200);
          //Serial.println("Sending start command...");
          //delay(1000);
          //// set up ROI to receive commands
          defsongs();
          delay(500);
          rstop();
          Serial.println("Ready to go!");
      }
      
      void presentation()
      {
          // Send the sketch version information to the gateway and Controller
          sendSketchInfo("Roomba", "1.2");
      
          for (int sensor = 0; sensor < NUMBER_OF_FUNCTION; sensor++) {
              // Register all sensors to gw (they will be created as child devices)
              present(sensor, S_BINARY, SWITCH_NAMES[sensor]);
              delay(100);
          }
          present(CHILD_ID_BATT_TEMP, S_TEMP, SENSORS_NAMES[0]); delay(100);
          present(CHILD_ID_BATT_PROC, S_WATER_QUALITY, SENSORS_NAMES[1]); delay(100);
          present(CHILD_ID_BATT_VOLT, S_MULTIMETER, SENSORS_NAMES[2]);    delay(100);
          present(CHILD_ID_BATT_AH, S_MULTIMETER, SENSORS_NAMES[3]);  delay(100);
          present(CHILD_ID_BATT_CHARGE_TYPE, S_INFO, SENSORS_NAMES[4]); delay(100);
          present(CHILD_ID_BATT_CHARGE_SOURCE, S_INFO, SENSORS_NAMES[5]); delay(100);
      }
      
      void loop() {
          unsigned long now = millis();
          if (now > lastsensorssend + sensorfrequency)
          {
              readsensors();
              lastsensorssend = now;
          }
      }
      
      
      void receive(const MyMessage &message) {
        // We only expect one type of message from controller. But we better check anyway.
        if (message.type == V_LIGHT) {
          int mySensor = message.sensor;
          int myComand = message.getBool();
      
          //Serial.print(message.sensor-1+RELAY_1);
      
          if (mySensor == 0) {
            if (myComand == 1) {
              Serial.println("Clean");
              //clean();
              rcommand(135);
            }
            else {
              Serial.println("Stopp1");
              //halt();
              rstop();
            }
          }
      
          if (mySensor == 1) {
            if (myComand == 1) {
              Serial.println("dock");
              //dock();
              rcommand(143);
            }
            else {
              Serial.println("Stopp2");
              //halt();
              rstop();
            }
          }
          if (mySensor == 2) {
            if (myComand == 1) {
              Serial.println("song");
              //dock();
              rcommand(141);
              rsong(0);
            }
            else {
              Serial.println("Stopp2");
              //halt();
              rstop();
            }
          }
      
        }
      }
      
      void halt() {
        ;
        roomba.write(131);  // SAFE
        byte j = 0x00;
        roomba.write(137);
        roomba.write(j);
        roomba.write(j);
        roomba.write(j);
        roomba.write(j);
      }
      
      void dock() {
        delay(1000);
        roomba.write(143);
      }
      
      void clean() {
        delay(1000);
        roomba.write(135);
      }
      
      void rstop() {
          if (rwakeup()) {
              roomba.write(128);  delay(100);
              roomba.write(131);  delay(100);
              roomba.write(137);  delay(100);
              byte j = 0x00;
              roomba.write(j); delay(100);
              roomba.write(j); delay(100);
              roomba.write(j); delay(100);
              roomba.write(j); delay(100);
              roomba.write(128);
          }
      
      }
      
      void rsong(int b) {
          roomba.write(b); delay(100);
      }
      
      
      
      void rcommand(int command) {
          if (rwakeup()) {
              roomba.write(128);  delay(100);
              roomba.write(131);  delay(100);
              roomba.write(command);
          }
      }
      
      void play(char note, int rlong) {
          roomba.write(rnote(note));  delay(10);  roomba.write(64 / rlong);   delay(10);
      }
      
      
      bool rwakeup() {
          bool ret = getSensors(6, buf, 52);
          Serial.print("wakeup: ");
          Serial.print(ret);
          if (!ret) {
              for (int ii = 1; ii < ROOMBA_WAKE_COUNT; ii++)
              {
                  for (int jj = 0; jj < 3; jj++) {
                      digitalWrite(ddPin, HIGH); delay(10); 
                      digitalWrite(ddPin, LOW); delay(2);
                  }
                  delay(100);
                  roomba.write(128);
                  if (getSensors(6, buf, 52)) {
                      ret = true;
                      break;
                  }
                  Serial.print("-");
              }
          }
          Serial.println(ret);
          return ret;
      }
      
      bool getSensors(uint8_t packetID, uint8_t* dest, uint8_t len) {
          roomba.write(142);
          delay(100);
          roomba.write(packetID);
          delay(100);
          return getData(dest, len);
      }
      
      
      bool getData(uint8_t* dest, uint8_t len)
      {
          while (len-- > 0)
          {
              unsigned long startTime = millis();
              while (!roomba.available())
              {
                  // Look for a timeout
                  if (millis() > startTime + ROOMBA_READ_TIMEOUT)
                      return false; // Timed out
              }
              *dest++ = roomba.read();
          }
          return true;
      }
      
      //for sensorgetting
      int getPacketSize(int p) {
          return packetSizes[p - 1];
      }
      int getPacketOffset(int p) {
          int i = 0;
          for (int s = 1; s < p; s++) {
              i += getPacketSize(s);
          }
          return i;
      }
      
      //read sensors
      void readsensors()
      {
      
          if (getSensors(6, buf, 52)) {
      
              int off = 0;
      
              // Battery Checks
              off = getPacketOffset(21);
              chargingState = buf[off + 0];
              voltage = buf[off + 2] + 256 * buf[off + 1];
              temp = buf[off + 5];
              battery_Current_mAh = buf[off + 7] + 256 * buf[off + 6];
              battery_Total_mAh = buf[off + 9] + 256 * buf[off + 8];
      
              if (battery_Total_mAh == 0) battery_Total_mAh = 1;
              int nBatPcent = battery_Current_mAh * 100 / battery_Total_mAh;
              battery_percent = nBatPcent;
      
              //Oi Mode
              off = getPacketOffset(35);
              OiMode = buf[off + 0];
      
              //ChargeSource
              off = getPacketOffset(34);
              ChargeSource = buf[off + 0];
      
      
              send(msg1_3.set(temp));  delay(100);
              send(msg1_4.set(battery_percent));  delay(100);
              send(msg1_2.set(round(voltage / 10), 1));  delay(100);
              send(msg2_5.set(battery_Current_mAh));  delay(100);
              send(msg1_1.set(ChargeTypes[chargingState]));  delay(100);
              send(msg2_2.set(ChargeSource));  delay(100);
      
              //send(msg2_5.set(chargingState));  // Send info value to gw
              //send(msg2_5.set("charging state"));  // Send info value to gw
              //send(msg2_5.set(battery_Total_mAh));  // Send info value to gw
              //send(msg2_1.set(OiTypes[OiMode]));  // Send info value to gw
              lastsensorread = millis();
      
          }
          else { send(msg1_1.set("roomba is off")); }  // Send info value to gw
      }
      
      void defsongs() {
          uint8_t zero = 0;
          roomba.write(128);  delay(100); roomba.write(131);  delay(100); //[128 131](Start the command stream and change roomba mode to "Safe" mode)
          roomba.write(140);  delay(100); roomba.write(zero); delay(100); //[140 0](Start song definition and define the first song, song number 0)
          roomba.write(25);   //[16](16 notes will be sent for song number 0)
          play('E', 4);       //[76 16](play Mi sound for 1 / 4 seconds) // E
          play('E', 4);
          play('E', 2);
          play('E', 4);
          play('E', 4);
          play('E', 2);       //[76 32](play Mi sound for 1 / 2 seconds)
          play('E', 4);
          play('G', 4);
          play('C', 4);
          play('D', 4);
          play('E', 1);
      
          play('F', 4);
          play('F', 4);
          play('F', 2);
      
          play('F', 4);
          play('E', 4);
          play('E', 2);
      
          play('E', 4);
          play('D', 4);
          play('D', 4);
          play('E', 4);
          play('D', 1);
          delay(100);
          roomba.write(128);
      }
      
      int rnote(char note) {
          int command = 31;
          switch (note) {
          case 'C': command = 72; break;
          case 'D': command = 74; break;
          case 'E': command = 76; break;
          case 'F': command = 77; break;
          case 'G': command = 79; break;
          }
          return command;
      }
      
      
      posted in My Project
      parachutesj
      parachutesj
    • RE: Why I quit using MySensors for actuators

      @wallyllama I appreciate your help and also the help from the others on this thread, I really do.
      And I also still hope to find the root cause some day. However as you mentioned it is no straight forward and there are so many components and variables I might never been able to have a stable environment even after so many tests I did (see above).
      For the moment I stopped building new actuators based on MySensors, I switched to ESP. There are challenges but not so much on the radio side. I actually wanted to avoid having them in my WLAN why I started with MyS in first place but for the moment it looks like they just work. It is only a few days so need to wait to come to a result.

      For sensors, I am still building on MyS, have recently deployed a few more temp/hum sensors with coin cells. Still impressed with the low power consumption.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Why I quit using MySensors for actuators

      @dbemowsk that could also be an issue. The relays are used to drive rollershutters. They are not connected directly to the I/O pins, always via transistors. Self-designed circuits and China-boards like below. (btw: Power does not seem to be an issue)
      But why do some locations work and others don't? The relay boards, the arduinos, power supplies etc seem not to be the issue as I have exchanged them over time. Even one lamp with a relay which is connected directly and in fact was just a proof of concept works flawless since over a year.

      Don't get me wrong, I've learned a lot and it is fun building things. I will continue with sensors, maybe return for actuators. But as I (with my limited skills and measure equipment) got to a point where I am not getting the reliable results I would had hoped, I look into another technology which might be better (simpler) for me (hopefully).

      Aliexpress relay

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Why I quit using MySensors for actuators

      @Nca78 that could be an issue, I totally agree. However when I started I did not use the amplified radio and my first 3 nodes which are in fact the closer ones (4-8m from gateway) showed similar behaviour why I got the PA radio.
      Not sure if this would explain that it works for a while and then stops.
      So it might be an issue, but then again I tried so much already and if it is so sensitive in the end, it is not the right and failure proof thing I want. I am not out of MySensors, just for actuators.

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Why I quit using MySensors for actuators

      @erangaj that's the way I want to try... as the actuators are connected to the mains anyway the power consumption is not the major issue here. Thanks for your feedback

      posted in General Discussion
      parachutesj
      parachutesj
    • Why I quit using MySensors for actuators

      It's been a while since I started with MySensors and had quite some troubles and eventually figured everything out. In the meantime I have a lot of sensors all over the place but I am a bit biased about the results.

      One one side, all the sensors (door, window, temp, sun, water, humitdity etc) they work flawless. I have some very low power sensors on batteries which run "forever" and they update quite frequent and once started they just do what they need to do: send sensor data to my gateway. Perfect!
      As a sensor platform, I am very happy with the results.
      On the other side, I also have a few actuators. Mainly rollershutters, a few LED-dimmers and light switches.
      As the light and dimmers (mostly) work, the results with the rollershutters are bad. First the good part: I do have two window motors in quite remote places, they work. Built with relays for up/down movement. No troubles.
      Then a few other rollershutters which are actually quite close to the gateway, they fail. every now and then the signal from gateway fails. I do not know why. I have changed everything in the meantime: Antennas, radios, power supplys, relais, arduinos, new circuits, other electronic parts (first a bunch of Nanos, then proMini) nothing gives reliable results. I tried to tweak the software as best as it goes, added sensors to send "alive" messages like temperature but then again after one day or one week or two weeks, it fails again. sometimes I only need to trigger a manual switch to get it back, then I have to power cycle.
      So after more than one year, I am done with testing. I need to get something stable now. Moving on...

      Some facts:
      I use NRF24 radios, maybe others would deliver better results. But I am not willing to waste another year.
      I am on latest stable release.
      My gateway has been changed as well. Currently an "official" arduino Uno with amplified radio and external 10A power supply to have enough juice.
      I am doing electronics since many years, but no expert but think I know mostly what I am doing.

      Thank you for all your help, will stick around for additional sensor only devices, as this seems to work (for me).

      Cheers,
      SJ

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Lost beginner - nodes, parent nodes and changes needed to sketches ?

      @anonymouslemming have you tried another arduino? I think I had once a similar issue, all was set correct but node did not connect. Changed the arduino and it worked.

      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: Lost beginner - nodes, parent nodes and changes needed to sketches ?

      @anonymouslemming I am still using openhab 1. it never assigned device ID's automatically. So I set them manually and burned them to the ROM. There are sketches here to do this. So in principle you start withe node -1- write thet to ROM and the burn the sketch to it in 2nd step.
      If you add more nodes later, you just number them and make sure they are unique.
      For the child id, it is easier, this is within the sketch. Usually the first is 0
      If you have a node with one switch it should be 0 if not specified differently. All sample sketches are this way.
      If you build a more complex with e.g. a temp, humidity and light sensor the child id's will become 0, 1, 2

      Ok?

      Btw: if you have the node connected to the serial console you should see that information. Post your debug output if still in doubt

      SJ

      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: openHAB binding

      @TimO Thanks anyway. I am slowly moving into the OH2 direction - still a lot of things to be clarified and configured

      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: openHAB binding

      @TimO thank you.
      and what is with OH1? Not getting it to work.
      Does not seem that STOP works, UP & DOWN and PERCENTAGE work

      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: openHAB binding

      I saw STOP in S_cover is not supported in OH2 - what about OH1? Anyone?

      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: openHAB binding

      Hi,
      after my openHAB system completely failed I had to re-install everying. I had MySensors configured the old way with a lot of rules with the serial binding I thought I give the binding a try.
      In general it works but I have issues with S_COVER, not sure how to configure this.
      But of course in openhab it is a single Rollershutter item... I think I could do a workaround in creating in total 4 items and only show my rollershutter and then have a rule and based on up/down/stop update the 3 items.

      Anyhow, seems to complex.

      What is best practice here?

      The sensor presents itself with this:

       * Example item: 188;2;V_UP                 - Window covering. Up.
       * Example item: 188;2;V_DOWN               - Window covering. Down.
       * Example item: 188;2;V_STOP               - Window covering. Stop.
       * Example item: 188;2;V_PERCENTAGE         - Percentage value. 0-100 (%) ```
      posted in OpenHAB
      parachutesj
      parachutesj
    • RE: SONOFF Issues?

      why not building up a second network (wifi) - most routers can anyway?
      From price perspective, you cannot build a relay node for the same price as you get a sonoff. However it is more fun to build it yourself.
      Security: I would not connect a door opener to wifi. but then again, the whole home automation is on the network... it is all a trade between comfort and security.

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Sun / cloud sensor?

      @flopp ...and need to make sure it stays clean all the time

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Sun / cloud sensor?

      @Martin-Tellblom @NiklasO all...

      I've also built a light sensor for my home automation project but I was never really satisfied with it. The light level is different in summer and winter but still you might want to drive your shades. Also during dusk and dawn it was difficult. And you need to make sure that the lens is always clean or it is not working properly...
      I have a new solution which works imho much better:
      two temp sensors. One in direct sun, the other one in the shade. I look for the delta temperature and based on that can tell if sun is shining or not.
      using the water proof dallas sensors for that. easy, cheap, reliable.

      SJ

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Multiple sensor node freeze

      @siod I changed most of the power supplies for the nodes with relays. Seems to be fixed. All simple switches or sensors with temp etc. never hang. It is only with actuators and relays. Also upgrading to latest version might have improved the situation. But I am almost certain that I had a few bad power supplies.

      posted in Bug Reports
      parachutesj
      parachutesj
    • RE: MH-Z19 CO2 sensor

      @alowhum what about that:https://www.mysensors.org/build/gas ?

      posted in Hardware
      parachutesj
      parachutesj
    • RE: wireless door / window sensor

      @user2684
      it was not so much figuring out the 433 signal/transport, the hardware just did not capture the close phase of the switch. I guess this is due to the issue I explained in the other reply regarding power consumption and they just cut that off somehow in order to make the batteries last longer. But thanks a lot for the link, will check this out

      posted in Hardware
      parachutesj
      parachutesj
    • RE: wireless door / window sensor

      @user2684
      correct, debouncing does not work. below is my code which works pretty well.
      I forgot the power drain but it was very minimal. The major "problem" are the standard reed switches which are <normally open>
      that means in most cases when the door is closed, the switch is closed as well and this means the circuit is also closed and power flows which results in a factor 10 higher power consumption. The solution is to use a <normally closed> reed switch which will turn it around (circuit closed when door is open).
      At least in my case, the door is 98% of the time closed and therefore power consumption is less during close phase.

      
      // 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 <Bounce2.h>
      #include <Vcc.h>
      
      #define CHILD_ID 3
      #define BUTTON_PIN  3  // Arduino Digital I/O pin for button/reed switch
      
      //Bounce debouncer = Bounce();
      int oldValue = -1;
      
      float oldVolts = 0;
      const float VccExpected   = 3.00;
      const float VccCorrection = 3.0 / 3.0; // Measured Vcc by multimeter divided by reported Vcc
      Vcc vcc(VccCorrection);
      static int oldBatteryPcnt = 0;
      
      
      // Change to V_LIGHT if you use S_LIGHT in presentation below
      MyMessage msg(CHILD_ID, V_TRIPPED);
      
      void setup()
      {
        // Setup the button
        pinMode(BUTTON_PIN, INPUT);
        // Activate internal pull-up
        digitalWrite(BUTTON_PIN, HIGH);
      
        // After setting up the button, setup debouncer
      //  debouncer.attach(BUTTON_PIN);
      //  debouncer.interval(5);
      
      }
      
      void presentation() {
        // Register binary input sensor to gw (they will be created as child devices)
        // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage.
        // If S_LIGHT is used, remember to update variable type you send in. See "msg" above.
        present(CHILD_ID, S_DOOR);
      }
      //  Check if digital input has changed and send in new value
      void loop()
      {
      //  debouncer.update();
        // Get the update value
        // int value = debouncer.read();
        int value = digitalRead(BUTTON_PIN);
        wait(100);
        if (value != oldValue) {
          // Send in the new value
          send(msg.set(value == HIGH ? 1 : 0));
          oldValue = value;
        }
        //BAtterie
        int batteryPcnt = (int)vcc.Read_Perc(VccExpected);
        float volts = (float)vcc.Read_Volts();
        int myPerc = volts * 100 / VccExpected;
        Serial.print("Battery percent: ");
        Serial.print(myPerc);
        Serial.println(" %");
      
        Serial.print("Volts: ");
        Serial.print(volts);
        Serial.println(" V");
        if (oldBatteryPcnt != myPerc)
        {
          sendBatteryLevel(myPerc);
          oldBatteryPcnt = myPerc;
        }
      
        sleep(1, CHANGE, 0);
      }```
      posted in Hardware
      parachutesj
      parachutesj
    • RE: wireless door / window sensor

      @all
      When the window sensors from above arrived, receiving the wireless signal was easy. I noted that they only report open and not change when closed, so I tried to "fix" it but failed after a few hours of improving the original hardware. I took all electronics out and fittet an Arduino pro mini, radio and a reed switch into the case easily.

      Quite expensive after all but exactly what I wanted. I still do have two laying here and not sure if I shall remodel them or go with an out of the box sensor from Homematic here...

      posted in Hardware
      parachutesj
      parachutesj
    • RE: node disconnects - workaround?

      @FotoFieber
      Thank you for your reply. I know delay is not optimal but there is not so much interaction that this would or should cause the node to hang. And if it hangs, also an additional comand later on sent via webinterface etc. fails. So if it would send a failing comand while it is busy with the delay I would understand but it will not come back to live at all.
      The reason is avoiding power on both motor directions (up & down) for the same time as relays are slow.
      However I will try a "wait" instead.

      Watchdog: I thought about that before but as mentioned when I press the manual up/down button it comes back to live. If the sketch would be blocked and resolved by a watchdog, I would expect different behaviour.

      The power consumption related to classical relays might be influencing something - that is a chance. I have a bunch of SSRs laying around but was too lazy to build up something yet. Too many other unfinished projects in the pipeline...

      But back to my original thought: is there a function which would test a connection to the gateway which could be triggered manually?

      Thank you again
      SJ

      posted in Development
      parachutesj
      parachutesj
    • RE: node disconnects - workaround?

      @FotoFieber

      see my sketch below.
      Don't have a wiring diagram. However it is simply a relay module connected to the digital pins and some physical switches with each a resistor on +5V

      /**
         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
         Example sketch showing how to control physical relays.
         This example will remember relay state after power failure.
         http://www.mysensors.org/build/relay
      */
      
      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      // Enable repeater functionality for this node
      #define MY_REPEATER_FEATURE
      
      
      #include <MySensors.h>
      
      
      
      #define RELAY_1  3  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #define NUMBER_OF_RELAYS 2 // Total number of attached relays
      #define RELAY_ON 1  // GPIO value to write to turn on attached relay
      #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
      
      MyMessage sensorMsg0(0, V_DIMMER);
      MyMessage sensorMsg1(1, V_DIMMER);
      
      static int currentLevel0 = 0;  // Current dim level...
      static int currentLevel1 = 0;  // Current dim level...
      
      int upPin0 = 14;   // choose the input pin (for a up)
      int downPin0 = 15;   // choose the input pin (for a down)
      int motorUp0 = 0;     // variable for reading the pin status
      int motorDown0 = 0;     // variable for reading the pin status
      
      int upPin1 = 15;   // choose the input pin (for a up)
      int downPin1 = 16;   // choose the input pin (for a down)
      int motorUp1 = 0;     // variable for reading the pin status
      int motorDown1 = 0;     // variable for reading the pin status
      
      int switchState0 = 0; //0=off, 1=up, 2=down
      int tempSwitchState0 = 0; //0=off, 1=up, 2=down
      int rUnitPos0 = 0;
      
      int switchState1 = 0; //0=off, 1=up, 2=down
      int tempSwitchState1 = 0; //0=off, 1=up, 2=down
      int rUnitPos1 = 0;
      
      
      void shuttersUp(int shutter)
      {
        if (shutter == 0) {
          Serial.println("A Shutter 0 going up.");
          digitalWrite (RELAY_1 + 1, LOW);
          delay(100);
          digitalWrite (RELAY_1, HIGH);
          send( sensorMsg0.set(0) );
        }
        else {
          Serial.println("A Shutter 1 going up.");
          digitalWrite (RELAY_1 + 3, LOW);
          delay(100);
          digitalWrite (RELAY_1 + 2, HIGH);
          send( sensorMsg1.set(0) );
        }
      
      }
      
      void shuttersDown(int shutter)
      {
        if (shutter == 0) {
          Serial.println("A Shutter 0 going down.");
          digitalWrite (RELAY_1, LOW);
          delay(100);
          digitalWrite (RELAY_1 + 1, HIGH);
          send( sensorMsg0.set(100) );
        }
        else {
          Serial.println("A Shutter 1 going down.");
          digitalWrite (RELAY_1 + 2, LOW);
          delay(100);
          digitalWrite (RELAY_1 + 3, HIGH);
          send( sensorMsg1.set(100) );
      
        }
      
      }
      
      void shuttersStop(int shutter)
      {
        if (shutter == 0) {
          Serial.println("A Shutter 0 halted.");
          digitalWrite (RELAY_1, LOW);
          digitalWrite (RELAY_1 + 1, LOW);
        }
        else {
          Serial.println("A Shutter 1 halted.");
          digitalWrite (RELAY_1 + 2, LOW);
          digitalWrite (RELAY_1 + 3, LOW);
        }
      }
      
      
      void setup()
      {
      
      }
      void presentation()
      {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("RollerShutter AZ", "2.1");
      
        pinMode(upPin0, INPUT);    // declare pushbutton as input
        pinMode(downPin0, INPUT);    // declare pushbutton as input
      
        // Fetch relay status
        for (int sensor = 1, pin = RELAY_1; sensor <= NUMBER_OF_RELAYS; sensor++, pin++) {
          // Register all sensors to gw (they will be created as child devices)
          present(sensor, S_COVER);
          // Then set relay pins in output mode
          pinMode(pin, OUTPUT);
          // Set relay to last known state (using eeprom storage)
          digitalWrite(pin, LOW);
        }
      }
      
      
      void loop()
      {
      
        motorUp0   = digitalRead(upPin0);  // read input value
        motorDown0 = digitalRead(downPin0);  // read input value
      
        if (motorUp0 == LOW && motorDown0 == HIGH) {
          switchState0 = 1;
          //Serial.println("SWITCH: " + String(switchState0)); //Schalterposition
        }
        else if (motorDown0 == LOW && motorUp0 == HIGH) {
          switchState0 = 2;
          //Serial.println("SWITCH: " + String(switchState0)); //Schalterposition
        }
        else if (motorDown0 == HIGH && motorUp0 == HIGH)
        {
          switchState0 = 0;
          //Serial.println("SWITCH: " + String(switchState0)); //Schalterposition
        }
      
        if (tempSwitchState0 != switchState0) //man only needed in case of changed switch state
        {
      
          if (motorUp0 == LOW && rUnitPos0 != 1) //manuell hoch
          {
            switchState0 = 1;
            tempSwitchState0 = 1;
            delay(200);
            shuttersUp(0);
            rUnitPos0 = 1;
            Serial.println("//////////////man 0 hoch");
            send( sensorMsg0.set(0) );
          }
      
          if (motorDown0 == LOW && rUnitPos0 != 2) // manuell runter
          {
            switchState0 = 2;
            tempSwitchState0 = 2;
            delay(200);
            shuttersDown(0);
            rUnitPos0 = 2;
            Serial.println("//////////////man 0 down");
            send( sensorMsg0.set(100) );
          }
      
          if (motorUp0 == HIGH && motorDown0 == HIGH && rUnitPos0 != 0) //manuell stopp
          {
            switchState0 = 0;
            tempSwitchState0 = 0;
            delay(200);
            shuttersStop(0);
            rUnitPos0 = 0;
            Serial.println("//////////////man 0 stopp");
          }
      
        }
      
      
      }
      
      void receive(const MyMessage &message) {
        // Let's check for the message type.
        if (message.type == V_DIMMER) {
      
          //  Retrieve the power or dim level from the incoming request message
          int requestedLevel = atoi( message.data );
      
          // Adjust incoming level if this is a V_LIGHT variable update [0 == off, 1 == on]
          requestedLevel *= ( message.type == V_LIGHT ? 100 : 1 );
      
          // Clip incoming level to valid range of 0 to 100
          requestedLevel = requestedLevel > 100 ? 100 : requestedLevel;
          requestedLevel = requestedLevel < 0   ? 0   : requestedLevel;
      
          Serial.print( "Changing level to " );
          Serial.print( requestedLevel );
      
          Serial.print( ", from " );
      
          Serial.println("NodeID:" + String(message.sensor) + " " + currentLevel0 );
      
          if (requestedLevel == 0) {
            // move up
            shuttersUp(message.sensor);
          }
          else if (requestedLevel == 100) {
            // move down
            shuttersDown(message.sensor);
          }
          else {
            // move percentage
            // Serial.println("currentLevel" + String(shutters.currentLevel()));
            Serial.println("move to desired postion");
            //shutters.requestLevel(80);
          }
      
          currentLevel0 = requestedLevel;
      
      
        }
        else if (message.type == V_UP) {
          shuttersUp(message.sensor);
          Serial.println("going up:" + String(message.type));
        }
        else if (message.type == V_DOWN) {
          shuttersDown(message.sensor);
          Serial.println("going down:" + String(message.type));
        }
        else if (message.type == V_STOP) {
          shuttersStop(message.sensor);
          Serial.println("stopping:" + String(message.type));
        }
        else {
          Serial.println("wrong data received:" + String(message.type));
        }
      }
      
      posted in Development
      parachutesj
      parachutesj
    • node disconnects - workaround?

      Hi,
      I have one node (controlls a roller shutter) which keeps disconnecting or is unavailable.

      As controller I use openHAB - but don't think that this is important.
      My node with two relays should have enough power, changed the power supply and radio connection should also be ok. I even switched the arduino which did not solve it.

      Issue:
      OpenHAB controls it, up in the morning, down in the evening. Works most of the time. Sometimes after one day, somtimes after a week I can see in the log that the message failed.
      When I press the physical up or down buttons on the node to control the rollershutter, it "reconnects" to the gateway and can be controlled as before until it fails again.

      When I power cycle the node, it is also back to live. When I initiate a connection via physical buttons, it is always working and gets the connection - so I think the uplink direction is fine and radio communication in general should be ok.

      However on the downlink side it fails from time to time and does not get back to live - only after a uplink was initialized.

      Do we have a solution here? Can I test a connection several times a day e.g?
      A workaround could be attaching a temp sensor and just transmitt every 10-20 mins and I guess it should be fine but not really the solution to the RC.

      I am on 2.0x with my nodes and GW.

      Thanks
      Cheers,
      SJ

      posted in Development
      parachutesj
      parachutesj
    • RE: Which are the *best* NRF24L01+ modules?

      @gohan @karlheinz2000

      just for comparison, my "geniune" has also the same logo and the cheap one looks much "better" but one can see the bad production quality
      top one is GC supermarket, bottom genuine
      alt text

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Which are the *best* NRF24L01+ modules?

      @gohan
      I would not like to make a suggestion and rather reply my opinion on it:
      The worst experience I made was with the probably original ones (greenish on reference design). Not that the reception was bad but 4-5 already broke during testing and had to be exchanged.
      Therefore I buy the cheapest ones from GC supermarket or other big ALI-shops.
      However if you want a amplified version, I would spent the extra dollar and get a premium one. I posted it here somewhere and really made good experiences with it.

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Mysensorized Roomba

      All,
      I did some updates also thanks to @Eoreh I updated my code a bit. Anyhow, no really news on software side but was able to fit it more or less completely inside of the Roomba.

      1. I wanted to fit all inside and I think there is enough space but wanted to be able to disable it and thought about a dip-switch somewhere but then decided to have it connected via DIN as before. Means also no soldering on Roomba

      2. finding a spot was easy:
        alt text
        There is enough space on the side of the bin. (In picture, the external charging port was already removed)

      3. I soldered all together and decided to opt for a Nano instead of a Pro Mini due to the lack of 3.3V on board. I know radio might be better powered with a voltage regulator but the reception and reliability is not too important here. Anyhow not experienced any issues so far. I also used the SMD radio to save some extra space.
        The voltage regulator has a heat sink mounted which is pointing where the charing port was and is getting some "fresh air" 😉
        alt text

      4. all in place and ready to be closed again
        alt text

      5. closed without top plate
        alt text

      If it stops working or needs a reset, I only need to unplug and replug

      posted in My Project
      parachutesj
      parachutesj
    • RE: Mysensorized Roomba

      @Eawo I do have a 581 and not 100% sure what has been changed on newer models. Maybe you ask in a roomba forum

      posted in My Project
      parachutesj
      parachutesj
    • Mysensorized Roomba

      Hi,
      just wanted to share my POC:
      We're having a cleaning robot since years. It has built in scheduler and cleans based on that no matter if anyone is home or not.
      I wanted to change that; I do have the status of precence in OpenHAB.
      I have just created a simple mySensor node (based on a light switch) which sends 3 different commands to roomba:
      clean
      dock
      stop

      In openHAB it is just defined as a light switch and I can build up a schedule and if someone is home, it delays the start of cleaning until all are gone.

      ToDo:
      See if I can fit the parts inside of the cleaning robot but for POC I am happy

      alt text

      
      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      // Enable repeater functionality for this node
      #define MY_REPEATER_FEATURE
      
      #include <MySensors.h>
      #include <SoftwareSerial.h>
      
      #define RELAY_1  5  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #define NUMBER_OF_RELAYS 2 // Total number of attached relays
      #define RELAY_ON 1  // GPIO value to write to turn on attached relay
      #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
      
      int rxPin = 3;
      int txPin = 4;
      int ledPin = 13;
      
      SoftwareSerial Roomba(rxPin, txPin);
      
      #define bumpright (sensorbytes[0] & 0x01)
      #define bumpleft  (sensorbytes[0] & 0x02)
      
      void setup() {
        pinMode(ledPin, OUTPUT);   // sets the pins as output
        Serial.begin(115200);
        Roomba.begin(115200);
        digitalWrite(ledPin, HIGH); // say we're alive
        Serial.println ("Sending start command...");
        delay (1000);
        // set up ROI to receive commands
        Roomba.write(128);  // START
        delay(150);
        Serial.println ("Sending Safe Mode command...");
        delay (1000);
        Roomba.write(131);  // CONTROL
        delay(150);
        digitalWrite(ledPin, LOW);  // say we've finished setup
        Serial.println ("Ready to go!");
        delay (5000);
      }
      
      void presentation()
      {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Roomba", "1.0");
      
        for (int sensor = 1, pin = RELAY_1; sensor <= NUMBER_OF_RELAYS; sensor++, pin++) {
          // Register all sensors to gw (they will be created as child devices)
          present(sensor, S_BINARY);
        }
      }
      
      void loop() {
      
      }
      
      
      void receive(const MyMessage &message) {
        // We only expect one type of message from controller. But we better check anyway.
        if (message.type == V_LIGHT) {
          int mySensor = message.sensor;
          int myComand = message.getBool();
      
          //Serial.print(message.sensor-1+RELAY_1);
      
          if (mySensor == 0) {
            if (myComand == 1) {
              Serial.println("Clean");
              clean();
            }
            else {
              Serial.println("Stopp1");
              halt();
            }
          }
      
          if (mySensor == 1) {
            if (myComand == 1) {
              Serial.println("dock");
              dock();
            }
            else {
              Serial.println("Stopp2");
              halt();
            }
          }
      
        }
      }
      
      void halt() {
        ;
        Roomba.write(131);  // SAFE
        byte j = 0x00;
        Roomba.write(137);
        Roomba.write(j);
        Roomba.write(j);
        Roomba.write(j);
        Roomba.write(j);
      }
      
      void dock() {
        delay(1000);
        Roomba.write(143);
      }
      
      void clean() {
        delay(1000);
        Roomba.write(135);
      }
      
      

      Cheers,
      SJ

      posted in My Project
      parachutesj
      parachutesj
    • RE: 💬 Battery Powered Sensors

      I am not getting it...

      I have a 3.3V Pro Mini, it is connected to my table power supply and want it to be powered by a coin cell later. To test the VCC lib, I set

      const float VccExpected   = 3.21;
      

      What do I need to put here?

      const float VccCorrection = 3.21/3.21;
      

      It always returns BatteryPercentage of 2 or 3% seems the function is not calculating right. Anyhow I saw there is another function to call Read_Volts()

      float volts = (float)vcc.Read_Volts();
      int myPerc = volts *100 / VccExpected; 
      

      So "myPerc" returns a value of 98% which seems feasible, also when reducing Voltage it drops.
      But still, not getting the values with the build in function read_Perc()

      posted in Announcements
      parachutesj
      parachutesj
    • RE: 💬 Battery Powered Sensors

      @Nicklas-Starkel thank you. If one could read...
      I read the description again and thought that it should be 120uA stock and when removing LED and regulator it will even go down further but thinking about it, how should at base 120 uA and removing LED save additional 1.5mA???? LOL, sorry was a long day.

      My Fluke reads 0.044 mA in sleep now (without LED). Sweet!

      posted in Announcements
      parachutesj
      parachutesj
    • RE: wireless door / window sensor

      @mikee thank you, that ensures my thoughts. There will be SALE on Aliexpress tomorrow...

      posted in Hardware
      parachutesj
      parachutesj
    • RE: 💬 Battery Powered Sensors

      Hi,
      I just built the circuit which is explained in the thread with a Pro Mini 3.3 8 mHz
      So far so good, I can read the voltage of the battery etc but my problem is, it consumes about 1.2 mA while in sleep, this is about factor 10 of the findings from the thread.
      I just copied the code 1:1
      Any glue what could be wrong or what get others with that setup? The Arduino is not modified at all.

      Thanks
      SJ

      posted in Announcements
      parachutesj
      parachutesj
    • RE: wireless door / window sensor

      @mortommy thank you. So you have the whole thing incl. the Arduino powered by a battery?
      That would work most probably but is too bulky for me. Don't like to have a too big case dangling around on my windows. Also using a wireless could save a few arduinos. I give it a shot and order a few and let you know the outcome.
      SJ

      posted in Hardware
      parachutesj
      parachutesj
    • wireless door / window sensor

      guys,
      did anyone build up a wireless door or windows sensor yet?
      For example with this one?
      433 wireless door sensor

      I guess it shouldn't be too hard to hack this.

      Cheers,
      SJ

      posted in Hardware
      parachutesj
      parachutesj
    • RE: solid sate relay

      @TimO thank you.
      well I just measured if the relay is closed when triggered but it does not close, therefore I assumed it does not work. This has been tested with my continuity multimeter. Just added a lamp and it works. strange thing, need to dig in to understand this.

      Regards,
      SJ

      posted in Hardware
      parachutesj
      parachutesj