• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login

    Setpoint for a Temperature

    Scheduled Pinned Locked Moved General Discussion
    17 Posts 2 Posters 1.0k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      JeeLet
      last edited by JeeLet

      id: GW2560
      description: Gateway USB
      ..... portname: /dev/ttyACM0

      ou node
      gatewayId: GW2560
      nodeId: '22'
      name: Clock

      as said in the link at the beginning of the post
      "I prefer that the basic logic is in the sensor node,... ." texte du lien

      Use the controller's calendar to change the day's values.

      the controller is the scheduler

      Merci Jkandasa

      jkandasaJ 1 Reply Last reply Reply Quote 0
      • jkandasaJ Offline
        jkandasa @JeeLet
        last edited by

        @JeeLet here is the yaml file to control from MyController
        on your sketch receive function process, a sensorId with 1 and V_STATUS variable. control your relay with the received payload

        customVariableType: none
        id: control_relay
        enabled: true
        type: simple
        spec:
          frequency: daily
          dayOfWeek: sun,mon,tue,wed,thu,fri,sat
          date: ''
          dayOfMonth: ''
          time: '20:51'
        validity: {}
        handlerParameters:
          turn_on: >-
            {"type":"resource_by_quick_id","disabled":"","data":"cmVzb3VyY2VUeXBlOiBmaWVsZApxdWlja0lkOiBHVzI1NjAuMjIuMS5WX1NUQVRVUwpwYXlsb2FkOiAnb24nCnByZURlbGF5OiAwcwo="}
          turn_off: >-
            {"type":"resource_by_quick_id","disabled":"","data":"cmVzb3VyY2VUeXBlOiBmaWVsZApxdWlja0lkOiBHVzI1NjAuMjIuMS5WX1NUQVRVUwpwYXlsb2FkOiAnb2ZmJwpwcmVEZWxheTogMWgK"}
        handlers:
          - resource_handler
        

        You can move all your schedule logic to your sketch. As mentioned here you have to use custom variable to submit your inputs.

        1 Reply Last reply Reply Quote 0
        • J Offline
          JeeLet
          last edited by

          Hello jkandasa

          Thank you for the information, I will test it in practice .

          yes I am often absent from the world of micro i,informatique at the moment 😞

          1 Reply Last reply Reply Quote 0
          • J Offline
            JeeLet
            last edited by JeeLet

            in the topic https://forum.mysensors.org/topic/4970/setting-parameters-in-nodes/12
            there is an interesting information

            "..... This way you can see what openhab is sending to your MySensors gateway. Here is how to do it
            Open an ssh connection to your openhab server
            Type ssh -p 8101 openhab@localhost.
            ......."

            the same thing is possible with MyController ???

            read in real time the MyC and MyS dialog and the Log

            jkandasaJ 1 Reply Last reply Reply Quote 0
            • jkandasaJ Offline
              jkandasa @JeeLet
              last edited by

              @JeeLet you can watch it in MyController,
              on your gateway setup enable message logger as follows,
              fefb4337-f323-482f-9510-e9c7fcdd9420-image.png

              On the computer where MyController is running, got to MyController directory, you can see a logs directory. there is file will be named as your gateway name, tail it

              logs/
              └── gateway_logs
                  β”œβ”€β”€ gw_mysensor.log
              
              tail -f logs/gateway_logs/gw_mysensor.log
              
              2022-06-03T14:43:04.941+0530	Recd	out_rfm69/31/4/1/0/24			917730
              2022-06-03T14:43:05.579+0530	Recd	out_rfm69/31/5/1/0/24			989894
              2022-06-03T14:43:06.008+0530	Recd	out_rfm69/31/6/1/0/24			998194
              2022-06-03T14:43:06.494+0530	Recd	out_rfm69/1/1/1/0/25			72
              2022-06-03T14:43:06.665+0530	Recd	out_rfm69/31/4/1/0/25			512
              2022-06-03T14:43:06.816+0530	Recd	out_rfm69/1/1/1/0/35			65.00
              2022-06-03T14:43:07.389+0530	Recd	out_rfm69/31/4/1/0/37			49.94
              2022-06-03T14:43:07.740+0530	Recd	out_rfm69/31/5/1/0/37			49.94
              2022-06-03T14:43:08.419+0530	Recd	out_rfm69/31/6/1/0/37			32.00
              2022-06-03T14:43:09.129+0530	Recd	out_rfm69/31/4/1/0/26			1
              2022-06-03T14:43:11.066+0530	Recd	out_rfm69/13/1/1/0/38			244.01
              2022-06-03T14:43:11.485+0530	Recd	out_rfm69/13/1/1/0/39			0.00
              2022-06-03T14:43:12.026+0530	Sent	in_rfm69/13/1/1/1/35			65
              2022-06-03T14:43:12.872+0530	Recd	out_rfm69/13/1/1/1/35			65
              2022-06-03T14:43:13.635+0530	Recd	out_rfm69/13/255/3/0/1			
              2022-06-03T14:43:13.660+0530	Sent	in_rfm69/13/255/3/1/1			1654267393
              2022-06-03T14:43:14.463+0530	Recd	out_rfm69/13/255/3/1/1			1654267393
              
              1 Reply Last reply Reply Quote 0
              • J Offline
                JeeLet
                last edited by

                xxxi@odroidc2:/opt/apps/mycontroller$ tail -f executable/mc_home/logs/gateway_logs/gw_GW2560.log
                2022-06-03T12:10:23.225+0200	recd	0;12;1;0;0;0.0
                2022-06-03T12:10:23.225+0200	recd	0;13;1;0;1;0.0
                2022-06-03T12:10:43.728+0200	recd	0;255;3;0;9;620470 .
                
                

                πŸ‘

                1 Reply Last reply Reply Quote 0
                • J Offline
                  JeeLet
                  last edited by JeeLet

                  Hello
                  here is my sketch is clean and functional.
                  the values sent with the bodyboard work well.

                  one step finished

                  now i tried with the examples of the schedules you gave me, and well i'm lost πŸ™‚

                  I recapitulate the need.

                  MyC sends at a certain time or day, the value of on and off
                  for the time slots of the relay on the clock.

                  integer values without comma,
                  example : 1630 for 16hours 30minutes.
                  the sketch of MyS manages with πŸ™‚

                  Thanks for your help.
                  many stars in the sky for you

                  the recopies and other info

                  text alternatif

                  the parts of the sketch

                  ...
                  // ------ objet - MyS numero du Node ------
                    #define CHILD_ID_2 2      //On time
                    #define CHILD_ID_4 4      //Off time
                   ...
                  //----------- test commande Relay ----------------    
                      int ledPin = 7;               // test Assigned Pin for Relay Module
                     
                       int requestOn;
                     int requestOff;
                  
                  //----- MyS ------
                     MyMessage dimmerMsg(CHILD_ID_2, V_PERCENTAGE);  //hour walk
                     MyMessage dimmerMsg4(CHILD_ID_4, V_PERCENTAGE);  //stop time
                     
                     bool info;              //  for your information GW sur MyC
                  
                  //---------------- SETUP ----------------------------
                  
                    void setup()  {  
                  
                  ...
                  //---- test set point -----
                    send(dimmerMsg.set(info)); 
                    send(dimmerMsg4.set(info));
                    }
                  
                  //--------------MySensors-------------
                  
                    void presentation()  {
                    
                     sendSketchInfo("Clock", "2.0"); 
                     present( CHILD_ID_2, S_DIMMER, "Debut" ); // Register the LED Dimmable Light with the gateway
                     present( CHILD_ID_4, S_DIMMER, "Fin" );
                        
                      }
                  
                  //------------------ LOOP -----------------------
                    void loop() {     
                    
                   ....        
                  //----- commande Relay dans une plage horaire  -----
                  timecurrent =  hour()*100 + minute();   // Conversion des heure en minutes
                   
                  //----- reception set time On Off ------------ 
                   int requestedLevel = atoi( message.data ); //RΓ©cupΓ©rer la valeur Γ  partir du message 
                        
                  //----- limite valeur entrant dans la plage valide 0 to 2400 ------
                      requestedLevel = requestedLevel > 2400 ? 2400 : requestedLevel;
                      requestedLevel = requestedLevel < 0   ? 0   : requestedLevel;
                      
                       if((requestedLevel % 100) > 59) { requestedLevel = 00; }
                       
                  //----- trie des messages -------
                    switch (message.sensor) {
                      case 2:                          // message  1
                        requestOn = requestedLevel;       
                      break;
                     
                      case 4:                       // message  2
                        requestOff = requestedLevel;
                      break;       
                     }   
                  
                  //----- commande Relay dans une plage horaire  -----   
                     if (timecurrent >= requestOn && timecurrent <= requestOff)  { 
                        digitalWrite(ledPin, HIGH); }
                    else {
                        digitalWrite(ledPin, LOW);  }
                  
                  
                  //----- return value for MyC -------
                      send( dimmerMsg.set(requestOn) );
                      send( dimmerMsg4.set(requestOff) );
                      
                      }
                    }
                  
                  jkandasaJ 1 Reply Last reply Reply Quote 1
                  • jkandasaJ Offline
                    jkandasa @JeeLet
                    last edited by

                    @JeeLet good to know that you achieved your requirement. thanks for sharing the final result

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      JeeLet
                      last edited by

                      text alternatif

                      No, the commands through the Schedules are not sent.

                      I waited for the night, but nothing happens on the Arduino.

                      Sending with widgets is fine

                      jkandasaJ 1 Reply Last reply Reply Quote 0
                      • jkandasaJ Offline
                        jkandasa @JeeLet
                        last edited by

                        Hi @JeeLet for your schedule variables are not required and in Parameters to handler select Resource By Quick ID and add your payload.

                        But you are controlling time based action on your arduino sketch, but still why do you want to send the config payload from MyController schedule?

                        In your case controlling the V_STATUS (led or relay) directly, then you can use MyController Scheduler, otherwise you can go with your arduino sketch schedule

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          JeeLet
                          last edited by JeeLet

                          hello jkandasa

                          "...but why do you want to send the configuration payload from the MyController calendar?" for each Node to be autonomous, the principle of distributed intelligence, no centralization, the MyC Controller can be turned off or the link cut (and also to test MyC πŸ™‚ )

                          "otherwise you can use your arduino sketch program" ... Yes
                          MyC sends a time setting for the drift of the Arduino and also the management of time slots.
                          (afterwards the Gateways will have a RTC clock)

                          Thanks

                          Parameters to handler select Resource By Quick ID and add your payload.
                          
                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          0

                          Online

                          587

                          Users

                          529

                          Topics

                          3.4k

                          Posts
                          Copyright Β© 2015-2025 MyController.org | Contributors | Localization