Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Relays and Scene Controller on same Node v1.4

Relays and Scene Controller on same Node v1.4

Scheduled Pinned Locked Moved My Project
scene controllerelaymultisensor
10 Posts 4 Posters 4.5k Views 1 Watching
  • 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.
  • D Offline
    D Offline
    Dalhoj
    wrote on last edited by
    #1

    I all

    I have just moved over to version 1.4beta and is trying to make a multisensor.
    I would like to have a Node that is a Relay Sensor for 5 relays and I Scene Controller for 6 buttons

    Here is my code, but it don't Work, can any one se what is wrong:
    Scene_Controller_6_buttons_and_5_Relays.ino

    RJ_MakeR 1 Reply Last reply
    0
    • D Dalhoj

      I all

      I have just moved over to version 1.4beta and is trying to make a multisensor.
      I would like to have a Node that is a Relay Sensor for 5 relays and I Scene Controller for 6 buttons

      Here is my code, but it don't Work, can any one se what is wrong:
      Scene_Controller_6_buttons_and_5_Relays.ino

      RJ_MakeR Offline
      RJ_MakeR Offline
      RJ_Make
      Hero Member
      wrote on last edited by
      #2

      @Dalhoj

      Maybe a detailed explanation as to what's not working??

      RJ_Make

      1 Reply Last reply
      0
      • hekH Offline
        hekH Offline
        hek
        Admin
        wrote on last edited by hek
        #3

        More precisely, What is not working? What does the serial monitor say?

        Are you powering the relays for an external power source (not via Arduino)?

        Darn.. you beat me to it @ServiceXp .

        D 1 Reply Last reply
        0
        • hekH hek

          More precisely, What is not working? What does the serial monitor say?

          Are you powering the relays for an external power source (not via Arduino)?

          Darn.. you beat me to it @ServiceXp .

          D Offline
          D Offline
          Dalhoj
          wrote on last edited by
          #4

          @hek

          True, then I try to include the node, only some of the sensors is discovered. then I can try a second time and some more sensors are included, but I there is stile 2 relays missing.

          The setup is to 5v relays who is shareing power supply with the arduino (5V) and tre leds for showing status. The leds are directly on the arduino pins with a recistor.

          The Scene controller part looks like its working, but in the serial monitor there is some errors:

          send: 2-2-0-0 s=3,c=1,t=20,pt=2,l=2,st=ok:0
          send: 2-2-0-0 s=3,c=1,t=19,pt=2,l=2,st=fail:0
          send: 2-2-0-0 s=3,c=1,t=20,pt=2,l=2,st=ok:0
          send: 2-2-0-0 s=3,c=1,t=19,pt=2,l=2,st=fail:0
          send: 2-2-0-0 s=3,c=1,t=20,pt=2,l=2,st=fail:0
          send: 2-2-0-0 s=3,c=1,t=19,pt=2,l=2,st=ok:0

          The Relays there is showed up in Vera are working oppersit so off in vera is ON in arduino.

          RJ_MakeR 1 Reply Last reply
          0
          • D Dalhoj

            @hek

            True, then I try to include the node, only some of the sensors is discovered. then I can try a second time and some more sensors are included, but I there is stile 2 relays missing.

            The setup is to 5v relays who is shareing power supply with the arduino (5V) and tre leds for showing status. The leds are directly on the arduino pins with a recistor.

            The Scene controller part looks like its working, but in the serial monitor there is some errors:

            send: 2-2-0-0 s=3,c=1,t=20,pt=2,l=2,st=ok:0
            send: 2-2-0-0 s=3,c=1,t=19,pt=2,l=2,st=fail:0
            send: 2-2-0-0 s=3,c=1,t=20,pt=2,l=2,st=ok:0
            send: 2-2-0-0 s=3,c=1,t=19,pt=2,l=2,st=fail:0
            send: 2-2-0-0 s=3,c=1,t=20,pt=2,l=2,st=fail:0
            send: 2-2-0-0 s=3,c=1,t=19,pt=2,l=2,st=ok:0

            The Relays there is showed up in Vera are working oppersit so off in vera is ON in arduino.

            RJ_MakeR Offline
            RJ_MakeR Offline
            RJ_Make
            Hero Member
            wrote on last edited by
            #5

            @Dalhoj
            Can't help with the first part. Are the relays low or high activated? If low, then I think you can fix that by changing
            #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

            TO

            	#define RELAY_ON 0  // GPIO value to write to turn on attached relay
            	#define RELAY_OFF 1 // GPIO value to write to turn off attached relay
            

            RJ_Make

            1 Reply Last reply
            0
            • D Offline
              D Offline
              Dalhoj
              wrote on last edited by
              #6

              I changed the relay_on to 0 and relay_off to 1, strange for in version 1.3 it should be the other way around, with the same hardware setup.

              I finialy managed to get all relays in Vera, just by trying to include the many times.

              I cant get the toggle function in advanced scenes to work on the arduino relay. It works fine on fibaro relays.
              is it a bug or?

              RJ_MakeR 1 Reply Last reply
              0
              • D Dalhoj

                I changed the relay_on to 0 and relay_off to 1, strange for in version 1.3 it should be the other way around, with the same hardware setup.

                I finialy managed to get all relays in Vera, just by trying to include the many times.

                I cant get the toggle function in advanced scenes to work on the arduino relay. It works fine on fibaro relays.
                is it a bug or?

                RJ_MakeR Offline
                RJ_MakeR Offline
                RJ_Make
                Hero Member
                wrote on last edited by
                #7

                @Dalhoj

                1. Are the relay's in sync now with Vera?
                2. I'm not sure I understand the question, but it sounds like it may be a scene controller specific thing, which I have no experience with.

                RJ_Make

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  Dalhoj
                  wrote on last edited by
                  #8

                  I can now see that the relays not allways are in sync on the vera. Some times when I press the ON button in the Vera GUI the still displays as OFF but the relay is on. Sometimes it changes to ON in the GUI after 5-10 sec. sometimes it never changes.

                  About the Toggle I mean when you create a new scene in Vera, there is the "Advanced" tab where I add the arduino relay sensor and choose "ToggleState" from the dropdown menu. I cant get it to work,

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    hhg
                    wrote on last edited by
                    #9

                    @Dalhoj j

                    Looking at your code from post #1 I think you have a sensor id conflict.

                    The relays are presented in the loop in line 37:

                    gw.present(sensor, S_LIGHT);
                    

                    where sensor is looping over 1 to 5

                    But in line 62 the Scene Controller is presented with sensor id 3 (CHILD_ID defined in line 14 to 3)

                    gw.present(CHILD_ID, S_SCENE_CONTROLLER); 
                    

                    So sensor id 3 is redefined. Will that work?

                    Or do I misread your code?

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      Dalhoj
                      wrote on last edited by
                      #10

                      Hi again

                      I think so to, here is the new code.

                      Scene_Controller_6_buttons_and_5_Relays.ino

                      I reduced the relays to 3, and all the devices is in vera, but the relay status update is stile slow / not happing

                      The scene controller has now child id = 0 and the relays 1-3.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      21

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.1k

                      Posts


                      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular