Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Momentary mode #46

Closed
B1G1 opened this issue Jul 5, 2018 · 139 comments
Closed

Momentary mode #46

B1G1 opened this issue Jul 5, 2018 · 139 comments

Comments

@B1G1
Copy link

B1G1 commented Jul 5, 2018

Hi Stefan,
In my case I have momentary buttons, one opens and one closes the shutter. If I press the open button the shutter opens totally, If I want to open 50% I push open button and then push again when the shutter is 50% open to stop it. So I set pulsetime1 and pulsetime2 to 5, shutteropenduration 24 and shuttercloseduration 21, when I send shutterposition 50 command, relay 1 goes on and off correctly, but nothing else happens and the shutter opens totally.

Is it possible to make it work as needed for me?

@stefanbode
Copy link
Owner

Can you give some more information about how it behaves is some situations.

  1. you stop in the middle and pulse again. does it revert direction or continue to close?
  2. you let it run at the end. I assume it stops automatically. what happens if you pulse then. does it revert and open?

In all this is a completely different use case for the shutter and I have to think about if there is a smart way to integrate this.

@B1G1
Copy link
Author

B1G1 commented Jul 7, 2018

This is the console log with some commands sent

13:40:10 HTP: Console
13:40:19 CMD: shutterposition
13:40:19 SRC: WebConsole from 192.168.1.23
13:40:19 RSL: Group 0, Index 1, Command SHUTTERPOSITION, Data
13:40:19 Shutter: Command Code: 'SHUTTERPOSITION', Payload: -99
13:40:19 MQT: stat/sonoff/RESULT = {"shutterposition":49}
13:40:25 CMD: shutterclose
13:40:25 SRC: WebConsole from 192.168.1.23
13:40:25 RSL: Group 0, Index 1, Command SHUTTERCLOSE, Data
13:40:25 Shutter: Command Code: 'SHUTTERCLOSE', Payload: -99
13:40:25 SRC:
13:40:25 MQT: stat/sonoff/RESULT = {"POWER2":"ON"}
13:40:25 MQT: stat/sonoff/POWER2 = ON
13:40:25 MQT: stat/sonoff/RESULT = {"shutterclose":1}
13:40:25 SRC: PulseTimer
13:40:25 MQT: stat/sonoff/RESULT = {"POWER2":"OFF"}
13:40:25 MQT: stat/sonoff/POWER2 = OFF
13:40:35 NEW Shutter: Stopped Position 36
13:40:35 SRC:
13:40:35 MQT: stat/sonoff/RESULT = {"POWER2":"OFF"}
13:40:35 MQT: stat/sonoff/POWER2 = OFF
13:40:35 CFG: Saved to flash at F9, Count 68, Bytes 3812
13:40:46 CMD: shutterposition
13:40:46 SRC: WebConsole from 192.168.1.23
13:40:46 RSL: Group 0, Index 1, Command SHUTTERPOSITION, Data
13:40:46 Shutter: Command Code: 'SHUTTERPOSITION', Payload: -99
13:40:46 MQT: stat/sonoff/RESULT = {"shutterposition":0}
13:41:05 CMD: shutteropen
13:41:05 SRC: WebConsole from 192.168.1.23
13:41:05 RSL: Group 0, Index 1, Command SHUTTEROPEN, Data
13:41:05 Shutter: Command Code: 'SHUTTEROPEN', Payload: -99
13:41:05 SRC:
13:41:05 MQT: stat/sonoff/RESULT = {"POWER1":"ON"}
13:41:05 MQT: stat/sonoff/POWER1 = ON
13:41:05 MQT: stat/sonoff/RESULT = {"shutteropen":1}
13:41:06 SRC: PulseTimer
13:41:06 MQT: stat/sonoff/RESULT = {"POWER1":"OFF"}
13:41:06 MQT: stat/sonoff/POWER1 = OFF
13:41:21 CMD: shutterposition
13:41:21 SRC: WebConsole from 192.168.1.23
13:41:21 RSL: Group 0, Index 1, Command SHUTTERPOSITION, Data
13:41:21 Shutter: Command Code: 'SHUTTERPOSITION', Payload: -99
13:41:21 MQT: stat/sonoff/RESULT = {"shutterposition":0}
13:41:29 NEW Shutter: Stopped Position 48036
13:41:29 SRC:
13:41:29 MQT: stat/sonoff/RESULT = {"POWER1":"OFF"}
13:41:29 MQT: stat/sonoff/POWER1 = OFF
13:41:29 CFG: Saved to flash at F8, Count 69, Bytes 3812
13:41:35 CMD: shutteropen
13:41:35 SRC: WebConsole from 192.168.1.23
13:41:35 RSL: Group 0, Index 1, Command SHUTTEROPEN, Data
13:41:35 Shutter: Command Code: 'SHUTTEROPEN', Payload: -99
13:41:35 SRC:
13:41:35 MQT: stat/sonoff/RESULT = {"POWER1":"ON"}
13:41:35 MQT: stat/sonoff/POWER1 = ON
13:41:35 MQT: stat/sonoff/RESULT = {"shutteropen":1}
13:41:35 NEW Shutter: Stopped Position 48136
13:41:35 SRC:
13:41:35 MQT: stat/sonoff/RESULT = {"POWER1":"OFF"}
13:41:35 MQT: stat/sonoff/POWER1 = OFF
13:42:05 CMD: shutterposition
13:42:05 SRC: WebConsole from 192.168.1.23
13:42:05 RSL: Group 0, Index 1, Command SHUTTERPOSITION, Data
13:42:05 Shutter: Command Code: 'SHUTTERPOSITION', Payload: -99
13:42:05 MQT: stat/sonoff/RESULT = {"shutterposition":100}
13:43:08 CMD: shutterposition 50
13:43:08 SRC: WebConsole from 192.168.1.23
13:43:08 RSL: Group 0, Index 1, Command SHUTTERPOSITION, Data 50
13:43:08 Shutter: Command Code: 'SHUTTERPOSITION', Payload: 50
13:43:08 SRC:
13:43:08 MQT: stat/sonoff/RESULT = {"POWER2":"ON"}
13:43:08 MQT: stat/sonoff/POWER2 = ON
13:43:08 MQT: stat/sonoff/RESULT = {"shutterposition":50}
13:43:08 SRC: PulseTimer
13:43:08 MQT: stat/sonoff/RESULT = {"POWER2":"OFF"}
13:43:08 MQT: stat/sonoff/POWER2 = OFF
13:43:18 NEW Shutter: Stopped Position 23968
13:43:18 SRC:
13:43:18 MQT: stat/sonoff/RESULT = {"POWER2":"OFF"}
13:43:18 MQT: stat/sonoff/POWER2 = OFF
13:43:18 CFG: Saved to flash at F7, Count 70, Bytes 3812
13:43:25 CMD: shutterposition
13:43:25 SRC: WebConsole from 192.168.1.23
13:43:25 RSL: Group 0, Index 1, Command SHUTTERPOSITION, Data
13:43:25 Shutter: Command Code: 'SHUTTERPOSITION', Payload: -99
13:43:25 MQT: stat/sonoff/RESULT = {"shutterposition":49}
13:43:51 CMD: shutterclose
13:43:51 SRC: WebConsole from 192.168.1.23
13:43:51 RSL: Group 0, Index 1, Command SHUTTERCLOSE, Data
13:43:51 Shutter: Command Code: 'SHUTTERCLOSE', Payload: -99
13:43:51 SRC:
13:43:51 MQT: stat/sonoff/RESULT = {"POWER2":"ON"}
13:43:51 MQT: stat/sonoff/POWER2 = ON
13:43:51 MQT: stat/sonoff/RESULT = {"shutterclose":1}
13:43:52 SRC: PulseTimer
13:43:52 MQT: stat/sonoff/RESULT = {"POWER2":"OFF"}
13:43:52 MQT: stat/sonoff/POWER2 = OFF
13:44:02 NEW Shutter: Stopped Position 28
13:44:02 SRC:
13:44:02 MQT: stat/sonoff/RESULT = {"POWER2":"OFF"}
13:44:02 MQT: stat/sonoff/POWER2 = OFF
13:44:03 CFG: Saved to flash at F6, Count 71, Bytes 3812
13:44:05 CMD: shutterposition
13:44:05 SRC: WebConsole from 192.168.1.23
13:44:05 RSL: Group 0, Index 1, Command SHUTTERPOSITION, Data
13:44:05 Shutter: Command Code: 'SHUTTERPOSITION', Payload: -99
13:44:05 MQT: stat/sonoff/RESULT = {"shutterposition":0}
13:44:19 CMD: shutterposition 50
13:44:19 SRC: WebConsole from 192.168.1.23
13:44:19 RSL: Group 0, Index 1, Command SHUTTERPOSITION, Data 50
13:44:19 Shutter: Command Code: 'SHUTTERPOSITION', Payload: 50
13:44:19 SRC:
13:44:19 MQT: stat/sonoff/RESULT = {"POWER1":"ON"}
13:44:19 MQT: stat/sonoff/POWER1 = ON
13:44:19 MQT: stat/sonoff/RESULT = {"shutterposition":50}
13:44:20 SRC: PulseTimer
13:44:20 MQT: stat/sonoff/RESULT = {"POWER1":"OFF"}
13:44:20 MQT: stat/sonoff/POWER1 = OFF
13:44:31 NEW Shutter: Stopped Position 24028
13:44:31 SRC:
13:44:31 MQT: stat/sonoff/RESULT = {"POWER1":"OFF"}
13:44:31 MQT: stat/sonoff/POWER1 = OFF
13:44:32 CFG: Saved to flash at F5, Count 72, Bytes 3812
13:44:48 CMD: shutteropen
13:44:48 SRC: WebConsole from 192.168.1.23
13:44:48 RSL: Group 0, Index 1, Command SHUTTEROPEN, Data
13:44:48 Shutter: Command Code: 'SHUTTEROPEN', Payload: -99
13:44:48 SRC:
13:44:48 MQT: stat/sonoff/RESULT = {"POWER1":"ON"}
13:44:48 MQT: stat/sonoff/POWER1 = ON
13:44:48 MQT: stat/sonoff/RESULT = {"shutteropen":1}
13:44:49 SRC: PulseTimer
13:44:49 MQT: stat/sonoff/RESULT = {"POWER1":"OFF"}
13:44:49 MQT: stat/sonoff/POWER1 = OFF
13:45:00 NEW Shutter: Stopped Position 48028
13:45:00 SRC:
13:45:00 MQT: stat/sonoff/RESULT = {"POWER1":"OFF"}
13:45:00 MQT: stat/sonoff/POWER1 = OFF
13:45:01 CFG: Saved to flash at F4, Count 73, Bytes 3812
13:45:01 CMD: shutterposition
13:45:01 SRC: WebConsole from 192.168.1.23
13:45:01 RSL: Group 0, Index 1, Command SHUTTERPOSITION, Data
13:45:01 Shutter: Command Code: 'SHUTTERPOSITION', Payload: -99
13:45:01 MQT: stat/sonoff/RESULT = {"shutterposition":100}

