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. Combined MySensor Gateway with 433Mhz transmitter (HomeEasy/Klik-Aan-Klik-uit)

Combined MySensor Gateway with 433Mhz transmitter (HomeEasy/Klik-Aan-Klik-uit)

Scheduled Pinned Locked Moved My Project
26 Posts 13 Posters 29.6k Views 11 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.
  • M mvader

    @TheoL said:

    someone is interested I'm happy to share the Sketch.

    sure please share.. does it work on the ethernet gateway?
    i was looking at barte's code and it looks like it's only for serial

    TheoLT Online
    TheoLT Online
    TheoL
    Contest Winner
    wrote on last edited by
    #13

    @mvader Since it's just a Sensor it should work on any Gateway. After it's running you should see a new device in Domoticz with 5 sub nodes. They's all of the type lightning 2. Each sub device represents one of the swicthes on the impuls remote controller. The system code has to be adjusted to your own system code. On my outlets the dipswitches are all on, see the byte is 31.

     * MySensors node for switching on/of cheap 433Mhz based Power outlets from the Action
     * Author  Theo Leloux
     * Created 05-09-2015
     * Version 0.1alpha
     */
    
    /**
     * Import the libraries needed by the Sketch
     */
    #include <MySensor.h>  
    #include <SPI.h>
    #include <RemoteTransmitter.h>
     
    /**
     * Declare constants like pin settings etc.
     */
    #define TRANSMITTERPIN 6 // documentation doesn't see anything if the needs to be a PWM, but why take the risk?
    #define CHILD_ID_ACTION_SWITCH_A 1 // Declare the DEVICE A as a separate switch
    #define CHILD_ID_ACTION_SWITCH_B 2 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
    #define CHILD_ID_ACTION_SWITCH_C 3 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
    #define CHILD_ID_ACTION_SWITCH_D 4 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
    #define CHILD_ID_ACTION_SWITCH_E 5 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
    const char SYSTEMCODE = char(31); // cast the integer byte value to a char should do the trick. Adjust this to your own SYSTEMCODE see RemoteTransmitter.h
     
    /*
     * Declare variables
     */
    ActionTransmitter switchTransmitter = ActionTransmitter( TRANSMITTERPIN ); 
    unsigned long SLEEP_TIME = 5000; // the main loop will probably won't do a thing if we only attach a transmitter.
    MySensor gw;
     
    /*
     * Declare MySensors Messages
     */
    MyMessage msgDeviceA( CHILD_ID_ACTION_SWITCH_A, V_LIGHT );
    MyMessage msgDeviceB( CHILD_ID_ACTION_SWITCH_B, V_LIGHT );
    MyMessage msgDeviceC( CHILD_ID_ACTION_SWITCH_C, V_LIGHT );
    MyMessage msgDeviceD( CHILD_ID_ACTION_SWITCH_D, V_LIGHT );
    MyMessage msgDeviceE( CHILD_ID_ACTION_SWITCH_E, V_LIGHT );
    
    /**
     * Preparation code during initialization of the Arduino
     */
    void setup() {
      // put your setup code here, to run once:
      // Serial.begin( 115200 );
      gw.begin( incomingMessage ); // attach a message handler for handling commands transmitted by the controller.
    
      gw.sendSketchInfo("433Mhz bridge", "1.0");       // Send the sketch version information to the gateway and Controller
      gw.present( CHILD_ID_ACTION_SWITCH_A, S_LIGHT ); // Present Device A to the gateway
      gw.present( CHILD_ID_ACTION_SWITCH_B, S_LIGHT ); // Present Device B to the gateway
      gw.present( CHILD_ID_ACTION_SWITCH_C, S_LIGHT ); // Present Device C to the gateway
      gw.present( CHILD_ID_ACTION_SWITCH_D, S_LIGHT ); // Present Device D to the gateway
      gw.present( CHILD_ID_ACTION_SWITCH_E, S_LIGHT ); // Present Device E to the gateway
      
      gw.sendBatteryLevel(100); // It just looks better in Domoticz if we let Domoticz no we're running on 100% power.
    
    }
    
    /**
     * The Sketch's main loop.
     */
    void loop() {
      // I have nothing to do if only attach a transmitter. 
      gw.wait( SLEEP_TIME ); // call the wait routine, which will allow for incomming messages during the waiting
    }
    
    void incomingMessage(const MyMessage &message) {
      Serial.println("message");
      // We only expect one type of message from controller. But we better check anyway.
      if (message.type==V_LIGHT) {
        char device = 64 + message.sensor; // translate child id to device ID. A = 65 so if we take off one and add the received sensor ID we get the correct device
      //  Serial.println( "Command received for Device " + (String)device + " on id " + (String)message.sensor + " request to turn " + (message.getBool()?"on":"off") );
        if ( device >= 'A' && device <= 'E' ) { // Impuls/Action system only allows device 'A' to 'E'
          switchTransmitter.sendSignal(SYSTEMCODE, device, message.getBool() );
        }
      }
    }
    

    I attached the 433 Mhz data line to pin 6 of the arduino. Not sure if it needs PWM. But I just started an hour ago and haven't had the time yet to look that up. For around 15 euro I'm able to control all my cheap 433Mhz outlets with Domoticz. I feel like a little kid in a candy shop ;)

    Next thing to do is to hook up the receiver. So that I can receive the commands from the remote controller and send them to Domoticz. Work in progress hope to finish it this evening. But the reciever library has no support for impuls, so it might take a while.

    M A Michel - ItM 3 Replies Last reply
    2
    • TheoLT TheoL

      @mvader Since it's just a Sensor it should work on any Gateway. After it's running you should see a new device in Domoticz with 5 sub nodes. They's all of the type lightning 2. Each sub device represents one of the swicthes on the impuls remote controller. The system code has to be adjusted to your own system code. On my outlets the dipswitches are all on, see the byte is 31.

       * MySensors node for switching on/of cheap 433Mhz based Power outlets from the Action
       * Author  Theo Leloux
       * Created 05-09-2015
       * Version 0.1alpha
       */
      
      /**
       * Import the libraries needed by the Sketch
       */
      #include <MySensor.h>  
      #include <SPI.h>
      #include <RemoteTransmitter.h>
       
      /**
       * Declare constants like pin settings etc.
       */
      #define TRANSMITTERPIN 6 // documentation doesn't see anything if the needs to be a PWM, but why take the risk?
      #define CHILD_ID_ACTION_SWITCH_A 1 // Declare the DEVICE A as a separate switch
      #define CHILD_ID_ACTION_SWITCH_B 2 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
      #define CHILD_ID_ACTION_SWITCH_C 3 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
      #define CHILD_ID_ACTION_SWITCH_D 4 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
      #define CHILD_ID_ACTION_SWITCH_E 5 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
      const char SYSTEMCODE = char(31); // cast the integer byte value to a char should do the trick. Adjust this to your own SYSTEMCODE see RemoteTransmitter.h
       
      /*
       * Declare variables
       */
      ActionTransmitter switchTransmitter = ActionTransmitter( TRANSMITTERPIN ); 
      unsigned long SLEEP_TIME = 5000; // the main loop will probably won't do a thing if we only attach a transmitter.
      MySensor gw;
       
      /*
       * Declare MySensors Messages
       */
      MyMessage msgDeviceA( CHILD_ID_ACTION_SWITCH_A, V_LIGHT );
      MyMessage msgDeviceB( CHILD_ID_ACTION_SWITCH_B, V_LIGHT );
      MyMessage msgDeviceC( CHILD_ID_ACTION_SWITCH_C, V_LIGHT );
      MyMessage msgDeviceD( CHILD_ID_ACTION_SWITCH_D, V_LIGHT );
      MyMessage msgDeviceE( CHILD_ID_ACTION_SWITCH_E, V_LIGHT );
      
      /**
       * Preparation code during initialization of the Arduino
       */
      void setup() {
        // put your setup code here, to run once:
        // Serial.begin( 115200 );
        gw.begin( incomingMessage ); // attach a message handler for handling commands transmitted by the controller.
      
        gw.sendSketchInfo("433Mhz bridge", "1.0");       // Send the sketch version information to the gateway and Controller
        gw.present( CHILD_ID_ACTION_SWITCH_A, S_LIGHT ); // Present Device A to the gateway
        gw.present( CHILD_ID_ACTION_SWITCH_B, S_LIGHT ); // Present Device B to the gateway
        gw.present( CHILD_ID_ACTION_SWITCH_C, S_LIGHT ); // Present Device C to the gateway
        gw.present( CHILD_ID_ACTION_SWITCH_D, S_LIGHT ); // Present Device D to the gateway
        gw.present( CHILD_ID_ACTION_SWITCH_E, S_LIGHT ); // Present Device E to the gateway
        
        gw.sendBatteryLevel(100); // It just looks better in Domoticz if we let Domoticz no we're running on 100% power.
      
      }
      
      /**
       * The Sketch's main loop.
       */
      void loop() {
        // I have nothing to do if only attach a transmitter. 
        gw.wait( SLEEP_TIME ); // call the wait routine, which will allow for incomming messages during the waiting
      }
      
      void incomingMessage(const MyMessage &message) {
        Serial.println("message");
        // We only expect one type of message from controller. But we better check anyway.
        if (message.type==V_LIGHT) {
          char device = 64 + message.sensor; // translate child id to device ID. A = 65 so if we take off one and add the received sensor ID we get the correct device
        //  Serial.println( "Command received for Device " + (String)device + " on id " + (String)message.sensor + " request to turn " + (message.getBool()?"on":"off") );
          if ( device >= 'A' && device <= 'E' ) { // Impuls/Action system only allows device 'A' to 'E'
            switchTransmitter.sendSignal(SYSTEMCODE, device, message.getBool() );
          }
        }
      }
      

      I attached the 433 Mhz data line to pin 6 of the arduino. Not sure if it needs PWM. But I just started an hour ago and haven't had the time yet to look that up. For around 15 euro I'm able to control all my cheap 433Mhz outlets with Domoticz. I feel like a little kid in a candy shop ;)

      Next thing to do is to hook up the receiver. So that I can receive the commands from the remote controller and send them to Domoticz. Work in progress hope to finish it this evening. But the reciever library has no support for impuls, so it might take a while.

      M Offline
      M Offline
      mvader
      wrote on last edited by
      #14

      @TheoL so you put the 433mhz transmitter on a separate sensor?
      the way that i was thinking the OP had done it and as i had thought of doing it
      was to put the 433mhz transmitter on the gateway itself.
      but i imagine it would work either way.

      TheoLT 1 Reply Last reply
      0
      • M mvader

        @TheoL so you put the 433mhz transmitter on a separate sensor?
        the way that i was thinking the OP had done it and as i had thought of doing it
        was to put the 433mhz transmitter on the gateway itself.
        but i imagine it would work either way.

        TheoLT Online
        TheoLT Online
        TheoL
        Contest Winner
        wrote on last edited by
        #15

        @mvader Yes for me it's easier and actually the only way. My gateway is not located in my living room, but in the closet with my energy meter. 2.4 Ghz can reach my living room, but the 433Mhz just doesn't get there. So be adding a sensor node, which acts as a 5 switch controller I can control the power outlets. In my bedroom I have some other Impuls power outlets. So I'll just install another gateway or bridge there as well and I'll be done.

        I'm having a hard time decoding the remote control commands. It should be an easy to decode bitpattern. But it's getting late. I'll try to solve this puzzle tomorrow.

        M AWIA 2 Replies Last reply
        0
        • TheoLT TheoL

          @mvader Yes for me it's easier and actually the only way. My gateway is not located in my living room, but in the closet with my energy meter. 2.4 Ghz can reach my living room, but the 433Mhz just doesn't get there. So be adding a sensor node, which acts as a 5 switch controller I can control the power outlets. In my bedroom I have some other Impuls power outlets. So I'll just install another gateway or bridge there as well and I'll be done.

          I'm having a hard time decoding the remote control commands. It should be an easy to decode bitpattern. But it's getting late. I'll try to solve this puzzle tomorrow.

          M Offline
          M Offline
          mvader
          wrote on last edited by
          #16

          @TheoL i'm not sure what hardware you are using.but i have the etekcity ZAP 433 remote & outlets.
          i just bought a 433 mhz transceiver off ebay and hooked it up to my raspberry pi2 and sniffed the codes.
          i found it easier than going the arduino route. however the whole intention was to run this off the mysensors network i'm building. so the RPI2 was just for sniffing the codes.

          afenoA 1 Reply Last reply
          0
          • TheoLT TheoL

            @mvader Yes for me it's easier and actually the only way. My gateway is not located in my living room, but in the closet with my energy meter. 2.4 Ghz can reach my living room, but the 433Mhz just doesn't get there. So be adding a sensor node, which acts as a 5 switch controller I can control the power outlets. In my bedroom I have some other Impuls power outlets. So I'll just install another gateway or bridge there as well and I'll be done.

            I'm having a hard time decoding the remote control commands. It should be an easy to decode bitpattern. But it's getting late. I'll try to solve this puzzle tomorrow.

            AWIA Offline
            AWIA Offline
            AWI
            Hero Member
            wrote on last edited by
            #17

            @TheoL you can take a look at the RFlink project. This is arduino based, open source and can handle most protocols. It is also great for sniffing codes in Debug mode...

            1 Reply Last reply
            0
            • B Offline
              B Offline
              Bazeman
              wrote on last edited by
              #18

              RFLink and Domoticz work great together with klik aan klik uit and my Alecto WS 3500 weather station. Also receiving weather sensors from my neighbours. Next project is building Mysensors.org sensors. RFLink works alsoas an gateway.

              1 Reply Last reply
              0
              • TheoLT Online
                TheoLT Online
                TheoL
                Contest Winner
                wrote on last edited by
                #19

                @mvader I just hooked up a set of cheap 433mhz transmitter and receiver (see http://www.seeedstudio.com/depot/images/product/rf433k.jpg). I added a 20 cm wire as an antena to the transmitter. which worked out great. The transmitter on the arduino has a larger transmitting range than my remote control!

                @AWI sniffing wasn't the problem. I received all commands send by my remote control, the impuls protocol should be really simpel. SYSTEMCODE (5 bits) device (5 bits) command (2 bits). But it seems like they use some kind of encoding mechanism, because the bit pattern I receive doesn't follow that pattern. I'll have to lookup how to decode trits (for whatever that may be)

                @Bazeman RFlink looks really cool, thanks for the advice. But I think I'll try to get this to work somehow. I'm close to the solution, and I only need a bridge for my Impuls power outleds. As tempting as it is to use my neighbours weatherstation, I don't want to depend on him changing the batteries in time. I have a frost alarm that wakes me up earlier during wintertime, whenever I have to remove the ice from the windows of my car. For the moment I'm using the forecast IO services for measuring outside weather conditions.

                Besides i'm a DIY kind of guy. I like to make and design things myself. I want to build the solar powered weather station comming winter. As of now I have to leave the 433mHz bridge as is. Because I'm having some guest whom will be staying with us for the next two weeks. They will sleep in the room in which I do my electronic stuff. I have to clean that up :(

                B 1 Reply Last reply
                0
                • TheoLT TheoL

                  @mvader I just hooked up a set of cheap 433mhz transmitter and receiver (see http://www.seeedstudio.com/depot/images/product/rf433k.jpg). I added a 20 cm wire as an antena to the transmitter. which worked out great. The transmitter on the arduino has a larger transmitting range than my remote control!

                  @AWI sniffing wasn't the problem. I received all commands send by my remote control, the impuls protocol should be really simpel. SYSTEMCODE (5 bits) device (5 bits) command (2 bits). But it seems like they use some kind of encoding mechanism, because the bit pattern I receive doesn't follow that pattern. I'll have to lookup how to decode trits (for whatever that may be)

                  @Bazeman RFlink looks really cool, thanks for the advice. But I think I'll try to get this to work somehow. I'm close to the solution, and I only need a bridge for my Impuls power outleds. As tempting as it is to use my neighbours weatherstation, I don't want to depend on him changing the batteries in time. I have a frost alarm that wakes me up earlier during wintertime, whenever I have to remove the ice from the windows of my car. For the moment I'm using the forecast IO services for measuring outside weather conditions.

                  Besides i'm a DIY kind of guy. I like to make and design things myself. I want to build the solar powered weather station comming winter. As of now I have to leave the 433mHz bridge as is. Because I'm having some guest whom will be staying with us for the next two weeks. They will sleep in the room in which I do my electronic stuff. I have to clean that up :(

                  B Offline
                  B Offline
                  Bazeman
                  wrote on last edited by
                  #20

                  @TheoL I'm going to build de outdoor solar weather station, also! Busy with ordering the parts on Ebay.

                  1 Reply Last reply
                  0
                  • TheoLT TheoL

                    @mvader Since it's just a Sensor it should work on any Gateway. After it's running you should see a new device in Domoticz with 5 sub nodes. They's all of the type lightning 2. Each sub device represents one of the swicthes on the impuls remote controller. The system code has to be adjusted to your own system code. On my outlets the dipswitches are all on, see the byte is 31.

                     * MySensors node for switching on/of cheap 433Mhz based Power outlets from the Action
                     * Author  Theo Leloux
                     * Created 05-09-2015
                     * Version 0.1alpha
                     */
                    
                    /**
                     * Import the libraries needed by the Sketch
                     */
                    #include <MySensor.h>  
                    #include <SPI.h>
                    #include <RemoteTransmitter.h>
                     
                    /**
                     * Declare constants like pin settings etc.
                     */
                    #define TRANSMITTERPIN 6 // documentation doesn't see anything if the needs to be a PWM, but why take the risk?
                    #define CHILD_ID_ACTION_SWITCH_A 1 // Declare the DEVICE A as a separate switch
                    #define CHILD_ID_ACTION_SWITCH_B 2 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
                    #define CHILD_ID_ACTION_SWITCH_C 3 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
                    #define CHILD_ID_ACTION_SWITCH_D 4 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
                    #define CHILD_ID_ACTION_SWITCH_E 5 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
                    const char SYSTEMCODE = char(31); // cast the integer byte value to a char should do the trick. Adjust this to your own SYSTEMCODE see RemoteTransmitter.h
                     
                    /*
                     * Declare variables
                     */
                    ActionTransmitter switchTransmitter = ActionTransmitter( TRANSMITTERPIN ); 
                    unsigned long SLEEP_TIME = 5000; // the main loop will probably won't do a thing if we only attach a transmitter.
                    MySensor gw;
                     
                    /*
                     * Declare MySensors Messages
                     */
                    MyMessage msgDeviceA( CHILD_ID_ACTION_SWITCH_A, V_LIGHT );
                    MyMessage msgDeviceB( CHILD_ID_ACTION_SWITCH_B, V_LIGHT );
                    MyMessage msgDeviceC( CHILD_ID_ACTION_SWITCH_C, V_LIGHT );
                    MyMessage msgDeviceD( CHILD_ID_ACTION_SWITCH_D, V_LIGHT );
                    MyMessage msgDeviceE( CHILD_ID_ACTION_SWITCH_E, V_LIGHT );
                    
                    /**
                     * Preparation code during initialization of the Arduino
                     */
                    void setup() {
                      // put your setup code here, to run once:
                      // Serial.begin( 115200 );
                      gw.begin( incomingMessage ); // attach a message handler for handling commands transmitted by the controller.
                    
                      gw.sendSketchInfo("433Mhz bridge", "1.0");       // Send the sketch version information to the gateway and Controller
                      gw.present( CHILD_ID_ACTION_SWITCH_A, S_LIGHT ); // Present Device A to the gateway
                      gw.present( CHILD_ID_ACTION_SWITCH_B, S_LIGHT ); // Present Device B to the gateway
                      gw.present( CHILD_ID_ACTION_SWITCH_C, S_LIGHT ); // Present Device C to the gateway
                      gw.present( CHILD_ID_ACTION_SWITCH_D, S_LIGHT ); // Present Device D to the gateway
                      gw.present( CHILD_ID_ACTION_SWITCH_E, S_LIGHT ); // Present Device E to the gateway
                      
                      gw.sendBatteryLevel(100); // It just looks better in Domoticz if we let Domoticz no we're running on 100% power.
                    
                    }
                    
                    /**
                     * The Sketch's main loop.
                     */
                    void loop() {
                      // I have nothing to do if only attach a transmitter. 
                      gw.wait( SLEEP_TIME ); // call the wait routine, which will allow for incomming messages during the waiting
                    }
                    
                    void incomingMessage(const MyMessage &message) {
                      Serial.println("message");
                      // We only expect one type of message from controller. But we better check anyway.
                      if (message.type==V_LIGHT) {
                        char device = 64 + message.sensor; // translate child id to device ID. A = 65 so if we take off one and add the received sensor ID we get the correct device
                      //  Serial.println( "Command received for Device " + (String)device + " on id " + (String)message.sensor + " request to turn " + (message.getBool()?"on":"off") );
                        if ( device >= 'A' && device <= 'E' ) { // Impuls/Action system only allows device 'A' to 'E'
                          switchTransmitter.sendSignal(SYSTEMCODE, device, message.getBool() );
                        }
                      }
                    }
                    

                    I attached the 433 Mhz data line to pin 6 of the arduino. Not sure if it needs PWM. But I just started an hour ago and haven't had the time yet to look that up. For around 15 euro I'm able to control all my cheap 433Mhz outlets with Domoticz. I feel like a little kid in a candy shop ;)

                    Next thing to do is to hook up the receiver. So that I can receive the commands from the remote controller and send them to Domoticz. Work in progress hope to finish it this evening. But the reciever library has no support for impuls, so it might take a while.

                    A Offline
                    A Offline
                    ArieKanarie
                    wrote on last edited by
                    #21

                    @TheoL said:

                    • MySensors node for switching on/of cheap 433Mhz based Power outlets from the Action
                    • Author Theo Leloux
                    • Created 05-09-2015
                    • Version 0.1alpha
                      */

                    ould you give me hint how to change this for a kaku tranmitter?
                    The one that uses this command:

                      //Switch off KaKu-device 10 on address M
                      kaKuSwitch.sendSignal('M',10,false);
                    
                      //Switch on KaKu-device 10 on address M
                      kaKuSwitch.sendSignal('M',10,true);
                    
                    TheoLT 1 Reply Last reply
                    0
                    • A ArieKanarie

                      @TheoL said:

                      • MySensors node for switching on/of cheap 433Mhz based Power outlets from the Action
                      • Author Theo Leloux
                      • Created 05-09-2015
                      • Version 0.1alpha
                        */

                      ould you give me hint how to change this for a kaku tranmitter?
                      The one that uses this command:

                        //Switch off KaKu-device 10 on address M
                        kaKuSwitch.sendSignal('M',10,false);
                      
                        //Switch on KaKu-device 10 on address M
                        kaKuSwitch.sendSignal('M',10,true);
                      
                      TheoLT Online
                      TheoLT Online
                      TheoL
                      Contest Winner
                      wrote on last edited by
                      #22

                      @ArieKanarie I'd love to. But I don't have any kaku transmitter on which I can test it. Well I could use the Kaku wall plugs from my neighbours, but I don't think they'd be happy with it ;-)

                      I recently bought an RFXtrx433E for controlling my Somfy blinds which really works well for controlling a lot of 433 Mhz devices, like KaKu. That's why I know my neighbours use KaKu. I use the RFX for controlling the Action remote controlled plugs. There's only one thing that the RFX can't do, and that is detecting button pushes on the remote controller. That's something I need, so this sensor will be reprogrammed for that purpose. But I'll have to wait until the X-mas break. I'll post on update on that in this post.

                      Also if I'm not mistaken, the RFLink projects deals with KaKu for you. That might be an interesting project for you

                      1 Reply Last reply
                      0
                      • TheoLT TheoL

                        @mvader Since it's just a Sensor it should work on any Gateway. After it's running you should see a new device in Domoticz with 5 sub nodes. They's all of the type lightning 2. Each sub device represents one of the swicthes on the impuls remote controller. The system code has to be adjusted to your own system code. On my outlets the dipswitches are all on, see the byte is 31.

                         * MySensors node for switching on/of cheap 433Mhz based Power outlets from the Action
                         * Author  Theo Leloux
                         * Created 05-09-2015
                         * Version 0.1alpha
                         */
                        
                        /**
                         * Import the libraries needed by the Sketch
                         */
                        #include <MySensor.h>  
                        #include <SPI.h>
                        #include <RemoteTransmitter.h>
                         
                        /**
                         * Declare constants like pin settings etc.
                         */
                        #define TRANSMITTERPIN 6 // documentation doesn't see anything if the needs to be a PWM, but why take the risk?
                        #define CHILD_ID_ACTION_SWITCH_A 1 // Declare the DEVICE A as a separate switch
                        #define CHILD_ID_ACTION_SWITCH_B 2 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
                        #define CHILD_ID_ACTION_SWITCH_C 3 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
                        #define CHILD_ID_ACTION_SWITCH_D 4 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
                        #define CHILD_ID_ACTION_SWITCH_E 5 // Declare the DEVICE B as a separate switch -- In my situation I configured all outlet's as DEVICE A, so reserved for future useage 
                        const char SYSTEMCODE = char(31); // cast the integer byte value to a char should do the trick. Adjust this to your own SYSTEMCODE see RemoteTransmitter.h
                         
                        /*
                         * Declare variables
                         */
                        ActionTransmitter switchTransmitter = ActionTransmitter( TRANSMITTERPIN ); 
                        unsigned long SLEEP_TIME = 5000; // the main loop will probably won't do a thing if we only attach a transmitter.
                        MySensor gw;
                         
                        /*
                         * Declare MySensors Messages
                         */
                        MyMessage msgDeviceA( CHILD_ID_ACTION_SWITCH_A, V_LIGHT );
                        MyMessage msgDeviceB( CHILD_ID_ACTION_SWITCH_B, V_LIGHT );
                        MyMessage msgDeviceC( CHILD_ID_ACTION_SWITCH_C, V_LIGHT );
                        MyMessage msgDeviceD( CHILD_ID_ACTION_SWITCH_D, V_LIGHT );
                        MyMessage msgDeviceE( CHILD_ID_ACTION_SWITCH_E, V_LIGHT );
                        
                        /**
                         * Preparation code during initialization of the Arduino
                         */
                        void setup() {
                          // put your setup code here, to run once:
                          // Serial.begin( 115200 );
                          gw.begin( incomingMessage ); // attach a message handler for handling commands transmitted by the controller.
                        
                          gw.sendSketchInfo("433Mhz bridge", "1.0");       // Send the sketch version information to the gateway and Controller
                          gw.present( CHILD_ID_ACTION_SWITCH_A, S_LIGHT ); // Present Device A to the gateway
                          gw.present( CHILD_ID_ACTION_SWITCH_B, S_LIGHT ); // Present Device B to the gateway
                          gw.present( CHILD_ID_ACTION_SWITCH_C, S_LIGHT ); // Present Device C to the gateway
                          gw.present( CHILD_ID_ACTION_SWITCH_D, S_LIGHT ); // Present Device D to the gateway
                          gw.present( CHILD_ID_ACTION_SWITCH_E, S_LIGHT ); // Present Device E to the gateway
                          
                          gw.sendBatteryLevel(100); // It just looks better in Domoticz if we let Domoticz no we're running on 100% power.
                        
                        }
                        
                        /**
                         * The Sketch's main loop.
                         */
                        void loop() {
                          // I have nothing to do if only attach a transmitter. 
                          gw.wait( SLEEP_TIME ); // call the wait routine, which will allow for incomming messages during the waiting
                        }
                        
                        void incomingMessage(const MyMessage &message) {
                          Serial.println("message");
                          // We only expect one type of message from controller. But we better check anyway.
                          if (message.type==V_LIGHT) {
                            char device = 64 + message.sensor; // translate child id to device ID. A = 65 so if we take off one and add the received sensor ID we get the correct device
                          //  Serial.println( "Command received for Device " + (String)device + " on id " + (String)message.sensor + " request to turn " + (message.getBool()?"on":"off") );
                            if ( device >= 'A' && device <= 'E' ) { // Impuls/Action system only allows device 'A' to 'E'
                              switchTransmitter.sendSignal(SYSTEMCODE, device, message.getBool() );
                            }
                          }
                        }
                        

                        I attached the 433 Mhz data line to pin 6 of the arduino. Not sure if it needs PWM. But I just started an hour ago and haven't had the time yet to look that up. For around 15 euro I'm able to control all my cheap 433Mhz outlets with Domoticz. I feel like a little kid in a candy shop ;)

                        Next thing to do is to hook up the receiver. So that I can receive the commands from the remote controller and send them to Domoticz. Work in progress hope to finish it this evening. But the reciever library has no support for impuls, so it might take a while.

                        Michel - ItM Offline
                        Michel - ItM Offline
                        Michel - It
                        wrote on last edited by
                        #23

                        @TheoL hello, I would like to do your own thing, then how did you manage to make the code? I would be grateful if you share it.

                        1 Reply Last reply
                        0
                        • Michel - ItM Offline
                          Michel - ItM Offline
                          Michel - It
                          wrote on last edited by
                          #24

                          forget it, I managed to make it work now I would like to add a 4x4 keypad for a total of 16 buttons currently on the code there are 11 virtual reley but will arrive at 16 someone can give me a hand to add the keypad of 16 buttons that control the relay 16 ?
                          http://forum.mysensors.org/topic/2650/relay-433mhz-keypad-4x4-comander-vera-domoticzlink text

                          1 Reply Last reply
                          0
                          • M mvader

                            @TheoL i'm not sure what hardware you are using.but i have the etekcity ZAP 433 remote & outlets.
                            i just bought a 433 mhz transceiver off ebay and hooked it up to my raspberry pi2 and sniffed the codes.
                            i found it easier than going the arduino route. however the whole intention was to run this off the mysensors network i'm building. so the RPI2 was just for sniffing the codes.

                            afenoA Offline
                            afenoA Offline
                            afeno
                            wrote on last edited by
                            #25

                            @mvader said:

                            I have the etekcity ZAP 433 remote & outlets. I just bought a 433 mhz transceiver off ebay and hooked it up to my raspberry pi2 and sniffed the codes.

                            Did you manage to turn on/off the etekcity outlets from the gateway?

                            I would like to do the same on my side... But I don't know too much about radio protocols.

                            Thanks!

                            M 1 Reply Last reply
                            0
                            • afenoA afeno

                              @mvader said:

                              I have the etekcity ZAP 433 remote & outlets. I just bought a 433 mhz transceiver off ebay and hooked it up to my raspberry pi2 and sniffed the codes.

                              Did you manage to turn on/off the etekcity outlets from the gateway?

                              I would like to do the same on my side... But I don't know too much about radio protocols.

                              Thanks!

                              M Offline
                              M Offline
                              mvader
                              wrote on last edited by
                              #26

                              @afeno said:

                              @mvader said:

                              I have the etekcity ZAP 433 remote & outlets. I just bought a 433 mhz transceiver off ebay and hooked it up to my raspberry pi2 and sniffed the codes.

                              Did you manage to turn on/off the etekcity outlets from the gateway?

                              I would like to do the same on my side... But I don't know too much about radio protocols.

                              Thanks!

                              Yes, i have my gateway in the basement. and then i built a mysensors 433mhz repeater (arduino + NRF radio + 433 transmitter / mysensors) this one is USB powered, stays on full time, it is on the 1st floor.. I control about 7 of the etek city outlets with it. I have to say though, most of my outlets are on the 2nd floor (which is why i put the transmitter on the 1st floor and not in the basement) even with an 433 external antenna, they fail to respond 10-15% of the time, with my z wave devices, they never fail to turn on/off no matter where they are, and with my sensors devices, i can always see/talk no matter where they are..
                              based on that, if i had to do it again, i would either zwave those or mysensor those devices (which i will probably move to down the road).
                              during the holidays, i controlled another 5-7 etek outlets on the 1st floor, to control holiday lights, tree lights.. etc. all of those were on the 1st floor and generally worked fine.

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


                              16

                              Online

                              11.7k

                              Users

                              11.2k

                              Topics

                              113.0k

                              Posts


                              Copyright 2019 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