Code Monkey home page Code Monkey logo

Comments (20)

localhost61 avatar localhost61 commented on August 14, 2024 3

@lobocobra
This is where I hide my dual R2, and a CH4 will fit too:

Sonoff in place

The only drawback is that I need a 6 wires cable between the wall switch and the sonoff
(Live, Neutral, Earth, Up, Dn, Gnd) where I used to have 4 wires (Up, Dn, Neutral, Earth)

from sonoff-shutter.

lobocobra avatar lobocobra commented on August 14, 2024 1

Please read my text first before you answer. The code does exactly this.
=> But there is really no need you use my code!

So why do you take it so personal? I will remove your text as it is no added value to the solution itself.

from sonoff-shutter.

lobocobra avatar lobocobra commented on August 14, 2024

Hi @HGBAXXTER

I agree with you that the miss-use of the pulestime needs to be changed. I currently work on a more general usability of the mod, as I want also to be able to calculate how much water I use in the garden with this mod. In addition I plan to merge my POW mod for my heating into this new one.
=> As this will take a bit too long for your case, I will add a work-around for you, by adding a new command. So you can set your desired pulsetime as the base pulsetime.

I will call it ShutStdPulseTDsec.
==> each reset will be done to your Shutter_Pulse Std, which should fix your issue.

Btw, did you know that with the pro you can buy a cheap internechno switch YWT-8500 and connect your buttons to the 433mhz capability?
==> So you do not need to have the ugly device near the shutter but can hide it somewhere.

from sonoff-shutter.

lobocobra avatar lobocobra commented on August 14, 2024

Done, please check if it works as expected.
=> Config is reset with this upgrade! Ensure you have saved your settings.

from sonoff-shutter.

lobocobra avatar lobocobra commented on August 14, 2024

@localhost61
Looks like a clean solution.

from sonoff-shutter.

HGBAXXTER avatar HGBAXXTER commented on August 14, 2024

@lobocobra Thanks a lot for your effort and your latest commit. I tried it but I do not get it to work as expected.

After OTA update, I configured from scratch:

  • Select Module: 4CH Pro
  • SetOption80 1
  • SetOption81 1
  • ShutterMaxDSec 100 (randomly chosen, just for testing)
  • ShutterPosDSec1 0
  • SwitchMode1 1
  • SwitchMode2 1
  • Pulsetime1 1
  • Pulsetime2 1

With these settings, I expected that when pressing button1 very shortly, the relay will only be switched for 0.1s. Only permanent button press will lead to permanent relay switching (until the maximum runtime of the shutter is reached). However, it only works once after setting pulsetime. When I press button1 a second time, the relay is switched permanently, until 100% position is reached.

Maybe, my configuration is wrong?

PS: There is no urgency for me on this topic.

from sonoff-shutter.

HGBAXXTER avatar HGBAXXTER commented on August 14, 2024

Sorry, I just noticed my mistake. I forgot to set ShutStdPulseTDsec1 1.

Apparently, also my problem seems to be a different one: The Switchmode options do not seem to work with the onboard buttons on the 4Ch Pro. Unlike the Sonoff Dual, it also does not offer other GPIO as headers.

from sonoff-shutter.

lobocobra avatar lobocobra commented on August 14, 2024

ShutStdPulseTDsec1 1 means that the blind goes for 0.1 sec.
=> Is it that what you wanted? If you want it to run for 1 sec, you need to set it at 10.

But usually I would recommend to set it at 25% or something...

from sonoff-shutter.

HGBAXXTER avatar HGBAXXTER commented on August 14, 2024

It certainly solves my problem (ShutStdPulseTDsec1 1 was an example value, 0.1 sec of course is not useful). I wanted to avoid that just a short button press moves the motor the full range (due to kids in the household, etc.). So, a setting of the pulsetime to somewhat like 25% is a good solution.

However, my original plan was a little different and using pulsetime does not seem to do what I expected it to do. Holding down a button when a value for pulsetime is defined does not switch the relay for the duration of button press but for the duration of pulsetime.

from sonoff-shutter.

lobocobra avatar lobocobra commented on August 14, 2024

How about if you set ShutStdPulseTDsec1 to 0... then Pulsetime is off.
=> If needed I can adapt the code, as I believe 0 is not allowed as an value.
=> Just let me know but probably you can do the changes on your own

from sonoff-shutter.

strizl avatar strizl commented on August 14, 2024

@localhost61
Thanks for sharing your photo and showing your solution. Looks very professional!

Can I ask you some questions:

  • Does the "sonoff-shutter" code works directly with Dual R2 instead of 4CH Pro or do I have to change anything in the code? Do I only have to choose the correct model in Tasmota?

  • You added an AM2301 sensor to the serial connection, correct? Isn't it necessary to add a pull-up because there's no one on the Dual-R2-pcb? Or isn't it necessary?

Thanks a lot for your help and also thanks to @lobocobra for the great shutter-solution!

from sonoff-shutter.

lobocobra avatar lobocobra commented on August 14, 2024

