Controlling Blinds.com RF Dooya Motors with Arduino and Vera


  • Admin

    I recently figured out how to control my Blinds.com motorized cellular shades (http://www.blinds.com/control/product/productID,97658) with my Vera 3. The blinds have Dooya DV24CE motors (which use a 433 MHz RF for remote control) built into them but I couldn't find any already built RF transmitter that integrated directly with the Vera. I had recently started building Arduino sensors with Henrik's amazing MySensors Arduino Sensor Plugin (http://www.mysensors.org) so I decided to try to build my own. Thanks to many helpful resources on the internet I was able to control my blinds for less than $20 in Arduino parts.

    Here is a link to a YouTube video with an overview of the process: http://youtu.be/EorIqw-9eJw

    Here is a pdf with more info on the process if you are interested in doing it yourself:
    Controlling Blinds.com RF Dooya Motors with Arduino and Vera.pdf

    And the Arduino Code:
    BlindsVera.ino


  • Admin

    Thanks for the guide and Arduino sensor example @petewill .

    Really fun to read about how you sniffed the radio signal from your blinds! I had no idea it would be that "simple".


  • Admin

    I am working on an updated version of this code to include multiple remotes as well as send status back to Vera. I have the multiple remotes code working well but I'm running into problems updating the status. I don't think I'm understanding how to properly send an update to the S_COVER sensor type. I have read the API instructions 2 or 3 times but I'm not a coder so I'll admit I don't fully understand it all. I think that I should use this code to update the Vera: "gw.sendVariable(message.header.childId, V_UP, 100)" but it's not working as I thought would. Should I maybe be sending a 1 instead of a 100? Or, something else? When I look at the advanced settings the LoadLevelStatus is 100 when the blind is up (done through web interface) so I think sending 100 is correct. Maybe I should be sending it as a different variable like V_Dimmer? Here is my code where I'm sending the status back to Vera. Thanks!

          if (message.header.type==V_STOP){ //Stop
              unsigned char i;
              for(i=0;i<2;i++) {  
                blindAction(message.header.childId, 3); //blindAction(channel, action) action: 1=up, 2=down, 3=stop
                delay(100);
              }
              Serial.println("STOP command");
          }
          else if(incomingBlindData == 100 || message.header.type==V_UP){//100 = Open/Up
             unsigned char i;
             for(i=0;i<2;i++) {
               blindAction(message.header.childId, 1);
               delay(100);
             }
             Serial.println("UP command");
             gw.sendVariable(message.header.childId, V_UP, 100); // Update Vera with status of blinds (up/down) 
          }
          else if (incomingBlindData == 0 || message.header.type==V_DOWN) { //0 = Closed/Down
             unsigned char i;
             for(i=0;i<2;i++) { 
               blindAction(message.header.childId,2); 
               delay(100);
             }
             Serial.println("DOWN command");
             gw.sendVariable(message.header.childId, V_DOWN, 0); // Update Vera with status of blinds (up/down)
       
          }
    

    S_Cover Advanced Settings.png


  • Admin

    UP/DOWN/STOP is commands and does not have any values associated with them.

    And yes, LoadLevelStatus is updated by setting dimmer value.


  • Admin

    @hek
    Excellent, thank you! Now to make some code changes and test some more.


  • Hero Member

    Really cool Pete...
    Ive some blind motors on the way..they are not RF though..so don't think ill need to decode the RF but thanks for the video explaining how it is done!

    Cheers,
    Greg


  • Admin

    @gregl You're welcome. I have received much more help than I have given but I do try to help when I can. Thanks for your posts as well. This community is great!



  • Awesome work!

    Is three anyway to copy a ROLLING code?


  • Admin

    @C.r.a.z.y. Not sure but I'm guessing it wouldn't be as easy as this since it is used for security. I would guess there is some key that it uses to generate the codes and you would need to figure that out. All just guesses though.



  • This post is deleted!


  • 433mhz-outlet
    please check this ;

    http://forum.mysensors.org/topic/713/433mhz-outlet


  • Admin

    Here is the updated code for 1.4 if anyone needs it...


  • Contest Winner

    @petewill

    great to see the update... gives me another thing to do!



  • @petewill Thank you Pete. I tried this code and found 9 devices. I changed 433 codes but didnt work.

    Before mySensors how can i test the 433 code if it works or not?

    Are these settings correct?
    1101010101011100000000110
    1101010101011100000011000

    define SEND_DATA 3 //Data pin for RF Transmitter
    define ZERO_HIGH 270 //Delay for the high part of a 0 in microseconds
    define ZERO_LOW 950 //Delay for the low part of a 0 in microseconds
    define ONE_HIGH 910 //Delay for the high part of a 1 in microseconds
    define ONE_LOW 300//Delay for the low part of a 1 in microseconds

    Audocity file : http://1drv.ms/1wmgh2e


  • Admin

    @C.r.a.z.y. This code is designed specifically for my blinds. You will need to modify it for your outlets based on the pattern of the code that is being sent. I took a look at your audacity file but I'm not exactly sure what I'm looking at. Did you press the On button 3 times then the Off button 3 times?
    As far as testing, what I did was just start with one command (On or Off in your case) and put it all in the loop function. Just put it an if statement so it only executes once. It will execute once when you plug in the arduino. Then you can get it sending the right codes correctly and not worry about the Vera setup.


  • Admin

    @C.r.a.z.y. Also, I forgot to mention this in my post above but you may want to consider making outlets with HEKs sketch. That's what I ended up doing because then I could see the status. With the RF stuff you can only send a signal but you don't get an acknowledgment as to if it worked or not.

    EDIT: I made my own outlets using HEKs relay sketch. That's how I see the status. I didn't end up using RF for outlets although I had originally planned to. I realized I wasn't very clear in my post above.



  • @petewill thank you Pete. I will try to modify at least i will sent rf code. Yes audocity file pressed 3 times on + 3 times off..



  • I think these are not the same with youtube video?

    define SEND_DATA 3 //Data pin for RF Transmitter
    define ZERO_HIGH 270 //Delay for the high part of a 0 in microseconds
    define ZERO_LOW 950 //Delay for the low part of a 0 in microseconds
    define ONE_HIGH 910 //Delay for the high part of a 1 in microseconds
    define ONE_LOW 300//Delay for the low part of a 1 in microseconds

    I read one of my remote with RC-Switch but other remote didnt work with RC-Switch.

    Your method is more general because RC-Switch only reads some kind of chipsets... SC5262 / SC5272, HX2262 / HX2272, PT2262 / PT2272, EV1527, RT1527, FP1527 or HS1527

    How can i convert this data to 32bit?
    1101 0101 0101 1100 0000 0011 0

    first 4 bits 0000 in your sketch + 25 bits from my remote = 29 bits


  • Admin

    @C.r.a.z.y. I am doing my best to understand but I think I'm still missing something. Basically what you want to do is to reproduce the pattern you recorded in Audacity. I did this somewhat crudely with blindAction function (someone smarter than me could code it much better but it works). You will need to modify (and probably rename) this function to meet your needs. In this function I call other functions (fourBits and eightBits) to actually send the RF signal out. I would start with these methods to get your timings right. You can then record what you send out in Audacity and compare. After you have got this working with one command you can work on interfacing it with Vera. I hope that helps a little.



  • @petewill Thank you i know you are very helpful. I tried to copy my remote to an universal remote learner(which has no name chipset) but it didnt copy. It is hard to understand and solve for a newbie.

    I simply tried to send 10101010codes with this sketch https://code.google.com/p/rc-switch/wiki/HowTo_Send?tm=6 and didnt work.

    Something interesting i found while tranmitting,
    If i remove the delay () than signal is always sent. I made a jammer! :) Any of my 433 remotes didnt work!

    I want to learn if any universal remote learner with EV1527 Chipset works with RCSwitch?
    My plan is to copy some remote codes to EV1527 universal remote and read the code from serial with RCSwitch-rfSniffer.

    Now i will try IR SENDER-RECEIVER http://www.mysensors.org/build/ir maybe i can get new ideas for 433mhz things..


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.