stefanbode / Sonoff-Tasmota

Provide ESP8266 based itead Sonoff with Web, MQTT and OTA firmware using Arduino IDE, enhanced with I2C options
GNU General Public License v3.0
126 stars 41 forks source link

Momentary mode #46

Closed B1G1 closed 5 years ago

B1G1 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Yes exactly

stefanbode commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

stefanbode commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

B1G1 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Please see the updated WIKI section for shutters

B1G1 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

B1G1 commented 6 years ago

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 commented 6 years ago

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

stefanbode commented 6 years ago

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 commented 6 years ago

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

stefanbode commented 6 years ago

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 commented 6 years ago

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
B1G1 commented 6 years ago

Solved it! I had to set SwitchMode1 and SwitchMode2 to 4, that is inverted PUSHBUTTON (Normally 0, 1 = toggle) leaving this configuration https://github.com/arendst/arendst.github.io/raw/master/media/dualr2d.jpg

Now the position is updated correctly. That's fantastic!

Sometimes however it happens that the shutter moves to 100 or 0 independently. Now for example I moved it down and stopped it with the wall buttons and shortly thereafter it totally closed with this log

20:12:33 SRC: Shutter
20:12:33 MQT: stat/tapparellaCamera2/RESULT = {"POWER2":"ON"}
20:12:33 MQT: stat/tapparellaCamera2/POWER2 = ON
20:12:34 SRC: PulseTimer
20:12:34 MQT: stat/tapparellaCamera2/RESULT = {"POWER2":"OFF"}
20:12:34 MQT: stat/tapparellaCamera2/POWER2 = OFF
20:12:34 CFG: Saved to flash at FB, Count 58, Bytes 3812
20:12:35 MQT: tele/tapparellaCamera2/SENSOR = {"Time":"2018-07-11T20:12:35","Switch1":"OFF","Switch2":"OFF","SHUTTER":0}
stefanbode commented 6 years ago

Hi Bigi, one question. How long after the stop the move happens. Less than one second? For our 50% 70% movement problem I have a simple and great idea. Please be patient. The log is to short. I need the information above to see why the power ON was initiated by the shutter. Especially which of the ‚if‘ where responsible.

B1G1 commented 6 years ago

Hi, the movement happens after some seconds, for sure not less than one.

Wow can’t wait to know your idea! :-D

stefanbode commented 6 years ago

Ok, this is really strange behavior haven't seen on my testbench. Please provide a detailed log from the moment you pushed the stop bottom. Maybe there is something useful visible that causes the software to start the shutter again.

stefanbode commented 6 years ago

Hi Bigi, please try with the new firmware following process.:

Now the following should be: 0-5 % is used to open close the holes in the shutter. 5-100 percent should represent the real opening % of the shutter. The 5% is hard coded. To reset the complete magic you can set either shutter50percent to 50 or 0. Both revert back to default behavior.

B1G1 commented 6 years ago

hi Stefan I'm testing the latest version with this cool feature. after restart I send the command shutterposition 5 and the shutter opened totally

