StyraHem / ShellyForHASS

Shelly smart home platform for Home Assistant
MIT License
623 stars 112 forks source link

[BUG] Shelly 2.5: binary_sensor.switch changes state rapidly without physically clicking the button #372

Open nalajcie opened 4 years ago

nalajcie commented 4 years ago

Environment

Describe the bug

Device: Shelly 2.5 with FW 1.7.0 -> button type configured as "Edge Switch" (changes state on every hit)

binary_sensor for switch changes state to ON/OFF rapidly without hitting the switch.

Steps to Reproduce

  1. Setup shelly as "Edge Switch"
  2. Observe history log

Expected behavior

binary_sensor.shelly_shsw_25_98f4abf2ef44_2_switch should only change the state when physically hitting the button

Screenshots

image

Traceback/Error logs

Sample CoAP messages received

2020-08-10 13:59:44 DEBUG (CoAP) [pyShelly] CoAP msg: 192.168.1.242 b'PE\x00\n\xed\x0b\xf7\tSHSW-25#98F4ABF2EF44#1\xff{"blk":[{"I":0,"D":"Relay0"},{"I":1,"D":"Relay1"},{"I":2,"D":"Device"}],"sen":[{"I":112,"T":"S","D":"State","R":"0/1","L":0},{"I":122,"T":"S","D":"State","R":"0/1","L":1},{"I":111,"T":"P","D":"Power","R":"0/2300","L":0},{"I":121,"T":"P","D":"Power","R":"0/2300","L":1},{"I":118,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":0},{"I":128,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":1},{"I":115,"T":"T","D":"Temperature C","R":"-40/300","L":2},{"I":116,"T":"T","D":"Temperature F","R":"-40/300","L":2},{"I":117,"T":"S","D":"Overtemp","R":"0/1","L":2},{"I":211,"T":"S","D":"Energy counter 0 [W-min]","L":0},{"I":212,"T":"S","D":"Energy counter 1 [W-min]","L":0},{"I":213,"T":"S","D":"Energy counter 2 [W-min]","L":0},{"I":214,"T":"S","D":"Energy counter total [W-min]","L":0},{"I":221,"T":"S","D":"Energy counter 0 [W-min]","L":1},{"I":222,"T":"S","D":"Energy counter 1 [W-min]","L":1},{"I":223,"T":"S","D":"Energy counter 2 [W-min]","L":1},{"I":224,"T":"S","D":"Energy counter'
2020-08-10 13:59:44 DEBUG (CoAP) [pyShelly] CoAP msg: 69 192.168.1.242 bytearray(b'PE\x00\n\xed\x0b\xf7\tSHSW-25#98F4ABF2EF44#1\xff{"blk":[{"I":0,"D":"Relay0"},{"I":1,"D":"Relay1"},{"I":2,"D":"Device"}],"sen":[{"I":112,"T":"S","D":"State","R":"0/1","L":0},{"I":122,"T":"S","D":"State","R":"0/1","L":1},{"I":111,"T":"P","D":"Power","R":"0/2300","L":0},{"I":121,"T":"P","D":"Power","R":"0/2300","L":1},{"I":118,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":0},{"I":128,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":1},{"I":115,"T":"T","D":"Temperature C","R":"-40/300","L":2},{"I":116,"T":"T","D":"Temperature F","R":"-40/300","L":2},{"I":117,"T":"S","D":"Overtemp","R":"0/1","L":2},{"I":211,"T":"S","D":"Energy counter 0 [W-min]","L":0},{"I":212,"T":"S","D":"Energy counter 1 [W-min]","L":0},{"I":213,"T":"S","D":"Energy counter 2 [W-min]","L":0},{"I":214,"T":"S","D":"Energy counter total [W-min]","L":0},{"I":221,"T":"S","D":"Energy counter 0 [W-min]","L":1},{"I":222,"T":"S","D":"Energy counter 1 [W-min]","L":1},{"I":223,"T":"S","D":"Energy counter 2 [W-min]","L":1},{"I":224,"T":"S","D":"Energy counter')
2020-08-10 13:59:44 DEBUG (CoAP) [pyShelly] CoAP Code: 69, Type SHSW-25, Id 98F4ABF2EF44, Payload *{"blk":[{"I":0,"D":"Relay0"},{"I":1,"D":"Relay1"},{"I":2,"D":"Device"}],"sen":[{"I":112,"T":"S","D":"State","R":"0/1","L":0},{"I":122,"T":"S","D":"State","R":"0/1","L":1},{"I":111,"T":"P","D":"Power","R":"0/2300","L":0},{"I":121,"T":"P","D":"Power","R":"0/2300","L":1},{"I":118,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":0},{"I":128,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":1},{"I":115,"T":"T","D":"TemperatureC","R":"-40/300","L":2},{"I":116,"T":"T","D":"TemperatureF","R":"-40/300","L":2},{"I":117,"T":"S","D":"Overtemp","R":"0/1","L":2},{"I":211,"T":"S","D":"Energycounter0[W-min]","L":0},{"I":212,"T":"S","D":"Energycounter1[W-min]","L":0},{"I":213,"T":"S","D":"Energycounter2[W-min]","L":0},{"I":214,"T":"S","D":"Energycountertotal[W-min]","L":0},{"I":221,"T":"S","D":"Energycounter0[W-min]","L":1},{"I":222,"T":"S","D":"Energycounter1[W-min]","L":1},{"I":223,"T":"S","D":"Energycounter2[W-min]","L":1},{"I":224,"T":"S","D":"Energycounter*
2020-08-10 13:59:44 DEBUG (Thread-414) [pyShelly] http://192.168.1.117/status - Ok
2020-08-10 13:59:44 DEBUG (Thread-414) [pyShelly] Update id:C4D52A-1 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 0}
2020-08-10 13:59:44 DEBUG (Thread-414) [pyShelly] Update id:C4D52A-2 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': True, 'over_power': False, 'total_consumption': 0}
2020-08-10 13:59:44 DEBUG (Thread-414) [pyShelly] Update id:C4D52A-1 state:0.0 stateValue:None values:None info_values:{'total_consumption': 0}
2020-08-10 13:59:44 DEBUG (Thread-414) [pyShelly] Update id:C4D52A-2 state:0.0 stateValue:None values:None info_values:{'total_consumption': 0}
2020-08-10 13:59:44 DEBUG (Thread-414) [pyShelly] Update id:C4D52A-1 state:False stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 13:59:44 DEBUG (Thread-414) [pyShelly] Update id:C4D52A-2 state:True stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 13:59:44 DEBUG (CoAP) [pyShelly] CoAP msg: 192.168.1.117 b'P\x1es\xb5\xb3cit\x01s\xed\x0b\xec\x03SHSW-25#C4D52A#1\xd2C\x96\x00\x82\x1a\x06\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,62.54],[0,116,144.58],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,0]]}'
2020-08-10 13:59:44 DEBUG (CoAP) [pyShelly] CoAP msg: 30 192.168.1.117 bytearray(b'P\x1es\xb5\xb3cit\x01s\xed\x0b\xec\x03SHSW-25#C4D52A#1\xd2C\x96\x00\x82\x1a\x06\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,62.54],[0,116,144.58],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,0]]}')
2020-08-10 13:59:44 DEBUG (CoAP) [pyShelly] CoAP Code: 30, Type SHSW-25, Id C4D52A, Payload *{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,62.54],[0,116,144.58],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,0]]}*
2020-08-10 13:59:44 DEBUG (CoAP) [pyShelly] Update id:C4D52A-1 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 0}
2020-08-10 13:59:44 DEBUG (CoAP) [pyShelly] Update id:C4D52A-2 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 0}
2020-08-10 13:59:44 DEBUG (CoAP) [pyShelly] Update id:C4D52A-1 state:0.0 stateValue:None values:None info_values:{'total_consumption': 0}
2020-08-10 13:59:44 DEBUG (CoAP) [pyShelly] Update id:C4D52A-2 state:0.0 stateValue:None values:None info_values:{'total_consumption': 0}
2020-08-10 13:59:44 DEBUG (CoAP) [pyShelly] Update id:C4D52A-1 state:False stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 13:59:44 DEBUG (CoAP) [pyShelly] Update id:C4D52A-2 state:False stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 13:59:45 DEBUG (Cloud) [pyShelly] Update from cloud
2020-08-10 13:59:45 DEBUG (Cloud) [pyShelly] POST to Shelly Cloud
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] CoAP msg: 192.168.1.240 b'P\x1e\r\'\xb3cit\x01s\xed\x0b\xec\tSHSW-25#98F4ABF2E4E0#1\xd2C\x96\x00\x82c\x16\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,58.91],[0,116,138.03],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,1191]]}'
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] CoAP msg: 30 192.168.1.240 bytearray(b'P\x1e\r\'\xb3cit\x01s\xed\x0b\xec\tSHSW-25#98F4ABF2E4E0#1\xd2C\x96\x00\x82c\x16\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,58.91],[0,116,138.03],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,1191]]}')
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] CoAP Code: 30, Type SHSW-25, Id 98F4ABF2E4E0, Payload *{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,58.91],[0,116,138.03],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,1191]]}*
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4E0-1 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 0}
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4E0-2 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 20}
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4E0-1 state:0.0 stateValue:None values:None info_values:{'total_consumption': 0}
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4E0-2 state:0.0 stateValue:None values:None info_values:{'total_consumption': 20}
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4E0-1 state:False stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4E0-2 state:False stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] CoAP msg: 192.168.1.240 b'PE\x00\n\xed\x0b\xf7\tSHSW-25#98F4ABF2E4E0#1\xff{"blk":[{"I":0,"D":"Relay0"},{"I":1,"D":"Relay1"},{"I":2,"D":"Device"}],"sen":[{"I":112,"T":"S","D":"State","R":"0/1","L":0},{"I":122,"T":"S","D":"State","R":"0/1","L":1},{"I":111,"T":"P","D":"Power","R":"0/2300","L":0},{"I":121,"T":"P","D":"Power","R":"0/2300","L":1},{"I":118,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":0},{"I":128,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":1},{"I":115,"T":"T","D":"Temperature C","R":"-40/300","L":2},{"I":116,"T":"T","D":"Temperature F","R":"-40/300","L":2},{"I":117,"T":"S","D":"Overtemp","R":"0/1","L":2},{"I":211,"T":"S","D":"Energy counter 0 [W-min]","L":0},{"I":212,"T":"S","D":"Energy counter 1 [W-min]","L":0},{"I":213,"T":"S","D":"Energy counter 2 [W-min]","L":0},{"I":214,"T":"S","D":"Energy counter total [W-min]","L":0},{"I":221,"T":"S","D":"Energy counter 0 [W-min]","L":1},{"I":222,"T":"S","D":"Energy counter 1 [W-min]","L":1},{"I":223,"T":"S","D":"Energy counter 2 [W-min]","L":1},{"I":224,"T":"S","D":"Energy counter'
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] CoAP msg: 69 192.168.1.240 bytearray(b'PE\x00\n\xed\x0b\xf7\tSHSW-25#98F4ABF2E4E0#1\xff{"blk":[{"I":0,"D":"Relay0"},{"I":1,"D":"Relay1"},{"I":2,"D":"Device"}],"sen":[{"I":112,"T":"S","D":"State","R":"0/1","L":0},{"I":122,"T":"S","D":"State","R":"0/1","L":1},{"I":111,"T":"P","D":"Power","R":"0/2300","L":0},{"I":121,"T":"P","D":"Power","R":"0/2300","L":1},{"I":118,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":0},{"I":128,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":1},{"I":115,"T":"T","D":"Temperature C","R":"-40/300","L":2},{"I":116,"T":"T","D":"Temperature F","R":"-40/300","L":2},{"I":117,"T":"S","D":"Overtemp","R":"0/1","L":2},{"I":211,"T":"S","D":"Energy counter 0 [W-min]","L":0},{"I":212,"T":"S","D":"Energy counter 1 [W-min]","L":0},{"I":213,"T":"S","D":"Energy counter 2 [W-min]","L":0},{"I":214,"T":"S","D":"Energy counter total [W-min]","L":0},{"I":221,"T":"S","D":"Energy counter 0 [W-min]","L":1},{"I":222,"T":"S","D":"Energy counter 1 [W-min]","L":1},{"I":223,"T":"S","D":"Energy counter 2 [W-min]","L":1},{"I":224,"T":"S","D":"Energy counter')
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] CoAP Code: 69, Type SHSW-25, Id 98F4ABF2E4E0, Payload *{"blk":[{"I":0,"D":"Relay0"},{"I":1,"D":"Relay1"},{"I":2,"D":"Device"}],"sen":[{"I":112,"T":"S","D":"State","R":"0/1","L":0},{"I":122,"T":"S","D":"State","R":"0/1","L":1},{"I":111,"T":"P","D":"Power","R":"0/2300","L":0},{"I":121,"T":"P","D":"Power","R":"0/2300","L":1},{"I":118,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":0},{"I":128,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":1},{"I":115,"T":"T","D":"TemperatureC","R":"-40/300","L":2},{"I":116,"T":"T","D":"TemperatureF","R":"-40/300","L":2},{"I":117,"T":"S","D":"Overtemp","R":"0/1","L":2},{"I":211,"T":"S","D":"Energycounter0[W-min]","L":0},{"I":212,"T":"S","D":"Energycounter1[W-min]","L":0},{"I":213,"T":"S","D":"Energycounter2[W-min]","L":0},{"I":214,"T":"S","D":"Energycountertotal[W-min]","L":0},{"I":221,"T":"S","D":"Energycounter0[W-min]","L":1},{"I":222,"T":"S","D":"Energycounter1[W-min]","L":1},{"I":223,"T":"S","D":"Energycounter2[W-min]","L":1},{"I":224,"T":"S","D":"Energycounter*
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] CoAP msg: 192.168.1.241 b'PE\x00\n\xed\x0b\xf7\tSHSW-25#98F4ABF2E4B5#1\xff{"blk":[{"I":0,"D":"Relay0"},{"I":1,"D":"Relay1"},{"I":2,"D":"Device"}],"sen":[{"I":112,"T":"S","D":"State","R":"0/1","L":0},{"I":122,"T":"S","D":"State","R":"0/1","L":1},{"I":111,"T":"P","D":"Power","R":"0/2300","L":0},{"I":121,"T":"P","D":"Power","R":"0/2300","L":1},{"I":118,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":0},{"I":128,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":1},{"I":115,"T":"T","D":"Temperature C","R":"-40/300","L":2},{"I":116,"T":"T","D":"Temperature F","R":"-40/300","L":2},{"I":117,"T":"S","D":"Overtemp","R":"0/1","L":2},{"I":211,"T":"S","D":"Energy counter 0 [W-min]","L":0},{"I":212,"T":"S","D":"Energy counter 1 [W-min]","L":0},{"I":213,"T":"S","D":"Energy counter 2 [W-min]","L":0},{"I":214,"T":"S","D":"Energy counter total [W-min]","L":0},{"I":221,"T":"S","D":"Energy counter 0 [W-min]","L":1},{"I":222,"T":"S","D":"Energy counter 1 [W-min]","L":1},{"I":223,"T":"S","D":"Energy counter 2 [W-min]","L":1},{"I":224,"T":"S","D":"Energy counter'
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] CoAP msg: 69 192.168.1.241 bytearray(b'PE\x00\n\xed\x0b\xf7\tSHSW-25#98F4ABF2E4B5#1\xff{"blk":[{"I":0,"D":"Relay0"},{"I":1,"D":"Relay1"},{"I":2,"D":"Device"}],"sen":[{"I":112,"T":"S","D":"State","R":"0/1","L":0},{"I":122,"T":"S","D":"State","R":"0/1","L":1},{"I":111,"T":"P","D":"Power","R":"0/2300","L":0},{"I":121,"T":"P","D":"Power","R":"0/2300","L":1},{"I":118,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":0},{"I":128,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":1},{"I":115,"T":"T","D":"Temperature C","R":"-40/300","L":2},{"I":116,"T":"T","D":"Temperature F","R":"-40/300","L":2},{"I":117,"T":"S","D":"Overtemp","R":"0/1","L":2},{"I":211,"T":"S","D":"Energy counter 0 [W-min]","L":0},{"I":212,"T":"S","D":"Energy counter 1 [W-min]","L":0},{"I":213,"T":"S","D":"Energy counter 2 [W-min]","L":0},{"I":214,"T":"S","D":"Energy counter total [W-min]","L":0},{"I":221,"T":"S","D":"Energy counter 0 [W-min]","L":1},{"I":222,"T":"S","D":"Energy counter 1 [W-min]","L":1},{"I":223,"T":"S","D":"Energy counter 2 [W-min]","L":1},{"I":224,"T":"S","D":"Energy counter')
2020-08-10 13:59:47 DEBUG (CoAP) [pyShelly] CoAP Code: 69, Type SHSW-25, Id 98F4ABF2E4B5, Payload *{"blk":[{"I":0,"D":"Relay0"},{"I":1,"D":"Relay1"},{"I":2,"D":"Device"}],"sen":[{"I":112,"T":"S","D":"State","R":"0/1","L":0},{"I":122,"T":"S","D":"State","R":"0/1","L":1},{"I":111,"T":"P","D":"Power","R":"0/2300","L":0},{"I":121,"T":"P","D":"Power","R":"0/2300","L":1},{"I":118,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":0},{"I":128,"T":"S","D":"Input","R":"0(off)/1(on)/2(longpush)","L":1},{"I":115,"T":"T","D":"TemperatureC","R":"-40/300","L":2},{"I":116,"T":"T","D":"TemperatureF","R":"-40/300","L":2},{"I":117,"T":"S","D":"Overtemp","R":"0/1","L":2},{"I":211,"T":"S","D":"Energycounter0[W-min]","L":0},{"I":212,"T":"S","D":"Energycounter1[W-min]","L":0},{"I":213,"T":"S","D":"Energycounter2[W-min]","L":0},{"I":214,"T":"S","D":"Energycountertotal[W-min]","L":0},{"I":221,"T":"S","D":"Energycounter0[W-min]","L":1},{"I":222,"T":"S","D":"Energycounter1[W-min]","L":1},{"I":223,"T":"S","D":"Energycounter2[W-min]","L":1},{"I":224,"T":"S","D":"Energycounter*
2020-08-10 13:59:47 DEBUG (Cloud) [pyShelly] POST to Shelly Cloud
2020-08-10 13:59:49 DEBUG (CoAP) [pyShelly] CoAP msg: 192.168.1.241 b'P\x1em#\xb3cit\x01s\xed\x0b\xec\tSHSW-25#98F4ABF2E4B5#1\xd2C\x96\x00\x82\xb4Z\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,65.75],[0,116,150.35],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,5801],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,0]]}'
2020-08-10 13:59:49 DEBUG (CoAP) [pyShelly] CoAP msg: 30 192.168.1.241 bytearray(b'P\x1em#\xb3cit\x01s\xed\x0b\xec\tSHSW-25#98F4ABF2E4B5#1\xd2C\x96\x00\x82\xb4Z\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,65.75],[0,116,150.35],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,5801],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,0]]}')
2020-08-10 13:59:49 DEBUG (CoAP) [pyShelly] CoAP Code: 30, Type SHSW-25, Id 98F4ABF2E4B5, Payload *{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,65.75],[0,116,150.35],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,5801],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,0]]}*
2020-08-10 13:59:49 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4B5-1 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 97}
2020-08-10 13:59:49 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4B5-2 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 0}
2020-08-10 13:59:49 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4B5-1 state:0.0 stateValue:None values:None info_values:{'total_consumption': 97}
2020-08-10 13:59:49 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4B5-2 state:0.0 stateValue:None values:None info_values:{'total_consumption': 0}
2020-08-10 13:59:49 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4B5-1 state:False stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 13:59:49 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4B5-2 state:False stateValue:{'last_event': 'L', 'event_cnt': 1} values:None info_values:None
2020-08-10 13:59:54 DEBUG (CoAP) [pyShelly] CoAP msg: 192.168.1.242 b'P\x1e\xb4\xfe\xb3cit\x01s\xed\x0b\xec\tSHSW-25#98F4ABF2EF44#1\xd2C\x96\x00\x82\xa9\x00\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,61.89],[0,116,143.40],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,0]]}'
2020-08-10 13:59:54 DEBUG (CoAP) [pyShelly] CoAP msg: 30 192.168.1.242 bytearray(b'P\x1e\xb4\xfe\xb3cit\x01s\xed\x0b\xec\tSHSW-25#98F4ABF2EF44#1\xd2C\x96\x00\x82\xa9\x00\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,61.89],[0,116,143.40],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,0]]}')
2020-08-10 13:59:54 DEBUG (CoAP) [pyShelly] CoAP Code: 30, Type SHSW-25, Id 98F4ABF2EF44, Payload *{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,61.89],[0,116,143.40],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,0]]}*
2020-08-10 13:59:54 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2EF44-1 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 0}
2020-08-10 13:59:54 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2EF44-2 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 0}
2020-08-10 13:59:54 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2EF44-1 state:0.0 stateValue:None values:None info_values:{'total_consumption': 0}
2020-08-10 13:59:54 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2EF44-2 state:0.0 stateValue:None values:None info_values:{'total_consumption': 0}
2020-08-10 13:59:54 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2EF44-1 state:False stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 13:59:54 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2EF44-2 state:False stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 13:59:58 DEBUG (CoAP) [pyShelly] CoAP msg: 192.168.1.243 b'P\x1eD&\xb3cit\x01s\xed\x0b\xec\x03SHSW-25#10E84F#1\xd2C\x96\x00\x82s\xb2\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,1],[0,128,1],[0,115,58.55],[0,116,137.40],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,10574],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,10909]]}'
2020-08-10 13:59:58 DEBUG (CoAP) [pyShelly] CoAP msg: 30 192.168.1.243 bytearray(b'P\x1eD&\xb3cit\x01s\xed\x0b\xec\x03SHSW-25#10E84F#1\xd2C\x96\x00\x82s\xb2\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,1],[0,128,1],[0,115,58.55],[0,116,137.40],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,10574],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,10909]]}')
2020-08-10 13:59:58 DEBUG (CoAP) [pyShelly] CoAP Code: 30, Type SHSW-25, Id 10E84F, Payload *{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,1],[0,128,1],[0,115,58.55],[0,116,137.40],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,10574],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,10909]]}*
2020-08-10 13:59:58 DEBUG (CoAP) [pyShelly] Update id:10E84F-1 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': True, 'over_power': False, 'total_consumption': 176}
2020-08-10 13:59:58 DEBUG (CoAP) [pyShelly] Update id:10E84F-2 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': True, 'over_power': False, 'total_consumption': 182}
2020-08-10 13:59:58 DEBUG (CoAP) [pyShelly] Update id:10E84F-1 state:0.0 stateValue:None values:None info_values:{'total_consumption': 176}
2020-08-10 13:59:58 DEBUG (CoAP) [pyShelly] Update id:10E84F-2 state:0.0 stateValue:None values:None info_values:{'total_consumption': 182}
2020-08-10 13:59:58 DEBUG (CoAP) [pyShelly] Update id:10E84F-1 state:True stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 13:59:58 DEBUG (CoAP) [pyShelly] Update id:10E84F-2 state:True stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 13:59:59 DEBUG (CoAP) [pyShelly] CoAP msg: 192.168.1.117 b'P\x1es\xb6\xb3cit\x01s\xed\x0b\xec\x03SHSW-25#C4D52A#1\xd2C\x96\x00\x82\x1a\x06\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,62.54],[0,116,144.58],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,0]]}'
2020-08-10 13:59:59 DEBUG (CoAP) [pyShelly] CoAP msg: 30 192.168.1.117 bytearray(b'P\x1es\xb6\xb3cit\x01s\xed\x0b\xec\x03SHSW-25#C4D52A#1\xd2C\x96\x00\x82\x1a\x06\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,62.54],[0,116,144.58],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,0]]}')
2020-08-10 13:59:59 DEBUG (CoAP) [pyShelly] CoAP Code: 30, Type SHSW-25, Id C4D52A, Payload *{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,62.54],[0,116,144.58],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,0]]}*
2020-08-10 13:59:59 DEBUG (CoAP) [pyShelly] Update id:C4D52A-1 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 0}
2020-08-10 13:59:59 DEBUG (CoAP) [pyShelly] Update id:C4D52A-2 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 0}
2020-08-10 13:59:59 DEBUG (CoAP) [pyShelly] Update id:C4D52A-1 state:0.0 stateValue:None values:None info_values:{'total_consumption': 0}
2020-08-10 13:59:59 DEBUG (CoAP) [pyShelly] Update id:C4D52A-2 state:0.0 stateValue:None values:None info_values:{'total_consumption': 0}
2020-08-10 13:59:59 DEBUG (CoAP) [pyShelly] Update id:C4D52A-1 state:False stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 13:59:59 DEBUG (CoAP) [pyShelly] Update id:C4D52A-2 state:False stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 14:00:02 DEBUG (CoAP) [pyShelly] CoAP msg: 192.168.1.240 b'P\x1e\r(\xb3cit\x01s\xed\x0b\xec\tSHSW-25#98F4ABF2E4E0#1\xd2C\x96\x00\x82c\x16\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,58.91],[0,116,138.03],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,1191]]}'
2020-08-10 14:00:02 DEBUG (CoAP) [pyShelly] CoAP msg: 30 192.168.1.240 bytearray(b'P\x1e\r(\xb3cit\x01s\xed\x0b\xec\tSHSW-25#98F4ABF2E4E0#1\xd2C\x96\x00\x82c\x16\xff{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,58.91],[0,116,138.03],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,1191]]}')
2020-08-10 14:00:02 DEBUG (CoAP) [pyShelly] CoAP Code: 30, Type SHSW-25, Id 98F4ABF2E4E0, Payload *{"G":[[0,112,0],[0,122,0],[0,111,0.000000],[0,121,0.000000],[0,118,0],[0,128,0],[0,115,58.91],[0,116,138.03],[0,117,0],[0,211,0.000],[0,212,0.000],[0,213,0.000],[0,214,0],[0,221,0.000],[0,222,0.000],[0,223,0.000],[0,224,1191]]}*
2020-08-10 14:00:02 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4E0-1 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 0}
2020-08-10 14:00:02 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4E0-2 state:False stateValue:None values:None info_values:{'current_consumption': 0, 'switch': False, 'over_power': False, 'total_consumption': 20}
2020-08-10 14:00:02 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4E0-1 state:0.0 stateValue:None values:None info_values:{'total_consumption': 0}
2020-08-10 14:00:02 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4E0-2 state:0.0 stateValue:None values:None info_values:{'total_consumption': 20}
2020-08-10 14:00:02 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4E0-1 state:False stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None
2020-08-10 14:00:02 DEBUG (CoAP) [pyShelly] Update id:98F4ABF2E4E0-2 state:False stateValue:{'last_event': '', 'event_cnt': 0} values:None info_values:None