If you mean what it should do in that situations for my case then, since I have 2 momentary buttons:

  1. if I stop in the middle i have two choice, push open button so it opens or push close button so it closes.
  2. Yes, if I let it run at the end it stops automatically. Then it's the same as above.

@stefanbode
Copy link
Owner

Ahh understand. You still have two relay one for open one for closing. But instead of keeping the relay on you need a pulse at start and one at stop. Ok that makes it a bit easier. Let me check.

@B1G1
Copy link
Author

B1G1 commented Jul 7, 2018

Yes exactly

@stefanbode
Copy link
Owner

stefanbode commented Jul 8, 2018

Hi Bigi, please check if the newest firmware fulfills your needs. At the end, it was really easy to implement. Just one IF.

To change the behavior from the normal shutter to the momentary shutter you must define a pulsetimer on BOTH relays that you want to use. Now the relay switches shortly on (PULSETIME) and then waits for the position, after the position is reached the same relay get an additional ON to stop everything.

If pulsetime is 0 it behaves normally with on off

Give it a try. Nice weekend.

Please let me know if we need someidle time calculation. Currently the Firmware assume the motor will stop at the start of the pulse. Maybe we have to change this to get the correct position

@B1G1
Copy link
Author

B1G1 commented Jul 9, 2018

Hi @stefanbode thank you very much for the great work.
I'm doing some tests and initially the shutter command made mistakes. for example shutterposition 60 from completely closed has completely opened the shutter. But repeating the test I could not reproduce the error.
I do not know why.