17:50:28 MQT: tele/tapparellaStudio/INFO3 = {"RestartReason":"Software/System restart"}
17:50:28 SRC: MQTT
17:50:28 RSL: Group 0, Index 1, Command BACKLOG, Data 33
17:50:28 SRC: MQTT
17:50:28 RSL: Group 0, Index 1, Command BACKLOG SHUTTERPOSITION, Data 52
17:50:28 Shutter: Command Code: 'BACKLOG SHUTTERPOSITION', Payload: 52
17:50:28 MQT: stat/tapparellaStudio/RESULT = {"Command":"Unknown"}
17:50:28 SRC: Backlog
17:50:28 RSL: Group 0, Index 33, Command , Data 
17:50:28 Shutter: Command Code: '', Payload: -99
17:50:28 MQT: stat/tapparellaStudio/RESULT = {"Command":"Unknown"}
17:50:29 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"OFF"}
17:50:29 MQT: stat/tapparellaStudio/POWER1 = OFF
17:50:29 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"OFF"}
17:50:29 MQT: stat/tapparellaStudio/POWER2 = OFF
17:50:36 MQT: tele/tapparellaStudio/STATE = {"Time":"2018-07-12T17:50:36","Uptime":"0T00:00:15","Vcc":3.438,"POWER1":"OFF","POWER2":"OFF", "Wifi":{"AP":1, "SSId":"FRITZ2.4", "RSSI":100, "APMac":"C8:0E:14:1E:C4:9C"}, "DeepSleep":0, "Heap":14784}
17:50:36 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T17:50:36","Switch1":"OFF","Switch2":"OFF","SHUTTER":0}
17:50:42 CMD: shutterposition 5
17:50:42 SRC: WebConsole from 192.168.1.23
17:50:42 RSL: Group 0, Index 1, Command SHUTTERPOSITION, Data 5
17:50:42 Shutter: Command Code: 'SHUTTERPOSITION', Payload: 5
17:50:42 SRC: Shutter
17:50:42 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"ON"}
17:50:42 MQT: stat/tapparellaStudio/POWER1 = ON
17:50:42 MQT: stat/tapparellaStudio/RESULT = {"shutterposition":5}
17:50:42 NEW Shutter: Stopped Position 100, relay: 0, pulsetimer: 5
17:50:42 SRC: Shutter
17:50:42 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"ON"}
17:50:42 MQT: stat/tapparellaStudio/POWER1 = ON
17:50:42 SRC: PulseTimer
17:50:42 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"OFF"}
17:50:42 MQT: stat/tapparellaStudio/POWER1 = OFF
17:51:36 MQT: tele/tapparellaStudio/STATE = {"Time":"2018-07-12T17:51:36","Uptime":"0T00:01:15","Vcc":3.439,"POWER1":"OFF","POWER2":"OFF", "Wifi":{"AP":1, "SSId":"FRITZ2.4", "RSSI":100, "APMac":"C8:0E:14:1E:C4:9C"}, "DeepSleep":0, "Heap":14760}
17:51:36 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T17:51:36","Switch1":"OFF","Switch2":"OFF","SHUTTER":0}

then after a shutteropen command (since the position was 0), I sent the shutterposition 50 and I can say the it works, the shutter stopped at 49 that is ok. In the previous log there is at the begin a backlog command that I have always when the sonoff restarts, how can I delete that?

then this is a log where I was trying to stop at 50% to use the shutter50percet command, when I stopped at 50% after some seconds the shutter opened totally