I can provide more logs if needed.

Additional context

juanpa669 commented 4 years ago

Hi,

I had the same problem with my shellies 2.5 in roller mode and button type momentary.

drOnygames commented 4 years ago

Hi, had the same issue with the shelly rgbw2 controller it turns on and I can still change the brightness, but not change the color because it shows it's offline, it still works over shelly cloud app. In hass it looks like this (I reseted the device where it changed to unavaiable). Screenshot_2

IsaacBreuer commented 4 years ago

have the same issue with all my Shelly dimmers, after hassio update the switch reverts back to off in homeasssitnt but the actual lightis still on.

my 2 shelly 1s does not have this issue

galaxxy22 commented 4 years ago

I have the same issue with my Shelly Dimmer 2 on HassIO v114.3. Don't have any problems with the Shelly 1's I have.

IsaacBreuer commented 4 years ago

hi all, this is due to the shelly firmware 18 , i just downgraded and its working fine

yo have to singe up to shelly supports to get the old firmware here it is for the dimmer

http://archive.shelly-support.eu/v1.7.7/SHDM-1_build.zip

you can execute in a browser to do a OTA upgrade http:///ota?url=http://archive.shelly-support.eu/v1.7.7/SHDM-1_build.zip

don't use this for another device then a dimmer , if you have a different device get your proper zip file

