arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.19k stars 4.81k forks source link

3 shutters detected on a Sonoff 4chpro configured for 2. Using HA and new Tasmota integration. #11712

Closed JackTalisker closed 3 years ago

JackTalisker commented 3 years ago

PROBLEM DESCRIPTION

3 shutters detected on a Sonoff 4chpro configured for 2. Using HA and new Tasmota integration. Seems that Tasmota discovery topic sends null values after Shutter1 and Shutter2. After that a useless "Shutter3" appears.

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [ ] If using rules, provide the output of this command: `Backlog Rule1; Rule2; Rule3`:
```lua
  Rules output here:
- [x] Set `weblog` to 4 and then, when you experience your issue, provide the output of the Console log:
```lua
17:38:54.044 CMD: weblog 4
17:38:54.051 MQT: stat/4CHpro_serr/RESULT = {"WebLog":4}
17:38:54.905 CFG: Saved to flash at F9, Count 1433, Bytes 4096
17:38:59.040 WIF: Checking connection...
17:39:15.737 CMD: setoption19 0
17:39:15.739 SRC: WebConsole from 192.168.0.173
17:39:15.742 CMD: Group 0, Index 19, Command "SETOPTION", Data "0"
17:39:15.748 MQT: stat/4CHpro_serr/RESULT = {"SetOption19":"OFF"}
17:39:16.604 MQT: homeassistant/binary_sensor/ACE5F9_SW_3/config =  (retained)
17:39:16.607 MQT: homeassistant/device_automation/ACE5F9_SW_4_TOGGLE/config =  (retained)
17:39:16.610 MQT: homeassistant/device_automation/ACE5F9_SW_4_HOLD/config =  (retained)
17:39:16.613 MQT: homeassistant/binary_sensor/ACE5F9_SW_4/config =  (retained)
17:39:16.617 MQT: homeassistant/device_automation/ACE5F9_SW_5_TOGGLE/config =  (retained)
17:39:16.621 MQT: homeassistant/device_automation/ACE5F9_SW_5_HOLD/config =  (retained)
17:39:16.624 MQT: homeassistant/binary_sensor/ACE5F9_SW_5/config =  (retained)
17:39:16.629 MQT: homeassistant/device_automation/ACE5F9_SW_6_TOGGLE/config =  (retained)
17:39:16.632 MQT: homeassistant/device_automation/ACE5F9_SW_6_HOLD/config =  (retained)
17:39:16.635 MQT: homeassistant/binary_sensor/ACE5F9_SW_6/config =  (retained)
17:39:16.639 MQT: homeassistant/device_automation/ACE5F9_SW_7_TOGGLE/config =  (retained)
17:39:16.642 MQT: homeassistant/device_automation/ACE5F9_SW_7_HOLD/config =  (retained)
17:39:16.647 MQT: homeassistant/binary_sensor/ACE5F9_SW_7/config =  (retained)
17:39:16.651 MQT: homeassistant/device_automation/ACE5F9_SW_8_TOGGLE/config =  (retained)
17:39:16.655 MQT: homeassistant/device_automation/ACE5F9_SW_8_HOLD/config =  (retained)
17:39:16.660 MQT: homeassistant/binary_sensor/ACE5F9_SW_8/config =  (retained)
17:39:16.664 MQT: homeassistant/cover/ACE5F9_SHT_1/config =  (retained)
17:39:16.668 MQT: homeassistant/cover/ACE5F9_SHT_2/config =  (retained)
17:39:16.672 MQT: homeassistant/cover/ACE5F9_SHT_3/config =  (retained)
17:39:16.676 MQT: homeassistant/cover/ACE5F9_SHT_4/config =  (retained)
17:39:16.681 MQT: homeassistant/light/ACE5F9_LI_1/config =  (retained)
17:39:16.685 MQT: homeassistant/switch/ACE5F9_RL_1/config =  (retained)
17:39:16.690 MQT: homeassistant/light/ACE5F9_LI_2/config =  (retained)
17:39:16.695 MQT: homeassistant/switch/ACE5F9_RL_2/config =  (retained)
17:39:16.699 MQT: homeassistant/light/ACE5F9_LI_3/config =  (retained)
17:39:16.703 MQT: homeassistant/switch/ACE5F9_RL_3/config =  (retained)
17:39:16.707 MQT: homeassistant/light/ACE5F9_LI_4/config =  (retained)
17:39:16.710 MQT: homeassistant/switch/ACE5F9_RL_4/config =  (retained)
17:39:16.714 MQT: homeassistant/light/ACE5F9_LI_5/config =  (retained)
17:39:16.718 MQT: homeassistant/switch/ACE5F9_RL_5/config =  (retained)
17:39:16.722 MQT: homeassistant/light/ACE5F9_LI_6/config =  (retained)
17:39:16.727 MQT: homeassistant/switch/ACE5F9_RL_6/config =  (retained)
17:39:16.731 MQT: homeassistant/light/ACE5F9_LI_7/config =  (retained)
17:39:16.734 MQT: homeassistant/switch/ACE5F9_RL_7/config =  (retained)
17:39:16.737 MQT: homeassistant/light/ACE5F9_LI_8/config =  (retained)
17:39:16.740 MQT: homeassistant/switch/ACE5F9_RL_8/config =  (retained)
17:39:16.744 MQT: homeassistant/sensor/ACE5F9_status/config =  (retained)
17:39:16.746 LOG: Home Assistant MQTT Discovery disabled.
17:39:16.757 MQT: tasmota/discovery/600194ACE5F9/config = {"ip":"192.168.0.80","dn":"4CHpro_serr","fn":["SerrSala1_1","SerrSala1_2","SerrSala2_1","SerrSala2_2",null,null,null,null],"hn":"4CHpro_serr-1529","mac":"600194ACE5F9","md":"Sonoff 4CH Pro","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["OFF","ON","TOGGLE","HOLD"],"sw":"9.3.1.2","t":"4CHpro_serr","ft":"%prefix%/%topic%/","tp":["cmnd","stat","tele"],"rl":[3,3,3,3,0,0,0,0],"swc":[-1,-1,-1,-1,-1,-1,-1,-1],"swn":[null,null,null,null,null,null,null,null],"btn":[0,0,0,0,0,0,0,0],"so":{"4":0,"11":0,"13":0,"17":0,"20":0,"30":0,"68":0,"73":0,"82":0,"114":0,"117":0},"lk":1,"lt_st":0,"sho":[4,4,0,0],"ver":1} (retained)
17:39:16.767 MQT: tasmota/discovery/600194ACE5F9/sensors = {"sn":{"Time":"2021-04-13T17:39:16","Shutter1":{"Position":88,"Direction":0,"Target":88},"Shutter2":{"Position":100,"Direction":0,"Target":100}},"ver":1} (retained)
17:39:19.290 WIF: Checking connection...
17:39:39.572 WIF: Checking connection...

TO REPRODUCE

Setup the Tasmota HA integration with a Sonoff 4chpro configured for 2 shutters.

EXPECTED BEHAVIOUR

Only two shutters should be detected

SCREENSHOTS

3shutters

ADDITIONAL CONTEXT

Discovery config topic with "null" values:

{"ip":"192.168.0.80","dn":"4CHpro_serr","fn":["SerrSala1_1","SerrSala1_2","SerrSala2_1","SerrSala2_2",null,null,null,null],"hn":"4CHpro_serr-1529","mac":"600194ACE5F9","md":"Sonoff 4CH Pro","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["OFF","ON","TOGGLE","HOLD"],"sw":"9.3.1.2","t":"4CHpro_serr","ft":"%prefix%/%topic%/","tp":["cmnd","stat","tele"],"rl":[3,3,3,3,0,0,0,0],"swc":[-1,-1,-1,-1,-1,-1,-1,-1],"swn":[null,null,null,null,null,null,null,null],"btn":[0,0,0,0,0,0,0,0],"so":{"4":0,"11":0,"13":0,"17":0,"20":0,"30":0,"68":0,"73":0,"82":0,"114":0,"117":0},"lk":1,"lt_st":0,"sho":[4,4,0,0],"ver":1}

(Please, remember to close the issue when the problem has been addressed)

stefanbode commented 3 years ago

Can you give more insight WHY HA detects 3 shutters. What is the wrong value in the discovery? Are the "0" the problem? Why it does not detect 4 in this case? I assume "sho":[4,4,0,0] is the part for the shutter in HA?

ascillato2 commented 3 years ago

Hi,

When you have some time, please provide the requested information so as to properly help you. Thanks.

JackTalisker commented 3 years ago

Can you give more insight WHY HA detects 3 shutters. What is the wrong value in the discovery?

I don't know the discovery process. The only thing I suppose could be wrong is in the "fn" string: "fn":["SerrSala1_1","SerrSala1_2","SerrSala2_1","SerrSala2_2",null,null,null,null], where SerrSala1_1 is the first shutter going up (relay 1), SerrSala1_2 is the first shutter going down (relay 2), SerrSala2_1 is the second shutter going up (relay 3) and SerrSala2_2 is the second shutter going down (relay 4); after there are those values "null,null,null,null" that could be wrong. I really don't know.

Are the "0" the problem? Why it does not detect 4 in this case? I assume "sho":[4,4,0,0] is the part for the shutter in HA? Don't know.

If I could help providing other data just ask. Thank you

stefanbode commented 3 years ago

Let me do a small patch and get rid of the null,null. Have you checked how the message look like if there is only ONE shutter?

JackTalisker commented 3 years ago

I have another 4chpro configured with 2 relays for a single shutter and the other two realy for two switch (for 2 bulbs).

I gave a "weblog 4" and a "SetOption19 0" in the console and the null values are still there but this time the discovery is right, one shutter and two switches:

` 06:34:54.592 CMD: weblog 4 06:34:54.599 MQT: stat/4CHpro_corr/RESULT = {"WebLog":4} 06:34:54.926 CFG: Saved to flash at F6, Count 307, Bytes 4096 06:34:55.081 WIF: Checking connection... 06:35:08.702 CMD: setoption19 0 06:35:08.705 SRC: WebConsole from 192.168.0.20 06:35:08.708 CMD: Group 0, Index 19, Command "SETOPTION", Data "0" 06:35:08.713 MQT: stat/4CHpro_corr/RESULT = {"SetOption19":"OFF"} 06:35:09.624 MQT: homeassistant/device_automation/FB72D7_SW_3_HOLD/config = (retained) 06:35:09.628 MQT: homeassistant/binary_sensor/FB72D7_SW_3/config = (retained) 06:35:09.633 MQT: homeassistant/device_automation/FB72D7_SW_4_TOGGLE/config = (retained) 06:35:09.638 MQT: homeassistant/device_automation/FB72D7_SW_4_HOLD/config = (retained) 06:35:09.642 MQT: homeassistant/binary_sensor/FB72D7_SW_4/config = (retained) 06:35:09.647 MQT: homeassistant/device_automation/FB72D7_SW_5_TOGGLE/config = (retained) 06:35:09.651 MQT: homeassistant/device_automation/FB72D7_SW_5_HOLD/config = (retained) 06:35:09.655 MQT: homeassistant/binary_sensor/FB72D7_SW_5/config = (retained) 06:35:09.660 MQT: homeassistant/device_automation/FB72D7_SW_6_TOGGLE/config = (retained) 06:35:09.665 MQT: homeassistant/device_automation/FB72D7_SW_6_HOLD/config = (retained) 06:35:09.669 MQT: homeassistant/binary_sensor/FB72D7_SW_6/config = (retained) 06:35:09.674 MQT: homeassistant/device_automation/FB72D7_SW_7_TOGGLE/config = (retained) 06:35:09.678 MQT: homeassistant/device_automation/FB72D7_SW_7_HOLD/config = (retained) 06:35:09.683 MQT: homeassistant/binary_sensor/FB72D7_SW_7/config = (retained) 06:35:09.687 MQT: homeassistant/device_automation/FB72D7_SW_8_TOGGLE/config = (retained) 06:35:09.691 MQT: homeassistant/device_automation/FB72D7_SW_8_HOLD/config = (retained) 06:35:09.696 MQT: homeassistant/binary_sensor/FB72D7_SW_8/config = (retained) 06:35:09.701 MQT: homeassistant/cover/FB72D7_SHT_1/config = (retained) 06:35:09.705 MQT: homeassistant/cover/FB72D7_SHT_2/config = (retained) 06:35:09.709 MQT: homeassistant/cover/FB72D7_SHT_3/config = (retained) 06:35:09.713 MQT: homeassistant/cover/FB72D7_SHT_4/config = (retained) 06:35:09.718 MQT: homeassistant/light/FB72D7_LI_1/config = (retained) 06:35:09.722 MQT: homeassistant/switch/FB72D7_RL_1/config = (retained) 06:35:09.726 MQT: homeassistant/light/FB72D7_LI_2/config = (retained) 06:35:09.731 MQT: homeassistant/switch/FB72D7_RL_2/config = (retained) 06:35:09.735 MQT: homeassistant/light/FB72D7_LI_3/config = (retained) 06:35:09.739 MQT: homeassistant/switch/FB72D7_RL_3/config = (retained) 06:35:09.744 MQT: homeassistant/light/FB72D7_LI_4/config = (retained) 06:35:09.748 MQT: homeassistant/switch/FB72D7_RL_4/config = (retained) 06:35:09.752 MQT: homeassistant/light/FB72D7_LI_5/config = (retained) 06:35:09.756 MQT: homeassistant/switch/FB72D7_RL_5/config = (retained) 06:35:09.759 MQT: homeassistant/light/FB72D7_LI_6/config = (retained) 06:35:09.763 MQT: homeassistant/switch/FB72D7_RL_6/config = (retained) 06:35:09.767 MQT: homeassistant/light/FB72D7_LI_7/config = (retained) 06:35:09.771 MQT: homeassistant/switch/FB72D7_RL_7/config = (retained) 06:35:09.776 MQT: homeassistant/light/FB72D7_LI_8/config = (retained) 06:35:09.779 MQT: homeassistant/switch/FB72D7_RL_8/config = (retained) 06:35:09.784 MQT: homeassistant/sensor/FB72D7_status/config = (retained) 06:35:09.786 LOG: Home Assistant MQTT Discovery disabled. 06:35:09.797 MQT: tasmota/discovery/40F520FB72D7/config = {"ip":"192.168.0.82","dn":"4CHpro_corr","fn":["corridoio_su","corridoio_giu","corridoio_luce","corridoio_luce_cass",null,null,null,null],"hn":"4CHpro_corr-4823","mac":"40F520FB72D7","md":"Sonoff 4CH Pro","ty":0,"if":0,"ofln":"Offline","onln":"Online","state":["OFF","ON","TOGGLE","HOLD"],"sw":"9.4.0.3","t":"4CHpro_corr","ft":"%prefix%/%topic%/","tp":["cmnd","stat","tele"],"rl":[3,3,1,1,0,0,0,0],"swc":[-1,-1,-1,-1,-1,-1,-1,-1],"swn":[null,null,null,null,null,null,null,null],"btn":[0,0,0,0,0,0,0,0],"so":{"4":0,"11":0,"13":0,"17":0,"20":0,"30":0,"68":0,"73":0,"82":0,"114":0,"117":0},"lk":1,"lt_st":0,"sho":[4,0,0,0],"ver":1} (retained) 06:35:09.807 MQT: tasmota/discovery/40F520FB72D7/sensors = {"sn":{"Time":"2021-05-17T06:35:09","Shutter1":{"Position":100,"Direction":0,"Target":100}},"ver":1} (retained)

` shuuter_corr