17:45:03 HTP: Main Menu
17:45:04 HTP: Configuration
17:45:05 HTP: Configure Logging
17:45:09 HTP: Configuration
17:45:11 HTP: Main Menu
17:45:12 HTP: Console
17:45:13 MQT: tele/tapparellaStudio/STATE = {"Time":"2018-07-12T17:45:13","Uptime":"0T00:08:46","Vcc":3.439,"POWER1":"OFF","POWER2":"OFF", "Wifi":{"AP":1, "SSId":"FRITZ2.4", "RSSI":100, "APMac":"C8:0E:14:1E:C4:9C"}, "DeepSleep":0, "Heap":14480}
17:45:13 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T17:45:13","Switch1":"OFF","Switch2":"OFF","SHUTTER":100}
17:45:17 SRC: Switch
17:45:17 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"ON"}
17:45:17 MQT: stat/tapparellaStudio/POWER2 = ON
17:45:17 Start moving shutter...
17:45:17 Shutter is moving 3, power: 2, join: 2, direction: -1
17:45:18 SRC: PulseTimer
17:45:18 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"OFF"}
17:45:18 MQT: stat/tapparellaStudio/POWER2 = OFF
17:45:18 Shutter: Real Position 46786, Target 0, source: PulseTimer
17:45:19 Shutter: Real Position 44506, Target 0, source: PulseTimer
17:45:20 Shutter: Real Position 42226, Target 0, source: PulseTimer
17:45:21 Shutter: Real Position 39946, Target 0, source: PulseTimer
17:45:22 Shutter: Real Position 37666, Target 0, source: PulseTimer
17:45:23 MQT: tele/tapparellaStudio/STATE = {"Time":"2018-07-12T17:45:23","Uptime":"0T00:08:56","Vcc":3.439,"POWER1":"OFF","POWER2":"OFF", "Wifi":{"AP":1, "SSId":"FRITZ2.4", "RSSI":100, "APMac":"C8:0E:14:1E:C4:9C"}, "DeepSleep":0, "Heap":14480}
17:45:23 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T17:45:23","Switch1":"OFF","Switch2":"OFF","SHUTTER":73}
17:45:23 Shutter: Real Position 35386, Target 0, source: PulseTimer
17:45:24 Shutter: Real Position 33106, Target 0, source: PulseTimer
17:45:25 Shutter: Real Position 30826, Target 0, source: PulseTimer
17:45:26 SRC: Switch
17:45:26 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"ON"}
17:45:26 MQT: stat/tapparellaStudio/POWER2 = ON
17:45:26 Switch OFF motors. Target: 28546, source: 4
17:45:26 NEW Shutter: Stopped Position 28546, relay: 1, pulsetimer: 5
17:45:26 SRC: PulseTimer
17:45:26 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"OFF"}
17:45:26 MQT: stat/tapparellaStudio/POWER2 = OFF
17:45:26 CFG: Saved to flash at F6, Count 150, Bytes 3812
17:45:27 SRC: Switch
17:45:27 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"ON"}
17:45:27 MQT: stat/tapparellaStudio/POWER1 = ON
17:45:27 Start moving shutter...
17:45:27 Shutter is moving 3, power: 1, join: 1, direction: 1
17:45:28 SRC: PulseTimer
17:45:28 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"OFF"}
17:45:28 MQT: stat/tapparellaStudio/POWER1 = OFF
17:45:28 Shutter: Real Position 29646, Target 48000, source: PulseTimer
17:45:28 SRC: Switch
17:45:28 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"ON"}
17:45:28 MQT: stat/tapparellaStudio/POWER1 = ON
17:45:28 Switch OFF motors. Target: 30146, source: 4
17:45:28 NEW Shutter: Stopped Position 30146, relay: 0, pulsetimer: 5
17:45:28 CFG: Saved to flash at F5, Count 151, Bytes 3812
17:45:29 SRC: PulseTimer
17:45:29 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"OFF"}
17:45:29 MQT: stat/tapparellaStudio/POWER1 = OFF
17:45:33 MQT: tele/tapparellaStudio/STATE = {"Time":"2018-07-12T17:45:33","Uptime":"0T00:09:06","Vcc":3.438,"POWER1":"OFF","POWER2":"OFF", "Wifi":{"AP":1, "SSId":"FRITZ2.4", "RSSI":100, "APMac":"C8:0E:14:1E:C4:9C"}, "DeepSleep":0, "Heap":14480}
17:45:33 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T17:45:33","Switch1":"OFF","Switch2":"OFF","SHUTTER":62}
17:45:43 MQT: tele/tapparellaStudio/STATE = {"Time":"2018-07-12T17:45:43","Uptime":"0T00:09:16","Vcc":3.438,"POWER1":"OFF","POWER2":"OFF", "Wifi":{"AP":1, "SSId":"FRITZ2.4", "RSSI":100, "APMac":"C8:0E:14:1E:C4:9C"}, "DeepSleep":0, "Heap":14480}
17:45:43 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T17:45:43","Switch1":"OFF","Switch2":"OFF","SHUTTER":62}
17:45:52 SRC: Switch
17:45:52 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"ON"}
17:45:52 MQT: stat/tapparellaStudio/POWER1 = ON
17:45:52 Start moving shutter...
17:45:52 Shutter is moving 3, power: 1, join: 1, direction: 1
17:45:53 SRC: PulseTimer
17:45:53 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"OFF"}
17:45:53 MQT: stat/tapparellaStudio/POWER1 = OFF
17:45:53 MQT: tele/tapparellaStudio/STATE = {"Time":"2018-07-12T17:45:53","Uptime":"0T00:09:26","Vcc":3.440,"POWER1":"OFF","POWER2":"OFF", "Wifi":{"AP":1, "SSId":"FRITZ2.4", "RSSI":100, "APMac":"C8:0E:14:1E:C4:9C"}, "DeepSleep":0, "Heap":14480}
17:45:53 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T17:45:53","Switch1":"OFF","Switch2":"OFF","SHUTTER":65}
17:45:53 Shutter: Real Position 31546, Target 48000, source: PulseTimer
17:45:54 SRC: Switch
17:45:54 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"ON"}
17:45:54 MQT: stat/tapparellaStudio/POWER2 = ON
17:45:54 Switch OFF motors. Target: 33046, source: 4
17:45:54 NEW Shutter: Stopped Position 33046, relay: 0, pulsetimer: 5
17:45:54 SRC: PulseTimer
17:45:54 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"OFF"}
17:45:54 MQT: stat/tapparellaStudio/POWER2 = OFF
17:45:54 CFG: Saved to flash at F4, Count 152, Bytes 3812
17:45:56 SRC: Switch
17:45:56 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"ON"}
17:45:56 MQT: stat/tapparellaStudio/POWER2 = ON
17:45:56 Start moving shutter...
17:45:56 Shutter is moving 3, power: 2, join: 2, direction: -1
17:45:56 Shutter: Real Position 33046, Target 0, source: Shutter
17:45:56 SRC: PulseTimer
17:45:56 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"OFF"}
17:45:56 MQT: stat/tapparellaStudio/POWER2 = OFF
17:45:57 Shutter: Real Position 30766, Target 0, source: PulseTimer
17:45:58 Shutter: Real Position 28486, Target 0, source: PulseTimer
17:45:59 Shutter: Real Position 26206, Target 0, source: PulseTimer
17:46:00 Shutter: Real Position 23926, Target 0, source: PulseTimer
17:46:01 Shutter: Real Position 21646, Target 0, source: PulseTimer
17:46:02 Shutter: Real Position 19366, Target 0, source: PulseTimer
17:46:03 MQT: tele/tapparellaStudio/STATE = {"Time":"2018-07-12T17:46:03","Uptime":"0T00:09:36","Vcc":3.438,"POWER1":"OFF","POWER2":"OFF", "Wifi":{"AP":1, "SSId":"FRITZ2.4", "RSSI":100, "APMac":"C8:0E:14:1E:C4:9C"}, "DeepSleep":0, "Heap":14480}
17:46:03 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T17:46:03","Switch1":"OFF","Switch2":"OFF","SHUTTER":35}
17:46:03 Shutter: Real Position 17086, Target 0, source: PulseTimer
17:46:04 Shutter: Real Position 14806, Target 0, source: PulseTimer
17:46:05 Shutter: Real Position 12526, Target 0, source: PulseTimer
17:46:06 Shutter: Real Position 10246, Target 0, source: PulseTimer
17:46:07 Shutter: Real Position 7966, Target 0, source: PulseTimer
17:46:08 Shutter: Real Position 5686, Target 0, source: PulseTimer
17:46:09 Shutter: Real Position 3406, Target 0, source: PulseTimer
17:46:10 Shutter: Real Position 1126, Target 0, source: PulseTimer
17:46:10 NEW Shutter: Stopped Position 100, relay: 1, pulsetimer: 5
17:46:10 SRC: Shutter
17:46:10 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"ON"}
17:46:10 MQT: stat/tapparellaStudio/POWER2 = ON
17:46:10 CFG: Saved to flash at FB, Count 153, Bytes 3812
17:46:11 SRC: PulseTimer
17:46:11 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"OFF"}
17:46:11 MQT: stat/tapparellaStudio/POWER2 = OFF
17:46:11 SRC: Switch
17:46:11 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"ON"}
17:46:11 MQT: stat/tapparellaStudio/POWER1 = ON
17:46:11 Start moving shutter...
17:46:11 Shutter is moving 3, power: 1, join: 1, direction: 1
17:46:11 Shutter: Real Position 100, Target 48000, source: Shutter
17:46:11 SRC: PulseTimer
17:46:11 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"OFF"}
17:46:11 MQT: stat/tapparellaStudio/POWER1 = OFF
17:46:11 SRC: Switch
17:46:11 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"ON"}
17:46:11 MQT: stat/tapparellaStudio/POWER1 = ON
17:46:11 Switch OFF motors. Target: 1000, source: 4
17:46:11 NEW Shutter: Stopped Position 1000, relay: 0, pulsetimer: 5
17:46:11 CFG: Saved to flash at FA, Count 154, Bytes 3812
17:46:12 SRC: PulseTimer
17:46:12 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"OFF"}
17:46:12 MQT: stat/tapparellaStudio/POWER1 = OFF
17:46:13 SRC: Switch
17:46:13 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"ON"}
17:46:13 MQT: stat/tapparellaStudio/POWER1 = ON
17:46:13 Start moving shutter...
17:46:13 Shutter is moving 3, power: 1, join: 1, direction: 1
17:46:13 MQT: tele/tapparellaStudio/STATE = {"Time":"2018-07-12T17:46:13","Uptime":"0T00:09:46","Vcc":3.439,"POWER1":"ON","POWER2":"OFF", "Wifi":{"AP":1, "SSId":"FRITZ2.4", "RSSI":100, "APMac":"C8:0E:14:1E:C4:9C"}, "DeepSleep":0, "Heap":14480}
17:46:13 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T17:46:13","Switch1":"OFF","Switch2":"OFF","SHUTTER":3}
17:46:13 Shutter: Real Position 1600, Target 48000, source: Shutter
17:46:13 SRC: PulseTimer
17:46:13 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"OFF"}
17:46:13 MQT: stat/tapparellaStudio/POWER1 = OFF
17:46:14 Shutter: Real Position 3600, Target 48000, source: PulseTimer
17:46:15 Shutter: Real Position 5600, Target 48000, source: PulseTimer
17:46:16 Shutter: Real Position 7600, Target 48000, source: PulseTimer
17:46:17 Shutter: Real Position 9600, Target 48000, source: PulseTimer
17:46:18 Shutter: Real Position 11600, Target 48000, source: PulseTimer
17:46:19 Shutter: Real Position 13600, Target 48000, source: PulseTimer
17:46:20 Shutter: Real Position 15600, Target 48000, source: PulseTimer
17:46:21 Shutter: Real Position 17600, Target 48000, source: PulseTimer
17:46:22 Shutter: Real Position 19600, Target 48000, source: PulseTimer
17:46:23 MQT: tele/tapparellaStudio/STATE = {"Time":"2018-07-12T17:46:23","Uptime":"0T00:09:56","Vcc":3.438,"POWER1":"OFF","POWER2":"OFF", "Wifi":{"AP":1, "SSId":"FRITZ2.4", "RSSI":100, "APMac":"C8:0E:14:1E:C4:9C"}, "DeepSleep":0, "Heap":14480}
17:46:23 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T17:46:23","Switch1":"OFF","Switch2":"OFF","SHUTTER":45}
17:46:23 Shutter: Real Position 21600, Target 48000, source: PulseTimer
17:46:24 Shutter: Real Position 23600, Target 48000, source: PulseTimer
17:46:25 Shutter: Real Position 25600, Target 48000, source: PulseTimer
17:46:26 CMD: teleperiod 60
17:46:26 SRC: WebConsole from 192.168.1.23
17:46:26 RSL: Group 0, Index 1, Command TELEPERIOD, Data 60
17:46:26 MQT: stat/tapparellaStudio/RESULT = {"TelePeriod":"60"}
17:46:26 MQT: tele/tapparellaStudio/STATE = {"Time":"2018-07-12T17:46:26","Uptime":"0T00:09:59","Vcc":3.438,"POWER1":"OFF","POWER2":"OFF", "Wifi":{"AP":1, "SSId":"FRITZ2.4", "RSSI":100, "APMac":"C8:0E:14:1E:C4:9C"}, "DeepSleep":0, "Heap":14408}
17:46:26 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T17:46:26","Switch1":"OFF","Switch2":"OFF","SHUTTER":57}
17:46:26 Shutter: Real Position 27600, Target 48000, source: PulseTimer
17:46:26 CFG: Saved to flash at F9, Count 155, Bytes 3812
17:46:27 Shutter: Real Position 29600, Target 48000, source: PulseTimer
17:46:28 Shutter: Real Position 31600, Target 48000, source: PulseTimer
17:46:29 Shutter: Real Position 33600, Target 48000, source: PulseTimer
17:46:30 Shutter: Real Position 35600, Target 48000, source: PulseTimer
17:46:31 Shutter: Real Position 37600, Target 48000, source: PulseTimer
17:46:32 Shutter: Real Position 39600, Target 48000, source: PulseTimer
17:46:33 Shutter: Real Position 41600, Target 48000, source: PulseTimer
17:46:34 Shutter: Real Position 43600, Target 48000, source: PulseTimer
17:46:35 Shutter: Real Position 45600, Target 48000, source: PulseTimer
17:46:36 Shutter: Real Position 47600, Target 48000, source: PulseTimer
17:46:36 NEW Shutter: Stopped Position 48000, relay: 0, pulsetimer: 5
17:46:36 SRC: Shutter
17:46:36 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"ON"}
17:46:36 MQT: stat/tapparellaStudio/POWER1 = ON
17:46:37 CFG: Saved to flash at F8, Count 156, Bytes 3812
17:46:37 SRC: PulseTimer
17:46:37 MQT: stat/tapparellaStudio/RESULT = {"POWER1":"OFF"}
17:46:37 MQT: stat/tapparellaStudio/POWER1 = OFF
B1G1 commented 6 years ago

