hi, sorry for my bad English, I have included two sonoff for roller blind motor control so I created two buttons to control them on Blynk panel, for convenience I will call button 1 and button 2, when I press the button 1 I have the command to device 1 and when I press the button 2 I have the command to the device 2 (each button controls a different device, one for the ascent and one for descent), how can I prevent that if I press up button 1 is not pressed the button 2 of descent?
in practice I would make sure that when I press a button / switch can not give the other input button / switch on the panel, thank you for the answers
Could be easier to help if you posted your code, remember to format it for forums.
But basically
When you hit a button
Save a boolean variable as true to indicate that it was pressed.
Use if statement, While this value is true don’t do anything on subsequent presses until your motor is finished moving.
Then change your variable to to false.
Is this understandable enough for you to program?
hi Fettkeewl,
Thank you so much for the answer, I haven’t programmed the device (sonoff) because I’m still waiting for this, I’m going to use this information (that I look good for my project), but I want to increase the security of the buttons pressure / switches, maybe the solution would be the boolean variable, but I don’t know how to apply it, you can find the sketch that I’m going to load in the following link
I will use only the first button that you can see in the link’s example.
thanks a lot
I dove head first into the code and now my head hurts a little. But I must say it was veeeeery good code. Tzapu is a true blynker I’d guess.
How is your setup going to be?
Got any schematics? Before I propose anything I’d love to know what the hardware setup is going to be exactly, are you Wifi enabling a old blinds driver system, are you making everything from scratch? Driving a single motor by power toggling.
You need to lay it all out in order for me/someone to give you a proper solution/ or nudge in the right direction.
Also it’s good to know, how are you with programming, do you know any at all? Most people here like to help others mostly by nudging them in the right direction because we all have our own projects to code and hookup, no one likes to write others code
Unless perhaps… you are like my compatriot here, @Gunner, who seems to have run out off components so he can’t do much tinkering
Hi, I’m really happy to have help from you, the makers of this great application thanks.
ok let’s get started I planned some time ago a esp8266 module with the basic sketch by turning on a remote LED, I also connected a relay module, however, I realized that with esp8266 module, relay module and power supply occupied me a lot space in the electrical system, I recently found this module sonoff, I have made a purchase on ebay and are awaiting delivery, I have to make a simple home automation system to be added to the electrical system of my house, for now I would like to control 5 roller blind motor, then on to create Blynk panel 1 project that manages devices 2 (2 sonoff), the first sonoff will be connected to a button on the panel Blynk for the roller blind uphill, while the second sonoff will be connected to a button on the panel of Blynk for downhill roller blind, the roller blind motor are equipped with limit switches then later testing if I do have the button or the switch (but this can change through application settings), if it works I would like to apply also to sonoff house lights, using the button on sonoff, (this function can not make it to the roller blind because if I press the button more than 3 seconds, the same goes for wifi search mode),
most likely I will use this system for the house lights (after learning the code), using the sonoff button connected to the wall button to turn on, you can view the minute 3:34 in the video
I’m an electrician and I still practice a lot of electronic projects, but nothing about programming on these devices:wink:, thank you so much for more help
this is my idea that I want to do for my roller blind.
P.S. I do not want the establishment of a code from the beginning, for me may already be helpful to use one of the links, the only thing I would add to the Blynk panel button is to prevent press two buttons together, thanks
If you are going to use limit switches, then I would suggest two things.
First, use button set for switch mode… ON/UP OFF/DOWN that way hard to accidentally activate both.
And second, set one Sonoff as the primary device controlled by the app and and use Bridge to control the 2nd Sonoff.
As for coding… I am afraid you will probably need to learn a little bit (with our help) as you will certainly need to modify the base code to accommodate two Sonoffs merged into one coexisting device… and you will appreciate the experience if you ever need to troubleshoot it.
Loris, how does your motor work, do you have to hold the switch the entire time or just press it? Does it stop by itself when it is fully up/down even if you hold your button?
hi,
Now I have to press the button to up/down and because there are two buttons into one, mechanically is not possible to press them at the same time.
When I press one, it goes uphill / downhill and when I don’t press, it stops; instead if I hold it down until the height of ascent / descent it stops because the roller blid motor has the limit switches.
How long does it take to travel from top to bottom or vice versa?
hi Costas,
about 31 seconds to up or down
the roller blinds are 230 cm high (7.54593 ft), with 120 cm width (3.93701 ft).
Hi Loris, Did you use the Sonoff Boilerplare? Does it work? I have been researching it but cannot find anyone who has actually used it. The author does not answer questions, perhaps just too busy.
Hi Loris1969, did you manage to get rid of the roll control?