Navigation

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

    Posts made by JeeLet

    • Domoticz no Update

      Hello
      The Domoticz Controller is no longer up to date since Version 1.5 of MySensors
      the Bug with dual DHT Sensors is still not resolved

      the Yes in the table of S_TEMP and HUM is False
      https://www.mysensors.org/controller

      many requests
      https://easydomoticz.com/forum/viewtopic.php?t=7386

      Bybye

      posted in Domoticz
      JeeLet
      JeeLet
    • States Relay

      translate French--> Anglais

      Hello
      a request on the Eternal "status feedback" of a command.

      did the command activate my request?
      a can like an existential, to be or not to be

      My test model diagram
      Domoticz ----> Arduino output ----> Relay
      Domoticz <----- Arduino Input <----- °--°

      the scheme
      alt text

      a skit tampering

      /*
      *
       * compilation de 
       *  RelayActuator.ino et BinarySwitchSensor.ino
       *
       * LA DESCRIPTION
       * utilisation d'un contact auxilaire du relais pour retour d'etat d'une commande, 
       *
       *
       */
      
      
      //----------------------- Library Configuration ---------------------
       #define MY_DEBUG                          // uncomment to enable debug prints to serial monitor
      
       #define MY_NODE_ID 22                   /*Node en ID static*/
       
       #define MY_TRANSPORT_WAIT_READY_MS 3000 /*Tempo d'attente de mis en Com, des millisecondes*/ 
       #define  MY_SPLASH_SCREEN_DISABLED /*désactive écran de démarrage MySensors (économie 120oct. en flash)*/
      
      //-------------------------------Bus RS485--------------------------------
       #define MY_RS485       
       #define MY_RS485_DE_PIN 2
       #define MY_RS485_BAUD_RATE22 9600  /* débit du bus rs485*/
       // #define MY_RS485_HWSERIAL Serial1    /*pour Mega2560,Serial 1-2- ou 3 ? */
      
      //---------------------------------------------------------------------------
      
      #include <MySensors.h>
      #include <Bounce2.h>  /*anti rebond*/
      
      #define CHILD_ID 3 // contact enfant
      
      //--------------- contact-----------------------
      #define BUTTON_PIN  7   // Broche Arduino Digital I / O pour bouton / interrupteur reed
      
      //------------------ relay------------------------------
      #define RELAY_PIN 3  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #define NUMBER_OF_RELAYS 1 // 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
      
      //----------------- contact
      //Bounce debouncer = Bounce(); 
      //int oldValue=-1;
      
      Bounce debouncer = Bounce(); 
      int oldValue=0;
      bool state;
      
      // -----------------contact--------------------
      
      MyMessage msg(CHILD_ID,V_TRIPPED);  // V_LIGHT si vous utilisez S_LIGHT
      
      //MyMessage msg(CHILD_ID,V_LIGHT); 
      
      //-------------------- Relay--------------------------------
      //void before()
      //{
      //    for (int sensor=1, pin=RELAY_PIN; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
      //        pinMode(pin, OUTPUT);  // Then set relay pins in output mode
              // Set relay to last known state (using eeprom storage)
              //digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
      //    }
      //}
      //----------------------  *************-----------------------------------
      
      void setup()  
      {  
        // Configurer le bouton
        pinMode(BUTTON_PIN,INPUT_PULLUP);
        digitalWrite(BUTTON_PIN,HIGH);
        
        // configure le bouton et debounce
        debouncer.attach(BUTTON_PIN);
        debouncer.interval(5);
      
       // Assurez-vous que les relais sont désactivés au démarrage 
        digitalWrite(RELAY_PIN, RELAY_OFF);
        // Réglez ensuite les broches de relais en mode sortie 
        pinMode(RELAY_PIN, OUTPUT);     
        
      }
      
      void presentation()
        {
       //------------------ contact-----------------   
        // pouvez utiliser S_DOOR, S_MOTION ou S_LIGHT,  Si S_LIGHT est utilisé, 
        //n'oubliez pas de mettre à jour le type de variable que vous envoyez. Voir "msg" ci-dessus.
       // present(CHILD_ID, S_DOOR);  
        //----------------- ************----------------
      present(CHILD_ID, S_LIGHT);
        //-------------------- relay ---------------------------------------
            sendSketchInfo("Relay et State", "2.0");
      
          for (int sensor=1, pin=RELAY_PIN; sensor<=NUMBER_OF_RELAYS; sensor++, pin++)
          {
           present(sensor, S_BINARY);  // Register et  created as child devices
          }
       //--------------------****************-------------------------   
      }
      
      void loop() 
      {
      //      --------------- contact--------------  
        debouncer.update(); // control Etat contact 
        int value = debouncer.read(); // Récupère la valeur de mise à jour
      //-----------------------------
        if (value != oldValue && value==0) {
            send(msg.set(state?false:true), true); // Envoyer un nouvel état et demander un accusé de réception
        }
        oldValue = value;
      } 
      
      //------------------------------------------ 
      //  if (value != oldValue)  // Envoyer la nouvelle valeur
      //  {
      //     send(msg.set(value==HIGH ? 1 : 0));
      //     oldValue = value;
      //  }
      //} 
      //-----------------------------
      
      //  --------------------************-------------------  
      
      // -------------------- Relay-----------------------
      void receive(const MyMessage &message)
      {
      
      if (message.isAck()) {
           Serial.println("This is an ack from gateway");
        }
        
          // We only expect one type of message from controller. But we better check anyway.
         // if (message.getType()==V_STATUS) {
              // Change relay state
                   // digitalWrite(message.getSensor()-1+RELAY_PIN, message.getBool()?RELAY_ON:RELAY_OFF);
                  
            
      //-----------------cmd local----------------
       if (message.type == V_LIGHT) {
           // Change relay state
           state = message.getBool();
           digitalWrite(RELAY_PIN, state?RELAY_ON:RELAY_OFF);
              
      //-------------------------------------------        
              // Write some debug info
              Serial.print("    Incoming change for sensor:");
              Serial.println(message.getSensor());
              Serial.print("   New status: ");
              Serial.println(message.getBool());
      
              Serial.print(" etat contact ");
              Serial.println(oldValue);
              }
      }
      
      // ----------------- fin Pgm -----------------
      

      already made a request on
      but no answer. https://easydomoticz.com/forum/viewtopic.php?f=20&t=10601

      so how to activate the relay state in Domoticz

      Thank you

      posted in Domoticz
      JeeLet
      JeeLet
    • RE: Domoticz/Mysensors

      Yes errors on the commands given through domoticz
      only one in three and taken into account

      terminal copy serial

      Changement entrant pour le capteur:3, New status: 0
      Changement entrant pour le capteur:3, New status: 1
      Changement entrant pour le capteur:3, New status: 0
      Changement entrant pour le capteur:3, New status: 0
      Changement entrant pour le capteur:3, New status: 0
      Changement entrant pour le capteur:3, New status: 1
      Changement entrant pour le capteur:3, New status: 0
      Changement entrant pour le capteur:3, New status: 0
      

      ...and the local push button commands are not taken into account

      in the loop something that dies its tail ??

         // Inform controller if state change from input
          if (debouncer.update()) 
          {
              bool newState = !digitalRead(CONTROL_INPUT_PIN);
              if (newState != currentState)
              {
                  currentState = newState;
                  if (currentState != controllerState)
                  {
                      send(msg.set(currentState));
                  }
              }
          }
      

      merci Boum

      posted in Domoticz
      JeeLet
      JeeLet
    • RE: Domoticz/Mysensors

      @boum said in Domoticz/Mysensors:

      First, you probably should have started another thread rather than hijacking this one since the situation is barely related.

      Hello
      I just saw your message.
      nothing seen in my mailbox.

      yes that's true for another post, but the quest has the same 🙂
      to see if moderator or alco finds useful, is to do so.

      Thanks for paying attention to my problem, cool.

      I tested the sketch and the errors "MCO: PRO: RC" its part .... bingo

      but as nature hates emptiness, something else happens (nothing serious)

      .... a story of disregard for a local change / command / switchover of the TL

      I look better at your modifications to understand the arduino.
      thank you for the comments in the scketch

      my test model
      alt text

      Well!! where is the notifications button

      posted in Domoticz
      JeeLet
      JeeLet
    • RE: Domoticz/Mysensors

      ...I forgot the terminal debug

      .```
      ...set to OFF
      Changement entrant pour le capteur:3, New status: 0
      36376 TSF:MSG:SEND,24-24-0-0,s=3,c=1,t=2,pt=1,l=1,sg=0,ft=0,st=OK:0
      44859 TSF:MSG:READ,0-0-24,s=3,c=1,t=2,pt=0,l=1,sg=0:1
      44864 TSF:MSG:ECHO REQ
      44883 TSF:MSG:SEND,24-24-0-0,s=3,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=OK:1
      44890 !MCO:PRO:RC=1
      5080 !MCO:PRO:RC=1

      ....set to ON
      5080 !MCO:PRO:RC=1
      45082 !MCO:PRO:RC=1
      45084 !MCO:PRO:RC=1
      45086 !MCO:PRO:RC=1
      45088 !MCO:PRO:RC=1
      Changement entrant pour le capteur:3, New status: 1
      45127 TSF:MSG:SEND,24-24-0-0,s=3,c=1,t=2,pt=1,l=1,sg=0,ft=0,st=OK:1

      posted in Domoticz
      JeeLet
      JeeLet
    • RE: Domoticz/Mysensors

      hello, am french.

      no answer from Alco ??

      I simplify the code to understand how it works

      and put the diagram too

      alt text

      code:

      /*
      *  Alco_TL_Impuls_Light.ino
      *
      * https://forum.mysensors.org/topic/11263/domoticz-mysensors
      *
      *
      * REVISION HISTORY
      * Version 1.0 - Gateway Serial par Alco 
      * Version 0.0 - Node en RS485 par JeeLet
      * 
      *LA DESCRIPTION 
        * TL :Commande Impulsionnelle de TeLerupteur d'Eclairage 
        * TS :Retour d'Etat par un contact auxilaire du TL. 
        * 
        * L'installation Electrique n'est pas modifier, 
        * les bouton poussoir de l'habitat Cmd aussi le TL. 
        *  
        *  
        */ 
      
      //#define MY_DEBUG
      #define MY_NODE_ID 24           /*pour Node ID static*/
      
      /* ----- Module RS485 ----*/
       #define MY_RS485
       #define MY_RS485_DE_PIN 2
       #define MY_RS485_BAUD_RATE 9600
      // #define MY_RS485_HWSERIAL Serial1 /* Mega2560, port Serial X? */
      
      #include <MySensors.h>
      #include <Bounce2.h>
      
      #define CHILD_ID 3   /*Id du capteur (enfant)*/
      
      #define RELAY_PIN  4   // pin Cmd Telerupteur     "TL"
      #define BUTTON_PIN  3  // pin Contact Auxiliaire  "TS"
      
      #define RELAY_ON 1 
      #define RELAY_OFF 0
      
      Bounce debouncer = Bounce();  // initialize debouncer
      
      MyMessage msg(CHILD_ID,V_STATUS);
      
      void setup()
        {
        pinMode(BUTTON_PIN,INPUT_PULLUP);
        pinMode(RELAY_PIN , OUTPUT);
        digitalWrite(RELAY_PIN, RELAY_OFF);
        
        debouncer.attach(BUTTON_PIN);
        debouncer.interval(20); // minimum ?
        }
      
        bool state;
        boolean inputState;
      
      void presentation()
        {
        sendSketchInfo("Cmd TL", "1.a");
        present(BUTTON_PIN, S_LIGHT);
        }
      
      void loop()
        {
        if (debouncer.update()) 
         {
         inputState =! digitalRead(BUTTON_PIN);
         send(msg.set(inputState));
         }
        }
      
      void receive(const MyMessage &message)
        {
        if (message.isAck())
          {
           Serial.println("Ceci est un accusé de réception de la passerelle");
           Serial.println("Cmd TL 1.a");
          }
        if (message.type==V_STATUS) // V_STATUS pour MyS v2.0, annulé V_LIGHT. 
          {    
            //if (state = message.getBool () == true) {          
              //  state = message.getBool();
           
           digitalWrite(RELAY_PIN, RELAY_ON);
           wait(200);                          //delai On-Off Impuls
           digitalWrite(RELAY_PIN, RELAY_OFF);
          }
          
      // Write some debug info
         Serial.print("Changement entrant pour le capteur:");
         Serial.print(message.sensor);
         Serial.print(", New status: ");
         Serial.println(message.getBool());
         // }
        }
      // ------------ fin Pgm -----------
      

      the code is not good,dialogue errors :

      error on domoticz
      Error sending switch command, check device/hardware (idx=8) !

      Log:
      Error: MySensors: Repeating previous command (2/2)
      Error: MySensors: Command not received by Node !! (node_id: 24, child_id: 3)

      ??????

      thank you

      posted in Domoticz
      JeeLet
      JeeLet