SHUTTER from teleperiod is not synched with shutterposition

20:53:28 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T20:53:28","Switch1":"OFF","Switch2":"OFF","SHUTTER":100}
20:53:41 CMD: shutterposition 50
20:53:41 SRC: WebConsole from 192.168.1.23
20:53:41 RSL: Group 0, Index 1, Command SHUTTERPOSITION, Data 50
20:53:41 Shutter: Command Code: 'SHUTTERPOSITION', Payload: 50
20:53:41 SRC: Shutter
20:53:41 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"ON"}
20:53:41 MQT: stat/tapparellaStudio/POWER2 = ON
20:53:41 MQT: stat/tapparellaStudio/RESULT = {"shutterposition":50}
20:53:41 SRC: PulseTimer
20:53:41 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"OFF"}
20:53:41 MQT: stat/tapparellaStudio/POWER2 = OFF
20:53:42 Shutter: Real Position 46555, Target 30250, source: PulseTimer
20:53:43 Shutter: Real Position 44275, Target 30250, source: PulseTimer
20:53:44 Shutter: Real Position 41995, Target 30250, source: PulseTimer
20:53:45 Shutter: Real Position 39715, Target 30250, source: PulseTimer
20:53:46 Shutter: Real Position 37435, Target 30250, source: PulseTimer
20:53:47 Shutter: Real Position 35155, Target 30250, source: PulseTimer
20:53:48 Shutter: Real Position 32875, Target 30250, source: PulseTimer
20:53:49 Shutter: Real Position 30595, Target 30250, source: PulseTimer
20:53:49 NEW Shutter: Stopped Position 30139, relay: 1, pulsetimer: 5
20:53:49 SRC: Shutter
20:53:49 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"ON"}
20:53:49 MQT: stat/tapparellaStudio/POWER2 = ON
20:53:49 CFG: Saved to flash at F6, Count 174, Bytes 3812
20:53:49 SRC: PulseTimer
20:53:49 MQT: stat/tapparellaStudio/RESULT = {"POWER2":"OFF"}
20:53:49 MQT: stat/tapparellaStudio/POWER2 = OFF
20:54:28 MQT: tele/tapparellaStudio/STATE = {"Time":"2018-07-12T20:54:28","Uptime":"0T02:26:22","Vcc":3.438,"POWER1":"OFF","POWER2":"OFF", "Wifi":{"AP":1, "SSId":"FRITZ2.4", "RSSI":100, "APMac":"C8:0E:14:1E:C4:9C"}, "DeepSleep":0, "Heap":14376}
20:54:28 MQT: tele/tapparellaStudio/SENSOR = {"Time":"2018-07-12T20:54:28","Switch1":"OFF","Switch2":"OFF","SHUTTER":62}
20:54:42 CMD: shutterposition
20:54:42 SRC: WebConsole from 192.168.1.23
20:54:42 RSL: Group 0, Index 1, Command SHUTTERPOSITION, Data 
20:54:42 Shutter: Command Code: 'SHUTTERPOSITION', Payload: -99
20:54:42 MQT: stat/tapparellaStudio/RESULT = {"shutterposition":49}
stefanbode commented 6 years ago