go here https://www.shelly-support.eu/index.php?shelly-firmware-archive/

there is also a shelly toll you can upgrade/downgrade firmware easy

nalajcie commented 4 years ago

hi all, this is due to the shelly firmware 18 , i just downgraded and its working fine

My original issue occurs on Shelly 2.5 with FW 1.7.0, so it's not a problem with new CoAP implementation.

pa-sleo commented 4 years ago

IsaacBreuer is right. The issue comes with the latest firmware. And it is not only with shelly 2.5 also with shelly 1 and shelly bulbs.

nalajcie commented 4 years ago

IsaacBreuer is right. The issue comes with the latest firmware. And it is not only with shelly 2.5 also with shelly 1 and shelly bulbs.

No, he's not. You're mixing 2 things:

Please - do not post problems with shelly FW 1.8.x in this bug report, use #366 for that

chemelli74 commented 4 years ago

Thx @nalajcie I moved the post as "off-topic" to avoid confusion on this issue.

Simone

rwunsch commented 4 years ago

I am facing the same issue - after upgrading to "Shelly For HASS - version 0.2.0" (and upgrading my Shellys to FW1.8.3). This is however only on ONE of 23 Shelly devices - one 1PM. I keeps changing the the "physical switch-state" (binary_sensor.switch / event: "shelly_switch_click") on every "poll" (checked in the logs - and compared to DeveloperTools-Events and NodeRed).

