lobocobra / sonoff-shutter

add to arendst sonoff project the capability to operate shutters
GNU General Public License v3.0
5 stars 2 forks source link

Sonoff 4CH Pro R2 #4

Open achillealb opened 5 years ago

achillealb commented 5 years ago

I have Sonoff 4CH Pro R2 1- Does your firmware work with Sonoff 4CH Pro R2? 2-Which of these patterns can you use with your firmware? 3- Do you have the firmware in the bin format? sonoff_4ch_pro_pulsanti kagdfacmrbk0_eg6oocaew

xbow42 commented 5 years ago
  1. yes
  2. your switch/button-activitation has no feedback to the sonoff-firmware->homeautomation. Result: the software can't calculation the real position of the shutter. I use no wired switch/button. only control via homeautomation or rf-remotecontol.

edit: my mistake up/down-wire on relay-input must be changed sonoff4chp-relay

serfer12 commented 5 years ago

Hello can I ask for a bin file?

lobocobra commented 5 years ago

Sorry for the delay. Here is the bin file you asked for. It works also with R2 version of the HW; sonoff.ino.bin.zip

See the commands to use below // enter DeciSec = Sec10 1) First Check get the seconds your shutter needs to go from all up to all down. (multiplicate by 10) 2) Check the seconds your shutter to go from all down back to all up. 3) now enter the data below: shutterMinDSec1/2 (usually its 0, but if you want not to go all up, put here 10 for 1 sec) shutterMaxDSec1/2 (enter result from point 1) shutterPosDSec1/2 (if you are all up, put in here 0, after that leave it alone) shutterGoPercent1/2 (1-100%, current or move to) => command to go to the position shutStartDelayDSec1/2 (time your motor needs to do a movement) => should be small, test it shutLagUpwardsDSec1/2 (additional time your motor needs to go upwards) => difference of pt1 and pt2 *10 ShutStdPulseTDsec1/2 (standard pulsetime to be set afer any movements) => if you work with buttons Setoption 80 enable Shutter function Setoption 81 enable Interlock Split (if set interlock will be activated on next push)

serfer12 commented 5 years ago

I'm sorry for a stupid question but where it is setoption81 and setoption14? Have you removed the configure domoticz option?

W dniu 20.05.2019 o 16:02, lobocobra pisze:

Sorry for the delay. Here is the bin file you asked for. It works also with R2 version of the HW; sonoff.ino.bin.zip https://github.com/lobocobra/sonoff-shutter/files/3198233/sonoff.ino.bin.zip

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lobocobra/sonoff-shutter/issues/4?email_source=notifications&email_token=AMDC4PUC4ASJ6XJMYLACYTLPWKVQ7A5CNFSM4FX35VW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVY5VFY#issuecomment-494000791, or mute the thread https://github.com/notifications/unsubscribe-auth/AMDC4PTYOJDNCRG5FST56F3PWKVQ7ANCNFSM4FX35VWQ.

localhost61 commented 5 years ago

Those are commands you can enter when you reach the Console of the Web page of the device. On the command line simply type: setoption81 on and validate with the <Enter> key. The option will be retained in flash memory. There are other ways, like connecting with a Terminal application on the serial port, or forming a special URL or using an MQTT client... If you're a true newbie, take a breath and navigate into the huge wiki. Take into account that this fork version is currently 9 months older than the main project.

serfer12 commented 5 years ago

Thank you for your help. Now it works very well. Tell me, please, how can I activate domoticz configuration.

I will use this to control two water valves. Can it be set so that it does not turn off the relay after a certain time?

localhost61 commented 5 years ago

Regarding the code, it seems you're right, the author @lobocobra certainly doesn't use Domoticz and disabled the code with the // inserted on those 3 lines here You'll have to remove the and compile the code yourself or ask someone to do it for you ;)

I will use this to control two water valves. Can it be set so that it does not turn off the relay after a certain time?

Then I don't understand why you use this fork which first purpose is to control blinds (2 relays for one motor)? The original @arendst 's project does it out of the box. And in order to control two valves a Dual R2 was enough, isn't it?

lobocobra commented 5 years ago

@server The main purpose of this code is really to handle shutter and to position them at 25% or 75% automatically. I can of course compile for you a version that supports Domoticz, but as @localhost61 stated, you are probably better served with the original firmware. => With the original firmware just use pulsetime to define how long the valves should be open => Btw my interlock split/idea was meanwhile added to the main code, so you should have all you need there.

Btw... I have another branch here, which deals with watering. It calculates how much water was used and you can download and compile it. => But I plan to extend this version as soon my heating-project is finished. => Meanwhile just use the standard firmware and you will probably be happy with it.

serfer12 commented 5 years ago

Thank you for your tips I have 2 sources of water, from waterworks and from a well. I have 2 valves with motors, only 2 cables plus and minus. (Turn left and right). Valves have limiters. The original tasmota does not let them close at the same time. And your soft is ok because I can close them at once. However, I miss here that I see the state that it is closed or open. Because the relay turns off after 10 seconds. image