I don't need idle time calculation, and since the motor automatically stops when the shutter is fully open or closed, for shutteropen and shutterclose commands only the first pulse it would be enough.
however this it's not a problem

@B1G1
Copy link
Author

B1G1 commented Jul 9, 2018

I think that the first time I need to send command shutter open first, the shutterposition command works correctly.

to see the current position I have to use shutterposition command with no arguments right?
if I move the shutter using the wall buttons the position is not updated

have you ever consider to add a shutterstop command?

@stefanbode
Copy link
Owner

stefanbode commented Jul 10, 2018

Regarding your first error: This might be an initialization issue. Could happen if the digital position does not match physical position.
The time calculation is the default. Maybe not all have endstops. Should not make a problem, because using the same relay to stop.
you have two options to get the current digital shutter position. one is to send the command without a value. Correct guess. The second one is to read SHUTTER from the sensor reading that comes with TELEPERIOD. Setting TELEPERIOD=10 will give you the position every 10 seconds.

If you manually move the shutter everything is out of sync because there is no way currently to recognize this movement.

SHUTTERSTOP should already be working. Please give it a try. Command without additional parameter

@B1G1
Copy link
Author

B1G1 commented Jul 10, 2018

ok, i already tried the two option to get the shutter position, but i found that SHUTTER from teleperiod is not always in sync with the response of shutterposition command. Is it possible?

About moving the shutter manually, i've connected my wall buttons to GPIO0 and GPIO9 as indicated in the Tasmota wiki https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-Dual-and-Dual-R2
so i think it should be possible to manage external buttons too.

I'll try shutterstop asap thanks ;)

@stefanbode
Copy link
Owner

Ok, this makes sense with the buttons and should be possible to update. SHUTTERPOSITION and SHUTTER should report nearly the same value. At least if it is not moving anymore.

I was expecting that you want to update the position with external switches. This is nearly impossible. but with switches connected to the ESP...

@B1G1
Copy link
Author

B1G1 commented Jul 10, 2018

SHUTTERSTOP command already takes in consideration that in momentary mode there is a second pulse? Because otherwise after sending that command the second pulse moves again the shutter

@stefanbode
Copy link
Owner

Upps. That the reason, why testing is so important. Let me take a look and fix it...

@stefanbode
Copy link
Owner

stefanbode commented Jul 10, 2018

I tested it and for me the SHUTTERSTOP during movement only creates ONE pulse

11:41:54 Shutter: Real Position 26151, Target 64800, Close Velocity 91