@strizl
master branch
Please make sure you use the master branch, when you test it. Localhost61 confirmed that it works with a dual (see #1), if you encounter issues, I will of course adapt the code.

ONoffcounter branch
This branch will in future merge my 3 projects into one:

  • Oil heating on POW to know how much OIL is left in the thank and used
  • Shutter handling
  • Relay ON / OFF time measuring, to calculate how much water you use for your garden and how much it costs (example, can be used for all devices).

from sonoff-shutter.

strizl avatar strizl commented on August 14, 2024

Thank you very much, @lobocobra ! Great work!
I will test and give feedback if I encounter problems.

In the other post (#1) you wrote:
"If you use the dual at the end, I would recommend you then to disable the CH4 interlock mode. In the next version this is done with setoption81."

  • Do you mean SetOption14 to 0? But in the instructions you mentioned it has to be activated
  • To use with Dual R2 I only have to activate SetOption81?

Thanks a lot!

from sonoff-shutter.

lobocobra avatar lobocobra commented on August 14, 2024

Hi Strizl

In your case you should set following options:

  • Setoption14: ON (this is activating Interlock the old fashionned way)
  • Setoption80: ON (this activates the shutter commands)
  • Setoption81:OFF (because you do not use a CH4 and will work with regular Interlock mode)

When using a 2channel, setoption14 is already giving you all you need and setoption81 becomes obsolete, as it splits your channesl by 2.

from sonoff-shutter.

strizl avatar strizl commented on August 14, 2024

Thanks so far for your reply!

from sonoff-shutter.

localhost61 avatar localhost61 commented on August 14, 2024

@strizl

  • The pull-up is needed for DS18B20 that is designed to connect on a 1-wire bus, not for AM2301.
  • Yes sonoff-shutter works on Dual R2, but I'm not happy with the way it uses pulsetime. When I hit the UP command, I want to be sure that my shutter reaches the Top and resets the position to 100% open. But this user setting is corrupted by the mod and the attached wall switches (or Homepage buttons) don't work anymore as they used to with Tasmota. It's a shame because otherwise I was pleased by the new commands.

from sonoff-shutter.

lobocobra avatar lobocobra commented on August 14, 2024

@localhost61
I assume that you did not check the code for a while....

It is ensured that the UP command reaches 0% and DOWN reaches 100%. I use the solution daily and my shutter allways reach the end positions, when I push the buttons.

For UP/DOWN pulsetime is not used by the mod, only for GOposition. It even enables you to set a standard PULSETIME, which prevents that by accitdental manual change of pulsetime it is set back to the right value. In your described case this would be either PULSETIME 0 or PULSETIME = duration of full run-time. Without this function, your shutter could stop somewhere in the middle if you sent once an MQTT pulsetime command and forgot to reset it. Any solution that does not control the SONOFF pulsetime, will sooner or later fail to reach the end position.
=> My solution prevents this

@strizl
Please let me know if you have issues with the configuration.

from sonoff-shutter.

strizl avatar strizl commented on August 14, 2024

Hi @lobocobra

I tested your sonoff-shutter-release on a 4CH Pro and DUAL R2 device and I'm quite happy with it. It works fine and you did great work - thank you!
Also the percentage function is a nice thing ;-)

I have only one little trouble regarding Sonoff DUAL R2:
When I press a hardware button of the 4CHPro (e.g. UP or DOWN of 1 shutter) for A LONGER TIME, it drives the motor as long as I press the button.
When I press it shortly, the shutter closes or opens completely (0% or 100%).
That's a very nice function and exactly the thing I wanted to have! ;-)

But on the DUAL R2 this function also works with the 1 hardware key
(single short press --> shutter completely up, double short press --> shutter completely down, single long press --> motor drives up till button release, double long press --> motor drives down till button release).
So the function itselfs works exactly the same way - great!

But on the DUAL R2 you have an header to connect external BUTTONS. I wanted to use them to attach a wall mounted double-pushbutton to drive the shutter also externally.
But with these buttons the function doesn't work. They drive the motor only up or down as long as I press the button.
I think because of the following reason: the internal hardware button is attached to GPIO10, the header for external buttons is attached to GPIO0 and GPIO09.
I think the function is only implemented for the internal hardware button, not for the header.
In Tasmota I set GPIO0 to "09 Switch 1" and GPIO9 to "10 Switch2".

Is there a way to adapt these in the code or do I maybe have to set special or other settings in Tasmota?

Would be great to get some help.
Thank you very much for your efforts!
Kind regards,
strizl

from sonoff-shutter.

lobocobra avatar lobocobra commented on August 14, 2024

@strizl
I have currently no DUAL R2 (but will probably order some), to test it my own, but there must be an easy solution. As the mod is not touching at all this function, it should be an issue on the Firmware to be fixed.

To understand your issue in detail....
The problem is, that the external buttons do not go fully UP/DOWN if you press once, but they function as expected if you press continously. Basically you want be able to move the shutter by long press or have it fully up/down when pressed once (or twice). All is ok as long it is the same everywhere...
=> right?

Could you try this

  • To ensure where we need to fix this, can you load once a standard firmware and check if you see the same issue? => after we know if it has to do with what you guessed
  • Can you also check the Wiki please for settings that are wrong in your setup? I use only in one case an external button. I personally use the CH4 pro and use 433mhz buttons to operate the shutter. There I can make a long push or a short push. There are many settings described in the wiki related to ext. buttons.

The solution is then either to search for a fix in the basic firmware, which might be usefull for all or to use the new script function within SONOFF, or that I add a hack.
=> What I probably could do easily is to programm a double push

So let's see what is the outcome of your test and then progress.

from sonoff-shutter.

strizl avatar strizl commented on August 14, 2024

Hi @lobocobra

Sorry for my late reply.
Thank you very much for your help and details so far!

I will investigate, do the recommended checks and come back to you. Unfortunately, I'm very busy at the moment, but hopefully I have a free time slot the upcoming weeks.

Kind regards,
strizl

from sonoff-shutter.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.