lobocobra commented 5 years ago

Hmm how you would like to see this statment? In the Web - Interface or per MQTT? => Do you define by seconds if they are open and closed?

With this software you might be able to use 0% as closed and 100% as open? => The SW tracks where are the shutters in %. So if you take LEFT (as open) = 0% and RIGHT (as closed) =100% then you get MQTT Messages whenever you stop at what % you are.

serfer12 commented 5 years ago

Look this : this is original tasmota https://www.youtube.com/watch?v=YkGiopfAxyA

Your firmware from the button works ok but with domoticza leaves relays enabled https://www.youtube.com/watch?v=M3gC2bEU9U4

Is there a chance for the original tasmot but with two independent groups, without shutting down after time? Best Regards

lobocobra commented 5 years ago

Do I understand it right, that you only need the interlock function? => I checked your video and had the impression, that you do not need the %function I added.

If this is the case I see two easy options for you:

  1. use the original firmware and activate interlock and you set PULSETIME (to stop after x seconds)
  2. use re-compile my firmware with activated Domoticz => If you can not do that I can recompile it if you want

BUT when you do not use any function like GoPercent, then I recommend you the original firmware with following commands activated: Pulsetime1 x (seconds) Pulsetime2 x (seconds) Pulsetime3 x (seconds) Pulsetime4 x (seconds) interlock 1

localhost61 commented 5 years ago

In Tasmota version, Interlock feature was enhanced and you can define groups with commands issued from the console.

serfer12 commented 5 years ago

lacalhost61 I set interlock but it does not work, I can only turn on one relay at a time. stat/sonoff/RESULT = {"Interlock":"ON","Groups":"1,2 3,4"}

localhost61 commented 5 years ago

@serfer12 Hum, in fact that's the purpose of this feature, to allow only one relay in a group :-D With your setup you should be able to activate 1&4 together but not 1&2. To activate two relays almost together use the backlog aggregator: Backlog Power1 On; Power4 On And if you DON'T want a timeout to close your valves, then disable pulsetime: Pulsetime Off and do it an other way, with a sensor or a button.

I don't have a Ch4 Pro but take into account to proper setup its Dip switches to match your needs.

serfer12 commented 5 years ago

Thank you so much for your feedback. I had a wrong DIP switch. After switching, I can simultaneously activate 1 of 3 or 4 or 2 of 3 or 4. That was it However, it shuts down after a while, even though I set pulsetime 0

localhost61 commented 5 years ago

I would look at the console output to see the reason why.

serfer12 commented 5 years ago

20:22:41 CMD: interlock 20:22:41 MQT: stat/sonoff/RESULT = {"Interlock":"ON","Groups":"1,2 3,4"} 20:22:48 CMD: pulsetime1 20:22:48 MQT: stat/sonoff/RESULT = {"PulseTime1":"0 (Active 0)"} 20:22:53 CMD: pulsetime2 20:22:53 MQT: stat/sonoff/RESULT = {"PulseTime2":"0 (Active 0)"} 20:22:57 CMD: pulsetime3 20:22:57 MQT: stat/sonoff/RESULT = {"PulseTime3":"0 (Active 0)"} 20:23:02 CMD: pulsetime4 20:23:02 MQT: stat/sonoff/RESULT = {"PulseTime4":"0 (Active 0)"} 20:23:09 MQT: domoticz/in = {"idx":214,"nvalue":1,"svalue":"","Battery":57,"RSSI":5} 20:23:09 MQT: stat/sonoff/RESULT = {"POWER1":"ON"} 20:23:09 MQT: stat/sonoff/POWER1 = ON 20:23:27 MQT: domoticz/in = {"idx":214,"nvalue":0,"svalue":"","Battery":57,"RSSI":6} 20:23:27 MQT: stat/sonoff/RESULT = {"POWER1":"OFF"} 20:23:27 MQT: stat/sonoff/POWER1 = OFF

localhost61 commented 5 years ago
lobocobra commented 5 years ago

@serfer12

During summer I will continue to work on my shutter/watering project. => In case you are interested, see below the bin with Domoticz activated containing my changes: firmware.bin.zip

It is a merge of the newest code of arendst, with my mod. To activate the mod: backlog setoption80 1; setoption81 1 (do not use interlock as my version uses still my version of interlock, which was the basic of the new code in arendst firmware).

I will continue to work on this version. Aim is to...

marcgrc commented 4 years ago

Hi can you help me? I want to use sonoff 4ch pro to operate the 24 v dc motor. Can I make a 220 V electrical input to get the working sonoff or is it necessary to have a 24 V electrical input to make the sonoff work?

localhost61 commented 4 years ago

You have two options to power the 4CH pro2, AC or DC. Outputs are separate and not related to the way the 4CH is powered. So, yes, you can power the 4CH with 220VAC and power your 24VDC motors with a separate 24VDC source.

marcgrc commented 4 years ago

Thank a lot