11:41:55 Shutter: Real Position 28151, Target 64800, Close Velocity 91
11:41:56 Shutter: Real Position 30151, Target 64800, Close Velocity 91
11:41:57 Shutter: Real Position 32151, Target 64800, Close Velocity 91
11:41:58 Shutter: Real Position 34151, Target 64800, Close Velocity 91
11:41:59 CMD: shutterstop
11:41:59 SRC: Serial
11:41:59 RSL: Received Topic /shutterstop, Data Size 0, Data
11:41:59 RSL: Group 0, Index 1, Command SHUTTERSTOP, Data
11:41:59 Shutter: Command Code: 'SHUTTERSTOP', Payload: -99
11:41:59 MQT: hm/status/sonoff/RESULT = {"shutterstop":1}
11:42:01 Shutter: Real Position 36151, Target 36151, Close Velocity 91
11:42:01 NEW Shutter: Stopped Position 36251, relay: 0, pulsetimer: 1
11:42:01 SRC:
11:42:01 MQT: hm/status/sonoff/RESULT = {"POWER1":"ON"}
11:42:01 MQT: hm/status/sonoff/POWER1 = ON (retained)
11:42:01 SRC: PulseTimer
11:42:01 MQT: hm/status/sonoff/RESULT = {"POWER1":"OFF"}
11:42:01 MQT: hm/status/sonoff/POWER1 = OFF (retained)
11:42:01 CFG: Saved to flash at 3FB, Count 997, Bytes 3812
11:42:02 MQT: hm/status/sonoff/STATE = {"Time":"2018-07-10T11:42:02","Uptime":"0T00:03:14","POWER1":"OFF","POWER2":"OFF","POWER3":"OFF","POWER4":"OFF", "Wifi":{"AP":1, "SSId":"BodeNet_Keller", "RSSI":74, "APMac":"30:85:A9:E
6:A0:F0"}, "DeepSleep":0, "Heap":19872}
11:42:02 MQT: hm/status/sonoff/SENSOR = {"Time":"2018-07-10T11:42:02","ANALOG":{"A0":7},"SHUTTER":40}](`url`)

@stefanbode
Copy link
Owner

For the NON-momentary switches, my build is working with the up and down switches. With the momentary switches, I have the problem, that I could not differentiate if the relays are still ON because of the defined pulsetime, or if the relay is again ON because you hit the switch. It does not make sense to go to the switch as an input. This needs additional research. Currently you can start the shutter in the desired direction if it is in STOP mode, but you cannot stop it until it reaches the final position (fully open/close)

@B1G1
Copy link
Author

B1G1 commented Jul 10, 2018

Ok, shutterstop works correctly.

Now since I use home assistant I'm trying to integrate the shutter on it.
With this configuration:

cover:
 - platform: template
   covers:
     tapparella_studio:
       friendly_name: "Tapparella Studio"
       position_template: "{{ states.sensor.posizione_tapparella_studio.state | int }}"
       open_cover:
         service: mqtt.publish
         data:
           topic: 'cmnd/tapparellaStudio/Backlog'
           payload: 'shutteropen'
       close_cover:
         service: mqtt.publish
         data:
           topic: 'cmnd/tapparellaStudio/Backlog'
           payload: 'shutterclose'
       stop_cover:
         service: mqtt.publish
         data:
           topic: 'cmnd/tapparellaStudio/Backlog'
           payload: 'shutterstop'
       set_cover_position:
         service: mqtt.publish
         data_template:
           topic: 'cmnd/tapparellaStudio/Backlog'
           payload: 'shutterposition {{position}}'
sensor:
- platform: mqtt
  name: "Posizione tapparella studio"
  state_topic: "tele/tapparellaStudio/SENSOR"
  value_template: "{{ value_json.SHUTTER }}"
  json_attributes:
    - Time
    - Switch1
    - Switch2
    - SHUTTER

all commands works but using the position slider the shutter stops not in the correct position.
and also on the console to open it 50% I have to send command shutter position 70 for example.
This could be related to the fact my shutter when touches the ground is not fully closed, but there's holes that have to be closed too, so I think I should consider 0 position like -10 or something like that?

@stefanbode
Copy link
Owner

stefanbode commented Jul 11, 2018

Hi Bigi,

new update to support switches 1 & 2 to control the relays manually. Without the momentary switches, this was easy, but the momentary switches are really a pain. A lot of new code required and quite much debug code currently. Please give it a try and give feedback. If something doeas not work please provide log files in debug mode.

Regarding your 50% 70% problem. I assume like you this is because of the holes that needs to be closed, too. This is operating time for the motors. There is no easy fix, because all homeautomation systems only support 0-100 for shutters. I have no idea, how to overcome the issue currently.

-10 or anything else will probably not work because most variables are unsinged.

@stefanbode
Copy link
Owner

stefanbode commented Jul 11, 2018

From the home assistant definition I would make it simpler to avoid the Backlog translation in the firmware. This is not required.

cover:
 - platform: template
   covers:
     tapparella_studio:
       friendly_name: "Tapparella Studio"
       position_template: "{{ states.sensor.posizione_tapparella_studio.state | int }}"
       open_cover:
         service: mqtt.publish
         data:
           topic: 'cmnd/tapparellaStudio/shutteropen'
       close_cover:
         service: mqtt.publish
         data:
           topic: 'cmnd/tapparellaStudio/shutterclose'
       stop_cover:
         service: mqtt.publish
         data:
           topic: 'cmnd/tapparellaStudio/shutterstop'
       set_cover_position:
         service: mqtt.publish
         data_template::
           topic: 'cmnd/tapparellaStudio/shutterposition'
           payload: '{{position}}'

@B1G1
Copy link
Author

B1G1 commented Jul 11, 2018

thank you very much Stefan, i'll try all as soon as i go back home.

@B1G1
Copy link
Author

B1G1 commented Jul 11, 2018

I flashed the latest version and using wall switches the position is updated, but not correctly.
Closing from position 100 to about half open, result in this
14:52:16 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-11T14:52:16","Switch1":"ON","Switch2":"ON","SHUTTER":97}

@stefanbode
Copy link
Owner

Your switches must be pulse switches. you work with momentary motors. therefore two switches ON is not a good starting point. This might cause the issue. I uses the TOGGLE button for the relay on the web interface for testing and this works reliably. Also check, that the paired interlock is ON and PULETIME on both relays is e.g. 5. It does not work with 1 for sure. I tested it with 5 and it might work with 3

@stefanbode
Copy link
Owner

Please see the updated WIKI section for shutters

@B1G1
Copy link
Author

B1G1 commented Jul 11, 2018

uhm if I set 18 Button 2 on GPIO0 and 19 Button3 on GPIO9 my wall switches don't work, but yes using the web interface works

@stefanbode
Copy link
Owner

ok then we have to define the switchmode. this is TASMOTA standard functionality and described there in the wiki. It depends if your shutter switches are push buttons, are ON/OFF switches then, if the Relay should toogle or follow or inverse follow. You have to define this. The ONLY limitation for my shutters is NEVER both switches ON. On my shutter in the kitchen this position is physically blocked. both OFF work but not both on. You have to switch one off before.

@stefanbode
Copy link
Owner

If your switched where PUSHBUTTONS like the TOGGLE in the webinterface this would be the easiest

@B1G1
Copy link
Author

B1G1 commented Jul 11, 2018

well... my switches are pushbuttons like this https://www.gewiss.com/content/dam/gwdam/product/GW/40/00/15/25/GW40001525/_jcr_content/renditions/original.svg
I think they are like yours... only one can be on, up or down

@B1G1
Copy link
Author

B1G1 commented Jul 11, 2018

I found that 18 button2 on GPIO9 works for down, but nothing works on GPIO0 for up.... I don't know why

@stefanbode
Copy link
Owner

I found one "bug". If you have switch1 ON and then just switch over without any delay to switch2 on it does also not work on my side. it works, if you switch OFF first and then the other ON. Can you test, if you have the same problem

@B1G1
Copy link
Author

B1G1 commented Jul 11, 2018

I can't do it on wall switch, if I release up button then it's off

@stefanbode
Copy link
Owner

Ok, i wonder why you have GPIO9 but anyway. OK this is not the error. Do you get any log in the console if you hit the GPIO0 button. Please put logfile here or call me on skype stefan.bode

@B1G1
Copy link
Author

B1G1 commented Jul 11, 2018

sorry, I had to leave.

I just configured my sonoff dual r2 like this https://github.com/arendst/arendst.github.io/raw/master/media/dualr2d.jpg

but now I have 18 button2 on GPIO9 and 19 button 3 in GPIO0

log using the the webgui

18:40:57 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"ON"}
18:40:57 MQT: stat/tapparellaStudio/POWER1 = ON
18:40:57 Start moving shutter...
18:40:57 Shutter is moving 3, power: 1, join: 1, direction: 1
18:40:57 Shutter: Real Position 41992, Target 48000, source: Shutter
18:40:57 SRC: PulseTimer
18:40:57 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"OFF"}
18:40:57 MQT: stat/tapparellaStudio/POWER1 = OFF
18:40:58 Shutter: Real Position 43992, Target 48000, source: PulseTimer
18:40:59 Shutter: Real Position 45992, Target 48000, source: PulseTimer
18:40:59 SRC: WebGui from 192.168.1.23
18:40:59 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"ON"}
18:40:59 MQT: stat/tapparellaStudio/POWER1 = ON
18:40:59 Switch OFF motors. Target: 46292, source: 0
18:40:59 NEW Shutter: Stopped Position 46292, relay: 0, pulsetimer: 5
18:40:59 CFG: Saved to flash at F6, Count 104, Bytes 3812
18:41:00 SRC: PulseTimer
18:41:00 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"OFF"}
18:41:00 MQT: stat/tapparellaStudio/POWER1 = OFF
18:41:04 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-11T18:41:04","SHUTTER":96}
18:41:16 SRC: WebGui from 192.168.1.23
18:41:16 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"ON"}
18:41:16 MQT: stat/tapparellaStudio/POWER2 = ON
18:41:16 Start moving shutter...
18:41:16 Shutter is moving 3, power: 2, join: 2, direction: -1
18:41:16 Shutter: Real Position 45950, Target 0, source: Shutter
18:41:16 SRC: PulseTimer
18:41:16 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"OFF"}
18:41:16 MQT: stat/tapparellaStudio/POWER2 = OFF
18:41:17 Shutter: Real Position 43670, Target 0, source: PulseTimer
18:41:18 Shutter: Real Position 41390, Target 0, source: PulseTimer
18:41:19 SRC: WebGui from 192.168.1.23
18:41:19 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"ON"}
18:41:19 MQT: stat/tapparellaStudio/POWER2 = ON
18:41:19 Switch OFF motors. Target: 40022, source: 0
18:41:19 NEW Shutter: Stopped Position 40022, relay: 1, pulsetimer: 5
18:41:19 SRC: PulseTimer
18:41:19 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"OFF"}
18:41:19 MQT: stat/tapparellaStudio/POWER2 = OFF
18:41:19 CFG: Saved to flash at F5, Count 105, Bytes 3812