I assume you mixed with OPEN and CLOSE. 0= close, 5=starts opening, 100 = OPEN. If 5 opens nearly completely your relays are wrong. I am using the standard definition also homematic is using.

stefanbode commented 6 years ago

Regarding the unexpected "continue". I can see in the logs that all Start/Stop are initiated by the SRC: Switch. This is a pulse coming from the Switch. I cannot do anything against it. It looks like the is some bouncing in your switches. at 17:46:10 and the next 3 seconds there are 4!! pressed at the switches.

stefanbode commented 6 years ago

Regarding the wrong position in teleperiod: Yes this was a bug. Fixed and committed to the code.

B1G1 commented 6 years ago

the 4 switch presses are correct, it was me trying to stop exactly at 50% :)

I do not understand what you mean with mixed OPEN and CLOSE.

B1G1 commented 6 years ago

the pulse that opened totally after the 4 switch presses starts here 17:46:36 SRC: Shutter

B1G1 commented 6 years ago

stefan can I use your firmware with a sonoff 4ch that I use to control 2 shutters?

stefanbode commented 6 years ago

I'm pretty sure that this should work. There is no special stuff inside, that should prevent the usage.

stefanbode commented 6 years ago

Regarding mixed relays. You wrote "command shutterposition 5 and the shutter opened totally". This is more than strange. 0 = CLOSE, 100 = OPEN

