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

Created on 10 Aug 2020  路  11Comments  路  Source: StyraHem/ShellyForHASS

Environment

  • ShellyForHASS release with the issue: 0.1.9
  • Last working ShellyForHASS release (if known): unknown
  • Home Assistant Core release with the issue: 0.113.3
  • Operating environment (Home Assistant/Supervised/Docker/venv): Home Assistant Supervised (RPi 2 B)

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

Most helpful comment

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

All 11 comments

Hi,

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

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

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

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.

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

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.

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.

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:

  • shelly FW 1.8.x introduced new CoAP protocol specification/implementation, which current version (1.9.0) of this plugin not yet support. If Your HA integration is CoAP based (which usually is if You have them in the same network), then You will see strange states on shellys. This is because the current code fails to parse new CoAP messages. You can observe that by viewing the log (preferably in debug mode, but even if not, You may see something like:
2020-08-22 12:13:01 ERROR (CoAP) [pyShelly] Error receive CoAP
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyShelly/coap.py", line 182, in _loop
    self._root.update_block(device_id, device_type,
  File "/usr/local/lib/python3.8/site-packages/pyShelly/__init__.py", line 242, in update_block
    block.update(data, ipaddr)
  File "/usr/local/lib/python3.8/site-packages/pyShelly/block.py", line 92, in update
    dev.update(data)
  File "/usr/local/lib/python3.8/site-packages/pyShelly/relay.py", line 50, in update
    self.info_values[INFO_VALUE_CURRENT_CONSUMPTION] = round(consumption)
TypeError: type NoneType doesn't define __round__ method

this is being discussed in #366 and it's duplicates

  • this bug report reports problems with shellys with FW version 1.7.0 (which are fully supported with current version of this plugin) and configured as an edge swich. This is not a problem with CoAP parsing, it's a bug somewhere in plugin logic

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

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

Simone

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".

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 ...) :

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"?

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.

Was this page helpful?
0 / 5 - 0 ratings