from the wall buttons no logs if I push up, while this if I push down

18:43:44 APP: Button2 immediate
18:43:44 SRC: Button
18:43:44 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"ON"}
18:43:44 MQT: stat/tapparellaStudio/POWER2 = ON
18:43:44 Start moving shutter...
18:43:44 Shutter is moving 3, power: 2, join: 2, direction: -1
18:43:45 SRC: PulseTimer
18:43:45 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"OFF"}
18:43:45 MQT: stat/tapparellaStudio/POWER2 = OFF
18:43:45 Shutter: Real Position 38426, Target 0, source: PulseTimer
18:43:46 Shutter: Real Position 36146, Target 0, source: PulseTimer
18:43:47 APP: Button2 immediate
18:43:47 SRC: Button
18:43:47 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"ON"}
18:43:47 MQT: stat/tapparellaStudio/POWER2 = ON
18:43:47 Switch OFF motors. Target: 35234, source: 3
18:43:47 NEW Shutter: Stopped Position 35234, relay: 1, pulsetimer: 5
18:43:47 CFG: Saved to flash at F4, Count 106, Bytes 3812
18:43:47 SRC: PulseTimer
18:43:47 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"OFF"}
18:43:47 MQT: stat/tapparellaStudio/POWER2 = OFF

@stefanbode
Copy link
Owner

Shuttersetclose is not shutterclose. It was only introduced to calibrate the close position. Therefore it is not a big deal if it behaves wrong only once. Normally you do not send this command after installing.

@B1G1
Copy link
Author

B1G1 commented Aug 19, 2018

yes I know, but in some situations I lose position synchronization, so I reset the shutter...

@stefanbode
Copy link
Owner

Can you post me from the shutter above the configuration settings reported in the log on the beginning. It moves correctly to position 16050. but maybe this position is wrong. There is a clear stop at this position and also the reported position after this in 10%. So from the log file no errors. Does the shutter still moves after the second power off.

@B1G1
Copy link
Author

B1G1 commented Aug 19, 2018

