Navigation

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

    Best posts made by 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: 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: 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: upgrading to 2.0

      @TheoL & @sundberg84
      I updated my serial GW to 2.0 successfully. Just uploaded the code from the samle page and adjusted to my environment. All 1.x sensors seem to work after 24h.
      The issue from above is also solved, so 2.0 sketch works as well now.

      posted in Development
      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: HLK-PM01 reliability and experience

      all,
      after a few months of testing, another HLK-PM01 died. I ordered a new batch which seem to be ok after 5 weeks.
      However for my other node, I replaced it with an IRM-05-5 from Meanwell. Which is of course more powerfull at 5W but very stable.
      If size matters, the IRM is not for you, they are about 1.5 the size of the HLK in each direction.
      I just ordered some HLK-5m05 which are also 5W and smaller. Let's see how they perform.

      posted in Hardware
      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: 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: 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: Dimensional Sensor

      @Andres-Lanza have you seen this? https://www.mysensors.org/build/distance

      posted in General Discussion
      parachutesj
      parachutesj
    • RE: Hardware advice for newbe

      @Jasper-van-Winden
      In theory it should work. The question is just how long the wires to the DHT22 sensors are. I am not sure if anyone tried this as the whole idea behind this project is having simple sensors which talk via radio.
      I would guess if the wires are too long, the signal and/or power will be not high enough to get reliable readings.
      But if it would work via ethernet cable then why not connecting the sensors directly to one central arduino and just push that via http to your controller? I do not see any use of MySensors here if it will be wired...

      maybe I am wrong?

      posted in Hardware
      parachutesj
      parachutesj
    • RE: Problem with multiple relays and delays

      @Lucas-van-rossum
      Hi,
      I had a similar challenge with my rollershutters and I think most standard ones do exactly the same, they have one neutral pin and two for the directions (up, down). I started a few months ago building the first prototype which was controlled via WIFI and worked very well. I did not find much examples and all was build up myself. However WIFI didn't seem to be the best and I did not want to pollute my wireless therefore I searched for alternatives which I found here. Still struggling with the stability of the sensor network but besides that I am very happy with my solution.
      I also thought that I need to build an intelligent device which drives the shutters up, down and to intermediate positions. Played a lot with timers and stuff and eventually found the arduino-shutters of marvinroger with which I wasted another few days until I gave up and found out the code does not work for me - at least the latest version. Someone (I guess it was you) pointed out that earlier release seems to be working.
      By the time I decided, that I do not want any intelligence in my hardware and instead put the logic into the controller (I am using openhab). There it is quite easy to work with threads and move one down for 20 sec and then stop. It even shows me the position where it is when driving from the physical buttons. Another point which played a role, my shutters need different time for up and down (up mostly 54sec, down 50) and I do have various variations. some of the rollos only take 35 sec and my automated windows even just 25 sec for a full cycle. And instead of making the code more complicated and potentially send an update or setup parameter via the air to the note, I maintain it centrally in the controller.

      I have build shutter controllers for 1, 2 and 3 shutters on one board and all have the same logic.
      I do need to have full control via the physical buttons all the time. So when the controller decides to send them down and I do not want, I can go to the swich and stop it immediately. So basically, my logic is checking the pysical state of the swiches and what is sent from contoller and whatever is latest wins.
      I also thought maybe I should implement a possibility to block the controller from activation and overrule it by e.g. having the physical button pressed in but then I did not want to have them all the time in neutral or blocking the controller activation.
      Anyhow, my code is based on the relay example. It needs some cleanup for the physical button evaluations but I was too lazy to do this as most of my shutters are single nodes anyway and I have only 2 with 2 shutters on one board and 1 with 3. So for the moment there is some spaghettiy code.
      I am not working with timers, delays etc. in order to find the end spots, the shutters stop anyway at their end if properly installed and the physical buttons do not do anything differently - so why bother? I only have delays of 200ms when going from up to down etc. So basically before I trigger the relay for "down" I disable the one for "up" wait for 200ms and then trigger "down" just making sure there will never be power on both directions to save my motors.
      And finally, in order to "save" my relays I trigger from my controller a "stop" every now and then to all shutters in the house. In worst case, it might interfere with one rule but I can live with that.

      Here is the code based on mysensors for a node with 6 relays for 3 rollershutters attached to physical buttons:

      /**
         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
      */
      #include <MySigningNone.h>
      #include <MyTransportNRF24.h>
      #include <MyTransportRFM69.h>
      #include <MyHwATMega328.h>
      #include <MySensor.h>
      #include <SPI.h>
      
      #define RELAY_1  3  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #define NUMBER_OF_RELAYS 6 // 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);
      MyMessage sensorMsg2(2, 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 = 16;   // choose the input pin (for a up)
      int downPin1 = 17;   // 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 upPin2 = 18;   // choose the input pin (for a up)
      int downPin2 = 19;   // choose the input pin (for a down)
      int motorUp2 = 0;     // variable for reading the pin status
      int motorDown2 = 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;
      
      int switchState2 = 0; //0=off, 1=up, 2=down
      int tempSwitchState2 = 0; //0=off, 1=up, 2=down
      int rUnitPos2 = 0;
      
      // NRFRF24L01 radio driver (set low transmit power by default)
      MyTransportNRF24 radio(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW);
      //MyTransportRFM69 radio;
      // Message signing driver (none default)
      //MySigningNone signer;
      // Select AtMega328 hardware profile
      MyHwATMega328 hw;
      // Construct MySensors library
      MySensor gw(radio, hw);
      
      
      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);
          gw.send( sensorMsg0.set(0) );
        }
        else if (shutter == 1){
          Serial.println("A Shutter 1 going up.");
          digitalWrite (RELAY_1 + 3, LOW);
          delay(100);
          digitalWrite (RELAY_1 + 2, HIGH);
          gw.send( sensorMsg1.set(0) );
        }
        else if (shutter == 2){
          Serial.println("A Shutter 2 going up.");
          digitalWrite (RELAY_1 + 5, LOW);
          delay(100);
          digitalWrite (RELAY_1 + 4, HIGH);
          gw.send( sensorMsg2.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);
          gw.send( sensorMsg0.set(100) );
        }
        else if (shutter == 1){
          Serial.println("A Shutter 1 going down.");
          digitalWrite (RELAY_1 + 2, LOW);
          delay(100);
          digitalWrite (RELAY_1 + 3, HIGH);
          gw.send( sensorMsg1.set(100) );
      
        }
        else if (shutter == 2){
          Serial.println("A Shutter 2 going down.");
          digitalWrite (RELAY_1 + 4, LOW);
          delay(100);
          digitalWrite (RELAY_1 + 5, HIGH);
          gw.send( sensorMsg2.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 if (shutter == 1){
          Serial.println("A Shutter 1 halted.");
          digitalWrite (RELAY_1 + 2, LOW);
          digitalWrite (RELAY_1 + 3, LOW);
        }
          else if (shutter == 2){
          Serial.println("A Shutter 2 halted.");
          digitalWrite (RELAY_1 + 4, LOW);
          digitalWrite (RELAY_1 + 5, LOW);
        }
      }
      
      void setup()
      {
        pinMode(upPin0, INPUT);    // declare pushbutton as input
        pinMode(downPin0, INPUT);    // declare pushbutton as input
      
        
          pinMode(upPin1, INPUT);    // declare pushbutton as input
          pinMode(downPin1, INPUT);    // declare pushbutton as input
      
          pinMode(upPin2, INPUT);    // declare pushbutton as input
          pinMode(downPin2, INPUT);    // declare pushbutton as input
        
        // Initialize library and add callback for incoming messages
        gw.begin(incomingMessage, AUTO, true);
        // Send the sketch version information to the gateway and Controller
        gw.sendSketchInfo("RollerShutter Atrium", "1.0");
      
        // 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)
          gw.present(sensor, S_COVER);
          // Then set relay pins in output mode
          pinMode(pin, OUTPUT);
      
        }
      }
      
      
      void loop()
      {
        // Alway process incoming messages whenever possible
        gw.process();
      
        motorUp0   = digitalRead(upPin0);  // read input value
        motorDown0 = digitalRead(downPin0);  // read input value
         //relay 2
          motorUp1   = digitalRead(upPin1);  // read input value
          motorDown1 = digitalRead(downPin1);  // read input value
      
          motorUp2   = digitalRead(upPin2);  // read input value
          motorDown2 = digitalRead(downPin2);  // read input value
      
      
      //evaluate switch positions
        // GROUP 0
        if (motorUp0 == LOW && motorDown0 == HIGH) {
          switchState0 = 1;
          //Serial.println("SWITCH: " + String(switchState0)); //switch position
        }
        else if (motorDown0 == LOW && motorUp0 == HIGH) {
          switchState0 = 2;
          //Serial.println("SWITCH: " + String(switchState0)); //switch position
        }
        else if (motorDown0 == HIGH && motorUp0 == HIGH)
        {
          switchState0 = 0;
          //Serial.println("SWITCH: " + String(switchState0)); //switch position
        }
        // GROUP 1
          if (motorUp1 == LOW && motorDown1 == HIGH) {
            switchState1 = 1;
            //Serial.println("SWITCH: " + String(switchState1)); //switch position
          }
          else if (motorDown1 == LOW && motorUp1 == HIGH) {
            switchState1 = 2;
            //Serial.println("SWITCH: " + String(switchState1)); //switch position
          }
          else if (motorDown1 == HIGH && motorUp1 == HIGH)
          {
            switchState1 = 0;
            //Serial.println("SWITCH: " + String(switchState1)); //switch position
          }
      // GROUP 2
          if (motorUp2 == LOW && motorDown2 == HIGH) {
            switchState2 = 1;
            //Serial.println("SWITCH: " + String(switchState2)); //switch position
          }
          else if (motorDown2 == LOW && motorUp2 == HIGH) {
            switchState2 = 2;
            //Serial.println("SWITCH: " + String(switchState2)); //switch position
          }
          else if (motorDown2 == HIGH && motorUp2 == HIGH)
          {
            switchState2 = 0;
            //Serial.println("SWITCH: " + String(switchState2)); //switch position
          }
      
      
       //GROUP 0
        if (tempSwitchState0 != switchState0) //man only needed in case of changed switch state
        {
      
          if (motorUp0 == LOW && rUnitPos0 != 1) //man up
          {
            switchState0 = 1;
            tempSwitchState0 = 1;
            delay(200);
            shuttersUp(0);
            rUnitPos0 = 1;
            Serial.println("//////////////man 0 up");
            gw.send( sensorMsg0.set(0) );
          }
      
          if (motorDown0 == LOW && rUnitPos0 != 2) // man down
          {
            switchState0 = 2;
            tempSwitchState0 = 2;
            delay(200);
            shuttersDown(0);
            rUnitPos0 = 2;
            Serial.println("//////////////man 0 down");
            gw.send( sensorMsg0.set(100) );
          }
      
          if (motorUp0 == HIGH && motorDown0 == HIGH && rUnitPos0 != 0) //man stopp
          {
            switchState0 = 0;
            tempSwitchState0 = 0;
            delay(200);
            shuttersStop(0);
            rUnitPos0 = 0;
            Serial.println("//////////////man 0 stopp");
          }
      
        }
      
      
        //GROUP 1 
      
          if (tempSwitchState1 != switchState1) //man only needed in case of changed switch state
          {
      
          if (motorUp1 == LOW && rUnitPos1 != 1) //man up
          {
            switchState1 = 1;
            tempSwitchState1 = 1;
            shuttersUp(1);
            rUnitPos1 = 1;
            Serial.println("//////////////man 1 up");
            gw.send( sensorMsg1.set(0) );
          }
      
          if (motorDown1 == LOW && rUnitPos1 != 2) // man down
          {
            switchState1 = 2;
            tempSwitchState1 = 2;
            shuttersDown(1);
            rUnitPos1 = 2;
            Serial.println("//////////////man 1 down");
            gw.send( sensorMsg1.set(100) );
          }
      
          if (motorUp1 == HIGH && motorDown1 == HIGH && rUnitPos1 != 0) //man stopp
          {
            switchState1 = 0;
            tempSwitchState1 = 0;
            shuttersStop(1);
            rUnitPos1 = 0;
            Serial.println("//////////////man 1 stopp");
          }
      
          }
         //GROUP 2 
      
          if (tempSwitchState2 != switchState2) //man only needed in case of changed switch state
          {
      
          if (motorUp2 == LOW && rUnitPos2 != 1) //man up
          {
            switchState2 = 1;
            tempSwitchState2 = 1;
            shuttersUp(2);
            rUnitPos2 = 1;
            Serial.println("//////////////man 2 up");
            gw.send( sensorMsg2.set(0) );
          }
      
          if (motorDown2 == LOW && rUnitPos2 != 2) // man down
          {
            switchState2 = 2;
            tempSwitchState2 = 2;
            shuttersDown(2);
            rUnitPos2 = 2;
            Serial.println("//////////////man 2 down");
            gw.send( sensorMsg2.set(100) );
          }
      
          if (motorUp2 == HIGH && motorDown2 == HIGH && rUnitPos2 != 0) //man stop
          {
            switchState2 = 0;
            tempSwitchState2 = 0;
            shuttersStop(2);
            rUnitPos2 = 0;
            Serial.println("//////////////man 2 stopp");
          }
      
          }
      
      }
      
      void incomingMessage(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");
            //NOT IMPLEMENTED HERE
          }
      
          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));
        }
      }
      
      

      Cheers
      SJ

      posted in Development
      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: Hardware advice for newbe

      @Jasper-van-Winden
      well I was wrong. I had 13m CAT 5e cable laying around and just tested it with one DHT22 and it seems to be working:

      alt text
      alt text

      To consider:
      The Arduino Nano is powerd with a stable DC supply and it is only one DHT22, could be different outcome when you connect 5 of them all with long wires.

      posted in Hardware
      parachutesj
      parachutesj
    • RE: upgrading to 2.0

      @sundberg84 & @TheoL
      Thank you both. I have quite a few nodes out there and "ruining" the gateway would be not so great. However flashing it back with another PC might work, so will prepare that before there is no point of return 😉
      But good to know that a 2.0 GW seems to be working with 1.x nodes well.

      posted in Development
      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: Relay override using togle switch

      @carlos should work without problem.

      I had a similar use case. My rollershutters which do have up, down and stop/neutral positions. I coded it to oversteer the automatic any time. As soon as I press the switch it will do what I want. However at the moment the controller can send another state anytime afterwards.
      But what I had coded and set inactive is more or less what you are looking for.
      I just check if either button is pressed (up or down) and if so, then the comands from the controller are ignored. this is e.g. if you want to keep them up or down, only in stop/neutral it will accept the comands.
      So basically you need to check the state of the buttons. if either A or B is active (in your case on or off) it will not be overruled. only in case of middle position it will accept the comand.

      However after a few months of tests I am confident that it works.

      Cheers,
      SJ

      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: 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
    • Step by step (guide) to enable nodes as repeaters

      Moin,
      as I am struggling with the range of my nodes, I thought it is a must to enable them as repeaters when not running on batteries.
      I am a bit confused as I found different settings in forum compared to the API documentation.

      EDIT (after clarification): this is for code prior 2.0 release:
      In API it says it needs 3 steps:

      • Enable repeater-mode in gw.begin();
        gw.begin(NULL, AUTO, true)
      • Keep node awake all time (no slepping!)
      • calling process() in your loop()

      EDIT: this is for code from release 2.0 onwards:
      What I also found is a definition
      #define MY_REPEATER_FEATURE

      ~~So, what is that all about? ~~

      Thank you and best Regards,
      SJ

      posted in Troubleshooting
      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: 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: 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: 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: 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: [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: 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: 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: 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: 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: 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: 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