stefanbode commented 6 years ago

17:46:13 SRC: Switch You tapped Switch1 to fully OPEN the shutter. Current position is nearly closed 17:46:13 Shutter: Real Position 1600, Target 48000, source: Shutter 17:46:26 CMD: teleperiod 60 The shutter is still moving up. you change the teleperiod 17:46:36 NEW Shutter: Stopped Position 48000, relay: 0, pulsetimer: 5 Shutter reached final position fully open and send the STOP command

All fine from my side.

B1G1 commented 6 years ago

yes it's very strange, since i sent shutterposition 5 immediately after sonoff restart i think something else opened the shutter... that backlog i have at the beginning of the log for example is strange.

Ok so it seems there is a pulse from the switch that fully opened the shutter after i stop it at 50%... other thing very strange....

stefanbode commented 6 years ago

I have added a new calibration command: SHUTTERSETCLOSE. Please execute this, if the shutter is completely closed. This will ensure all variables have the right init values.

stefanbode commented 6 years ago

any MQTT messages that are saved persistently can be deleted just by sending it again WITHOUT payload, but with the persistent flag. I use MQTTSPY for my MQTT hardcore changes.

B1G1 commented 6 years ago

error for shuttersetclose

13:32:30 CMD: shuttersetclose
13:32:30 SRC: WebConsole from 192.168.1.23
13:32:30 RSL: Group 0, Index 1, Command SHUTTERSETCLOSE, Data 
13:32:30 Shutter: Command Code: 'SHUTTERSETCLOSE', Payload: -99
13:32:30 MQT: stat/tapparellaStudio/RESULT = {"Command":"Error"}