this?
Shutter 0 (Relay:1): Init. Pos: 29895 [49 %], Open Vel.: 100 Close Vel.: 109 , Max Way: 48000, Opentime 24 [s], Closetime 22 [s], Calc: m1: 355, b1 12500, m2: 2855, binmask 3

now it's half opened.

Yes after the second power off the shutter still moves to 100%

@stefanbode
Copy link
Owner

Hmm, this is Strange. The software try to switch off, but the motor does not follow. Maybe you can increase the pulsetime a bit. In the software I cannot change anything because this is doing the right thing.

@B1G1
Copy link
Author

B1G1 commented Aug 19, 2018

Ok, I just tried with pulsetime 3 instead of 2 and it worked well.

I will test it more these days

@stefanbode
Copy link
Owner

That’s great. Maybe the Relais needs some more time under special conditions. Good to know it worked now. Will change the suggested pulsetime in the wiki.

@madmicio
Copy link

madmicio commented Sep 7, 2018

Hi! i'm using setoption80 1, setoption81 1, setoption14 1.
Why when I open the shutter and stop the shutter stops and closes properly? why doesn't stop only?

01:21:09 MQT: stat/dual_cucina/RESULT = {"POWER1":"ON"}
01:21:09 MQT: stat/dual_cucina/POWER1 = ON
01:21:09 MQT: stat/dual_cucina/RESULT = {"shutteropen1":100}
01:21:10 Shutter 0: Real Pos: 1000, Target 40000, source: , pos %: 0, direction: 1, rtcshutter: 11
01:21:11 Shutter 0: Real Pos: 3000, Target 40000, source: , pos %: 0, direction: 1, rtcshutter: 31
01:21:12 Shutter 0: Real Pos: 5000, Target 40000, source: , pos %: 0, direction: 1, rtcshutter: 51
01:21:13 Shutter 0: Real Pos: 7000, Target 40000, source: , pos %: 0, direction: 1, rtcshutter: 71
01:21:14 Shutter 0: Real Pos: 9000, Target 40000, source: , pos %: 0, direction: 1, rtcshutter: 91
01:21:14 MQT: stat/dual_cucina/RESULT = {"POWER1":"ON"}
01:21:14 MQT: stat/dual_cucina/POWER1 = ON
01:21:14 MQT: stat/dual_cucina/RESULT = {"POWER1":"OFF"}
01:21:14 MQT: stat/dual_cucina/POWER1 = OFF
01:21:15 MQT: stat/dual_cucina/RESULT = {"POWER2":"ON"}
01:21:15 MQT: stat/dual_cucina/POWER2 = ON
01:21:15 MQT: stat/dual_cucina/RESULT = {"shutterstop1":0}
01:21:15 Shutter 0: Real Pos: 4200, Target 0, source: , pos %: 23, direction: -1, rtcshutter: 26
01:21:17 MQT: tele/dual_cucina/STATE = {"Time":"2018-09-07T01:21:16","Uptime":"0T00:28:53","Vcc":3.218,"POWER1":"OFF","POWER2":"ON", "Wifi":{"AP":1, "SSId":"Fast-Arci", "RSSI":92, "APMac":"9C:97:26:89:81:7B"}, "DeepSleep":0, "Heap":15016}
01:21:17 MQT: tele/dual_cucina/SENSOR = {"Time":"2018-09-07T01:21:17","SHUTTER-1":23}
01:21:17 Shutter 0: Real Pos: 200, Target 0, source: , pos %: 23, direction: -1, rtcshutter: 47
01:21:17 MQT: stat/dual_cucina/SHUTTER1 = 0
01:21:17 MQT: stat/dual_cucina/RESULT = {"POWER2":"OFF"}
01:21:17 MQT: stat/dual_cucina/POWER2 = OFF

@stefanbode
Copy link
Owner

stefanbode commented Sep 7, 2018

There was an issue with the stop in an older version. It should not happen in the current one. Can you please confirm using the latest version.

01:21:15 MQT: stat/dual_cucina/RESULT = {"shutterstop1":0}

This should not happen. The position must be the actual one automatically filled in by the programm. Instead of 0 I expect something like 21 in your case.

@madmicio
Copy link

madmicio commented Sep 7, 2018

Version 6.1.1.13

@stefanbode
Copy link
Owner

ok, and I assume you send the shutterstop without additional parameter like: shutterstop1 0. can you increase the loglevel. maybe we get some more insight.

@madmicio
Copy link

madmicio commented Sep 7, 2018

no additional parameter.
i donwloaded the master version fron this link:
https://github.com/stefanbode/Sonoff-Tasmota

I copied the contents to C:\idearduino242\portable\sketchbook and renamed the lib folder to libraries. I edited and sent it to dual r2. 8266 version 2.4.2
2018-09-07

@madmicio
Copy link

madmicio commented Sep 7, 2018

2018-09-07 15:30:58 WARNING (MainThread) [homeassistant.components.cover.mqtt] Payload is not True, False, or integer (0-100): {"POWER2":"ON"}
2018-09-07 15:30:58 WARNING (MainThread) [homeassistant.components.cover.mqtt] Payload is not True, False, or integer (0-100): {"shutterstop1":0}
2018-09-07 15:30:59 WARNING (MainThread) [homeassistant.components.cover.mqtt] Payload is not True, False, or integer (0-100): {"shutterstop1":0}
2018-09-07 15:30:59 WARNING (MainThread) [homeassistant.components.cover.mqtt] Payload is not True, False, or integer (0-100): {"POWER2":"OFF"}
2018-09-07 15:31:27 WARNING (MainThread) [homeassistant.components.cover.mqtt] Payload is not True, False, or integer (0-100): {"POWER2":"ON"}
2018-09-07 15:31:27 WARNING (MainThread) [homeassistant.components.cover.mqtt] Payload is not True, False, or integer (0-100): {"shutterstop1":0}
2018-09-07 15:31:28 WARNING (MainThread) [homeassistant.components.cover.mqtt] Payload is not True, False, or integer (0-100): {"shutterstop1":0}
2018-09-07 15:31:28 WARNING (MainThread) [homeassistant.components.cover.mqtt] Payload is not True, False, or integer (0-100): {"POWER2":"OFF"}