I have however other "1PM"-devices which do not constantly change the "physical switch-state" (binary_sensor.switch / event: "shelly_switch_click").

I rebooted this shelly, took it off power, deleted the full integration in HASS (and reconfigured it) - the issue remains. I have NO idea why the switch-state is triggered on "polling". There is a physical switch connected to the SW port of the Shelly-1PM, but this physical-switch is not being touched (nor can I measure and amperage or voltage change on the SW port).

Also, no signal for an SW state change is coming from CoAP. The state change is ONLY triggered though Polling (and I cannot see why ...) .

image

The Timing seems to happen in sync with the polling:

image

I tried to capture this in this animated GIF (it happens every 60 sec - due to the polling interval ...) - unfortunately the animation was removed by GITHUB - so only an image) :

20200911_ShellyForHass_Switch-Click_on-poll_Git-issue-372

Can "polling" be turned-off" in any way? (As CoAP is just working fine ....) What would I "loose" by "disabling polling"?

hakana commented 4 years ago

Look like it is the switch (not the relay) that turns on/off. Do you have a physical switch connected to the device?

You can't turn off the polling because that is needed for lots of extra information.

warbringer commented 2 years ago

I have the same issue with one of my three Shelly 1PM's. The other two work fine but one of them (connected to a physical switch) flips the binary_sensor between on and off every minute. What happens if I simply tell Home Assistant to stop logging this event?

rwunsch commented 2 years ago

I have not tested it - but it might be some "stray" interference. Adding a 470kOhm (1/4W, 1% tolerance) resistor between the physical-switch and the SW-port of the Shelly might help to resolve this issue (in a shrinking tube, soldered ) - and could be tested.