Controlling Blinds.com RF Dooya Motors with Arduino and Vera
-
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) }
-
UP/DOWN/STOP is commands and does not have any values associated with them.
And yes, LoadLevelStatus is updated by setting dimmer value.
-
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 -
Awesome work!
Is three anyway to copy a ROLLING code?
-
Awesome work!
Is three anyway to copy a ROLLING code?
-
@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 ; -
Here is the updated code for 1.4 if anyone needs it...
https://codebender.cc/sketch:67780great to see the update... gives me another thing to do!
-
Here is the updated code for 1.4 if anyone needs it...
https://codebender.cc/sketch:67780@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
1101010101011100000011000define 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 microsecondsAudocity file : http://1drv.ms/1wmgh2e
-
@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. -
@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.
-
@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 microsecondsI 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 0first 4 bits 0000 in your sketch + 25 bits from my remote = 29 bits
-
@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.
-
@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..
-
@C.r.a.z.y. Yeah, I couldn't get the automatic "sniffers" to work for me either. Hopefully you're able to get it working. Remember, just focus on sending the 1's and 0's pattern. Start your code with that then expand when you get that part working. One thing that may help is to record what you're sending in Audacity again. That way you can compare the waveforms and see what needs to be modified with the code.
-
@C.r.a.z.y. Yeah, I couldn't get the automatic "sniffers" to work for me either. Hopefully you're able to get it working. Remember, just focus on sending the 1's and 0's pattern. Start your code with that then expand when you get that part working. One thing that may help is to record what you're sending in Audacity again. That way you can compare the waveforms and see what needs to be modified with the code.
@petewill Comparing is great idea thanks i will try this!