@stefanbode
Copy link
Owner

This is a homeassistant problem, because ON OFF ist standard Tasmota

@madmicio
Copy link

madmicio commented Sep 7, 2018

this is what happens when in home assistant send the command:
Stop, stop, stop, stop.

if I send cmnd /dual_cucina/shutterstop command from mqtt.fx when the shutter is stopped. however the shutter closes up to position 0.

it is therefore not only a problem of home assistant

@stefanbode
Copy link
Owner

Do you have momentary shutters that only need a pulse to start and stop or does your shutter need full time the power during operation. I assume second. Please set loglevel to 6 and send me again a logfile

@madmicio
Copy link

madmicio commented Sep 7, 2018

I'm sorry, but I do not know what you're talking about. I do not know how to manage the logs

@madmicio
Copy link

madmicio commented Sep 7, 2018

syslog 4 from console: when press stop

15:36:58 MQT: stat/dual_cucina/RESULT = {"POWER2":"ON"}
15:36:58 MQT: stat/dual_cucina/POWER2 = ON
15:36:58 MQT: stat/dual_cucina/RESULT = {"shutterstop1":0}
15:36:59 Shutter 0: Real Pos: 18600, Target 0, source: , pos %: 100, direction: -1, rtcshutter: 15
15:37:00 Shutter 0: Real Pos: 16600, Target 0, source: , pos %: 100, direction: -1, rtcshutter: 35
15:37:01 Shutter 0: Real Pos: 14600, Target 0, source: , pos %: 100, direction: -1, rtcshutter: 55
15:37:02 MQT: tele/dual_cucina/STATE = {"Time":"2018-09-07T15:37:02","Uptime":"0T01:28:41","Vcc":3.463,"POWER1":"OFF","POWER2":"ON", "Wifi":{"AP":1, "SSId":"Fast-Arci", "RSSI":100, "APMac":"9C:97:26:89:81:7B"}, "DeepSleep":0, "Heap":21128}
15:37:02 MQT: tele/dual_cucina/SENSOR = {"Time":"2018-09-07T15:37:02","SHUTTER-1":100}
15:37:02 Shutter 0: Real Pos: 12600, Target 0, source: , pos %: 100, direction: -1, rtcshutter: 75
15:37:03 Shutter 0: Real Pos: 10600, Target 0, source: , pos %: 100, direction: -1, rtcshutter: 95
15:37:04 Shutter 0: Real Pos: 8600, Target 0, source: , pos %: 100, direction: -1, rtcshutter: 115
15:37:05 Shutter 0: Real Pos: 6600, Target 0, source: , pos %: 100, direction: -1, rtcshutter: 135
15:37:06 Shutter 0: Real Pos: 4600, Target 0, source: , pos %: 100, direction: -1, rtcshutter: 155
15:37:07 Shutter 0: Real Pos: 2600, Target 0, source: , pos %: 100, direction: -1, rtcshutter: 175
15:37:08 Shutter 0: Real Pos: 600, Target 0, source: , pos %: 100, direction: -1, rtcshutter: 195
15:37:08 MQT: stat/dual_cucina/SHUTTER1 = 0
15:37:08 MQT: stat/dual_cucina/RESULT = {"POWER2":"OFF"}
15:37:08 MQT: stat/dual_cucina/POWER2 = OFF

@stefanbode
Copy link
Owner

this is to late. If there is a shutterstop 0 then it will for sure go to the end. Question is: why is there a shutterstop 0. please also do a SHUTTERRELAY1 to get info about the configuration of the shutter. thx

@stefanbode
Copy link
Owner

ok i got it . i was able to reproduce

@madmicio
Copy link

madmicio commented Sep 7, 2018

16:38:53 CMD: SHUTTERRELAY1
16:38:53 MQT: stat/dual_cucina/RESULT = {"shutterrelay1":1}

@stefanbode
Copy link
Owner

Ok, hopefully, this is the only bug here. I uploaded a new version and are not able to reproduce it anymore. sorry for the inconvenience.

@madmicio
Copy link

madmicio commented Sep 7, 2018

Thanks!!!!!!!!
there is still another small problem. if I press the opening button, the shutter opens and if I press the opening button again, the shutter stops correctly. the problem arises when I press the button opens the shutter opens but if I press the button closes while the shutter is opening, the shutter stops and for some milliseconds turns on the closing relay. and viceversa

@stefanbode
Copy link
Owner

This issue is known an really hard to solve because the basic firmware switches on the relay before I get notice. The only thing I can do is to switch it off again.

@madmicio
Copy link

madmicio commented Sep 8, 2018

Can I propose an alternative? I do not know if it's possible. You could not stop it. In this way, if you want to stop the shutter, press the button of the same direction of travel, but if you press the opposite button, the shutter simply reverses the direction.

@stefanbode
Copy link
Owner

With the latest change I checked in yesterday my assumption is, if you toggle on the web interface the close button the shutter should stop from opening and start closing. I made some changes to the interlock mode to ensure some false positives that switches off relays. Please send a log file to help me understand what happens why.

@madmicio
Copy link

madmicio commented Sep 9, 2018

commands from the web interface. same result with the commands from physical buttons

========= open button + open button=============

16:31:58 RSL: RESULT = {"POWER1":"ON"} //pressed opening button
16:31:58 RSL: POWER1 = ON
16:31:58 Shutter 0: Real Pos: 8000, Target 20000, source: , pos %: 40, direction: 1, rtcshutter: 1
16:31:59 Shutter 0: Real Pos: 10000, Target 20000, source: , pos %: 40, direction: 1, rtcshutter: 21
16:32:00 Shutter 0: Real Pos: 12000, Target 20000, source: , pos %: 40, direction: 1, rtcshutter: 41
16:32:00 RSL: RESULT = {"POWER1":"OFF"} //pressed opening button again
16:32:00 RSL: POWER1 = OFF
16:32:00 RSL: SHUTTER1 = 63
16:32:00 RSL: RESULT = {"POWER1":"OFF"} // why this second stop command?
16:32:00 RSL: POWER1 = OFF

========= open button + stop button=============

16:30:20 RSL: RESULT = {"POWER1":"ON"} //pressed opening button
16:30:20 RSL: POWER1 = ON
16:30:21 Shutter 0: Real Pos: 700, Target 20000, source: , pos %: 0, direction: 1, rtcshutter: 8
16:30:22 Shutter 0: Real Pos: 2700, Target 20000, source: , pos %: 0, direction: 1, rtcshutter: 28
16:30:23 Shutter 0: Real Pos: 4700, Target 20000, source: , pos %: 0, direction: 1, rtcshutter: 48
16:30:24 Shutter 0: Real Pos: 6700, Target 20000, source: , pos %: 0, direction: 1, rtcshutter: 68
16:30:24 RSL: RESULT = {"POWER1":"OFF"} //pressed closing button
16:30:24 RSL: POWER1 = OFF
16:30:24 RSL: RESULT = {"POWER2":"ON"}
16:30:24 RSL: POWER2 = ON
16:30:24 RSL: SHUTTER1 = 40
16:30:24 RSL: RESULT = {"POWER2":"OFF"} // the shutter works for some millisencodes in the opposite direction and stops. because instead the shutter does not go in the closed position?
16:30:24 RSL: POWER2 = OFF
16:30:24 RSL: RESULT = {"POWER1":"OFF"}
16:30:24 RSL: POWER1 = OFF

@stefanbode
Copy link
Owner

hi @madmicio the bug should now be finally fixed and the shutter will work as you requested. there is no millisecond ON again. I followed and the intended behavior, that the shutter in this case just moves in the opposite direction. quite a lot of testing because supporting 3 different configurations. As you can see in the middle the switch is now correct and the shutter changes direction. Looks easier than it was.

12:44:06 MQT: hm/status/sonoff/RESULT = {"POWER2":"ON"}
12:44:06 MQT: hm/status/sonoff/POWER2 = ON (retained)
12:44:07 Shutter 0: Real Pos: 18500, Target 0, source: Shutter, pos %: 100, direction: -1, rtcshutter: 16
12:44:08 Shutter 0: Real Pos: 16500, Target 0, source: Shutter, pos %: 100, direction: -1, rtcshutter: 36
12:44:09 Shutter 0: Real Pos: 14500, Target 0, source: Shutter, pos %: 100, direction: -1, rtcshutter: 56
12:44:10 Shutter 0: Real Pos: 12500, Target 0, source: Shutter, pos %: 100, direction: -1, rtcshutter: 76
12:44:11 MQT: hm/status/sonoff/RESULT = {"POWER2":"OFF"}
12:44:11 MQT: hm/status/sonoff/POWER2 = OFF (retained)
12:44:11 MQT: hm/status/sonoff/RESULT = {"POWER1":"ON"}
12:44:11 MQT: hm/status/sonoff/POWER1 = ON (retained)

12:44:11 MQT: hm/status/sonoff/SHUTTER1 = 53 (retained)
12:44:12 Shutter 0: Real Pos: 10500, Target 20000, source: Shutter, pos %: 47, direction: 1, rtcshutter: 10
12:44:13 Shutter 0: Real Pos: 12500, Target 20000, source: Shutter, pos %: 47, direction: 1, rtcshutter: 30
12:44:14 Shutter 0: Real Pos: 14500, Target 20000, source: Shutter, pos %: 47, direction: 1, rtcshutter: 50
12:44:15 Shutter 0: Real Pos: 16500, Target 20000, source: Shutter, pos %: 47, direction: 1, rtcshutter: 70
12:44:16 Shutter 0: Real Pos: 18500, Target 20000, source: Shutter, pos %: 47, direction: 1, rtcshutter: 90
12:44:17 MQT: hm/status/sonoff/SHUTTER1 = 0 (retained)
12:44:17 MQT: hm/status/sonoff/RESULT = {"POWER1":"OFF"}
12:44:17 MQT: hm/status/sonoff/POWER1 = OFF (retained)
12:45:31 MQT: hm/status/sonoff/STATE = {"Time":"2018-09-11T12:45:31","Uptime":"0T00:05:19","POWER1":"OFF","POWER2":"OFF","POWER3":"OFF","POWER4":"OFF","POWER5":"OFF","POWER6":"OFF", "Wifi":{"AP":1, "SSId":"BodeNet_Keller", "RSSI":90, "APMac":"7C:FF:4D:3D:A3:5B"}, "DeepSleep":0, "Heap":2
1424}

@madmicio
Copy link

madmicio commented Sep 11, 2018

HI! thank you very mach.
I installed the firmware now works well.
only problem the button1 option for the GPIO0 has disappeared

sorry, it works perfectly. it was my mistake!
sorry, it works perfectly. it was my mistake!
sorry, it works perfectly. it was my mistake!
sorry, it works perfectly. it was my mistake!
sorry, it works perfectly. it was my mistake!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants