cmroche / greeclimate

Python package for controlling Gree based minisplit systems
GNU General Public License v3.0
42 stars 21 forks source link

File descriptors not closing, limit exceeded #42

Closed gpolosa closed 2 years ago

gpolosa commented 2 years ago

Hi,

the greeclimate plugin seems not to be closing file descriptors (sockets) properly, accruing file descriptions leading to home assistant malfunctioning when reaching the limit of 1024 and dumping gigabytes into the logfile complaining about being out of ressources. When the greeclimate integration is disabled, no such issues occur and the log file remains clean.

My Gree unit is SAP12HP230V1A. Reporting from and controlling the unit works fine.

Occurs when homeassistant is ran both outside or inside a docker container.

Accruing file descriptors (every 5 minutes or so): bash-5.1# lsof -p 189 | wc -l 177 bash-5.1# lsof -p 189 | wc -l 182 bash-5.1# lsof -p 189 | wc -l 185 bash-5.1# lsof -p 189 | wc -l 190

File descriptors: bash-5.1# lsof -p 189 1 /bin/s6-svscan /dev/null 1 /bin/s6-svscan pipe:[133544621] 1 /bin/s6-svscan pipe:[133544622] 1 /bin/s6-svscan anon_inode:[signalfd] 1 /bin/s6-svscan /run/s6/services/.s6-svscan/control 1 /bin/s6-svscan /run/s6/services/.s6-svscan/control 37 /bin/s6-supervise /dev/null 37 /bin/s6-supervise pipe:[133544621] 37 /bin/s6-supervise pipe:[133544622] 37 /bin/s6-supervise anon_inode:[signalfd] 37 /bin/s6-supervise /run/s6/services/s6-fdholderd/supervise/control 37 /bin/s6-supervise /run/s6/services/s6-fdholderd/supervise/control 186 /bin/s6-supervise /dev/null 186 /bin/s6-supervise pipe:[133544621] 186 /bin/s6-supervise pipe:[133544622] 186 /bin/s6-supervise anon_inode:[signalfd] 186 /bin/s6-supervise /run/s6/services/home-assistant/supervise/control 186 /bin/s6-supervise /run/s6/services/home-assistant/supervise/control 189 /usr/local/bin/python3.9 /dev/null 189 /usr/local/bin/python3.9 pipe:[133544621] 189 /usr/local/bin/python3.9 pipe:[133544622] 189 /usr/local/bin/python3.9 /config/home-assistant.log.fault 189 /usr/local/bin/python3.9 anon_inode:[eventpoll] 189 /usr/local/bin/python3.9 socket:[133543710] 189 /usr/local/bin/python3.9 socket:[133543711] 189 /usr/local/bin/python3.9 /config/home-assistant.log 189 /usr/local/bin/python3.9 /config/home-assistant_v2.db 189 /usr/local/bin/python3.9 /config/home-assistant_v2.db-wal 189 /usr/local/bin/python3.9 /config/home-assistant_v2.db-shm 189 /usr/local/bin/python3.9 socket:[133546274] 189 /usr/local/bin/python3.9 socket:[133546275] 189 /usr/local/bin/python3.9 socket:[133546276] 189 /usr/local/bin/python3.9 socket:[133543720] 189 /usr/local/bin/python3.9 socket:[133543721] 189 /usr/local/bin/python3.9 socket:[133546278] 189 /usr/local/bin/python3.9 socket:[133546279] 189 /usr/local/bin/python3.9 socket:[133567616] 189 /usr/local/bin/python3.9 socket:[133543722] 189 /usr/local/bin/python3.9 socket:[133543779] 189 /usr/local/bin/python3.9 socket:[133543724] 189 /usr/local/bin/python3.9 socket:[133543725] 189 /usr/local/bin/python3.9 socket:[133567617] 189 /usr/local/bin/python3.9 socket:[133573414] 189 /usr/local/bin/python3.9 socket:[133543728] 189 /usr/local/bin/python3.9 socket:[133567618] 189 /usr/local/bin/python3.9 socket:[133586839] 189 /usr/local/bin/python3.9 socket:[133573415] 189 /usr/local/bin/python3.9 socket:[133567620] 189 /usr/local/bin/python3.9 socket:[133567621] 189 /usr/local/bin/python3.9 socket:[133573416] 189 /usr/local/bin/python3.9 socket:[133584033] 189 /usr/local/bin/python3.9 socket:[133573418] 189 /usr/local/bin/python3.9 socket:[133573419] 189 /usr/local/bin/python3.9 socket:[133584034] 189 /usr/local/bin/python3.9 socket:[133584035] 189 /usr/local/bin/python3.9 socket:[133543778] 189 /usr/local/bin/python3.9 socket:[133543777] 189 /usr/local/bin/python3.9 socket:[133543780] 189 /usr/local/bin/python3.9 socket:[133543781] 189 /usr/local/bin/python3.9 socket:[133579747] 189 /usr/local/bin/python3.9 socket:[133544734] 189 /usr/local/bin/python3.9 socket:[133584037] 189 /usr/local/bin/python3.9 socket:[133543773] 189 /usr/local/bin/python3.9 pipe:[133542555] 189 /usr/local/bin/python3.9 pipe:[133544736] 189 /usr/local/bin/python3.9 socket:[133543774] 189 /usr/local/bin/python3.9 pipe:[133544736] 189 /usr/local/bin/python3.9 pipe:[133542555] 189 /usr/local/bin/python3.9 socket:[133542556] 189 /usr/local/bin/python3.9 socket:[133543767] 189 /usr/local/bin/python3.9 socket:[133543768] 189 /usr/local/bin/python3.9 socket:[133543769] 189 /usr/local/bin/python3.9 socket:[133543770] 189 /usr/local/bin/python3.9 socket:[133543771] 189 /usr/local/bin/python3.9 socket:[133543772] 189 /usr/local/bin/python3.9 socket:[133543775] 189 /usr/local/bin/python3.9 socket:[133543776] 189 /usr/local/bin/python3.9 socket:[133584038] 189 /usr/local/bin/python3.9 socket:[133579748] 189 /usr/local/bin/python3.9 socket:[133579749] 189 /usr/local/bin/python3.9 socket:[133592143] 189 /usr/local/bin/python3.9 socket:[133579751] 189 /usr/local/bin/python3.9 socket:[133579752] 189 /usr/local/bin/python3.9 socket:[133592144] 189 /usr/local/bin/python3.9 socket:[133592145] 189 /usr/local/bin/python3.9 socket:[133586840] 189 /usr/local/bin/python3.9 socket:[133592147] 189 /usr/local/bin/python3.9 socket:[133592148] 189 /usr/local/bin/python3.9 socket:[133586841] 189 /usr/local/bin/python3.9 socket:[133589932] 189 /usr/local/bin/python3.9 socket:[133586843] 189 /usr/local/bin/python3.9 socket:[133586844] 189 /usr/local/bin/python3.9 socket:[133589933] 189 /usr/local/bin/python3.9 socket:[133589934] 189 /usr/local/bin/python3.9 socket:[133598545] 189 /usr/local/bin/python3.9 socket:[133589936] 189 /usr/local/bin/python3.9 socket:[133589937] 189 /usr/local/bin/python3.9 socket:[133598546] 189 /usr/local/bin/python3.9 socket:[133598547] 189 /usr/local/bin/python3.9 socket:[133634095] 189 /usr/local/bin/python3.9 socket:[133598549] 189 /usr/local/bin/python3.9 socket:[133598550] 189 /usr/local/bin/python3.9 socket:[133600693] 189 /usr/local/bin/python3.9 socket:[133600694] 189 /usr/local/bin/python3.9 socket:[133600695] 189 /usr/local/bin/python3.9 socket:[133602796] 189 /usr/local/bin/python3.9 socket:[133600697] 189 /usr/local/bin/python3.9 socket:[133600698] 189 /usr/local/bin/python3.9 socket:[133602797] 189 /usr/local/bin/python3.9 socket:[133602798] 189 /usr/local/bin/python3.9 socket:[133606745] 189 /usr/local/bin/python3.9 socket:[133602800] 189 /usr/local/bin/python3.9 socket:[133602801] 189 /usr/local/bin/python3.9 socket:[133606746] 189 /usr/local/bin/python3.9 socket:[133606747] 189 /usr/local/bin/python3.9 socket:[133609907] 189 /usr/local/bin/python3.9 socket:[133606749] 189 /usr/local/bin/python3.9 socket:[133606750] 189 /usr/local/bin/python3.9 socket:[133609908] 189 /usr/local/bin/python3.9 socket:[133609909] 189 /usr/local/bin/python3.9 socket:[133610358] 189 /usr/local/bin/python3.9 socket:[133609911] 189 /usr/local/bin/python3.9 socket:[133609912] 189 /usr/local/bin/python3.9 socket:[133610359] 189 /usr/local/bin/python3.9 socket:[133610360] 189 /usr/local/bin/python3.9 socket:[133616994] 189 /usr/local/bin/python3.9 socket:[133610362] 189 /usr/local/bin/python3.9 socket:[133610363] 189 /usr/local/bin/python3.9 socket:[133616995] 189 /usr/local/bin/python3.9 socket:[133616996] 189 /usr/local/bin/python3.9 socket:[133622791] 189 /usr/local/bin/python3.9 socket:[133616998] 189 /usr/local/bin/python3.9 socket:[133616999] 189 /usr/local/bin/python3.9 socket:[133622792] 189 /usr/local/bin/python3.9 socket:[133622793] 189 /usr/local/bin/python3.9 socket:[133634096] 189 /usr/local/bin/python3.9 socket:[133622795] 189 /usr/local/bin/python3.9 socket:[133622796] 189 /usr/local/bin/python3.9 socket:[133645353] 189 /usr/local/bin/python3.9 socket:[133621410] 189 /usr/local/bin/python3.9 socket:[133634097] 189 /usr/local/bin/python3.9 socket:[133621411] 189 /usr/local/bin/python3.9 socket:[133639441] 189 /usr/local/bin/python3.9 socket:[133621412] 189 /usr/local/bin/python3.9 socket:[133643239] 189 /usr/local/bin/python3.9 socket:[133621414] 189 /usr/local/bin/python3.9 socket:[133621415] 189 /usr/local/bin/python3.9 socket:[133625125] 189 /usr/local/bin/python3.9 socket:[133625126] 189 /usr/local/bin/python3.9 socket:[133625127] 189 /usr/local/bin/python3.9 socket:[133624209] 189 /usr/local/bin/python3.9 socket:[133625129] 189 /usr/local/bin/python3.9 socket:[133625130] 189 /usr/local/bin/python3.9 socket:[133624210] 189 /usr/local/bin/python3.9 socket:[133624211] 189 /usr/local/bin/python3.9 /config/home-assistant_v2.db 189 /usr/local/bin/python3.9 socket:[133624213] 189 /usr/local/bin/python3.9 socket:[133624214] 189 /usr/local/bin/python3.9 socket:[133634099] 189 /usr/local/bin/python3.9 socket:[133623741] 189 /usr/local/bin/python3.9 socket:[133634100] 189 /usr/local/bin/python3.9 socket:[133623742] 189 /usr/local/bin/python3.9 socket:[133623743] 189 /usr/local/bin/python3.9 socket:[133639442] 189 /usr/local/bin/python3.9 socket:[133623745] 189 /usr/local/bin/python3.9 socket:[133623746] 189 /usr/local/bin/python3.9 /config/home-assistant_v2.db 189 /usr/local/bin/python3.9 socket:[133633631] 189 /usr/local/bin/python3.9 socket:[133633632] 189 /usr/local/bin/python3.9 socket:[133633633] 189 /usr/local/bin/python3.9 socket:[133639443] 189 /usr/local/bin/python3.9 socket:[133633635] 189 /usr/local/bin/python3.9 socket:[133633636] 189 /usr/local/bin/python3.9 socket:[133645354] 189 /usr/local/bin/python3.9 socket:[133639445] 189 /usr/local/bin/python3.9 socket:[133639446] 189 /usr/local/bin/python3.9 socket:[133645355] 189 /usr/local/bin/python3.9 socket:[133643240] 189 /usr/local/bin/python3.9 socket:[133645357] 189 /usr/local/bin/python3.9 socket:[133645358] 189 /usr/local/bin/python3.9 socket:[133643241] 189 /usr/local/bin/python3.9 socket:[133643243] 189 /usr/local/bin/python3.9 socket:[133643244] 240 /bin/bash /dev/pts/0 240 /bin/bash /dev/pts/0 240 /bin/bash /dev/pts/0 240 /bin/bash /dev/pts/0

Log file (before running out of file descriptors):

2022-01-09 04:45:10 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 04:45:10 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 04:45:10 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 04:45:10 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 04:50:10 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 04:50:10 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 04:50:10 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 04:50:10 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 04:55:10 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 04:55:10 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 04:55:10 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 04:55:10 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 05:00:10 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 05:00:10 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 05:00:10 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 05:00:10 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 05:05:10 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 05:05:10 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 05:05:10 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 05:05:10 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 05:10:10 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 05:10:10 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 05:10:10 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 05:10:10 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType

Thanks you for any assistance.

cmroche commented 2 years ago

@gpolosa Thanks for the info, I’ll take a look and see if I can track this down. Out of curiosity though, how long are you able to run Home Assistant before you start running into this error?

gpolosa commented 2 years ago

Thank you. It's about a little over 1 day.

cmroche commented 2 years ago

@gpolosa Hmmm, that’s a bit surprising actually. I’ve been running a month without any problems. Are there any other errors coming up in the log? It might explain the difference.

Also, could you set “greeclimate” to debug in your log configuration. This will capture network traffic to help me isolate potential causes of the leak.

gpolosa commented 2 years ago

Yes sorry, I was actually figuring out how to do that. It seems it shows the problem:

2022-01-09 13:53:42 INFO (MainThread) [greeclimate.discovery] Scanning for Gree devices ... 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.discovery] Listening for devices on 192.168.137.221 using 192.168.137.255 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.discovery] Listening for devices on 192.168.137.222 using 192.168.137.255 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.discovery] Listening for devices on 192.168.137.242 using 192.168.137.255 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.discovery] Listening for devices on 192.168.6.1 using None 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.discovery] Listening for devices on 10.30.0.1 using 10.30.255.255 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.discovery] Listening for devices on 172.17.0.1 using 172.17.255.255 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.discovery] Listening for devices on 10.1.149.176 using None 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.network] Sending packet: {"t": "scan"} 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.network] Sending packet: {"t": "scan"} 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.network] Sending packet: {"t": "scan"} 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.network] Sending packet: {"t": "scan"} 2022-01-09 13:53:42 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.network] Sending packet: {"t": "scan"} 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.network] Sending packet: {"t": "scan"} 2022-01-09 13:53:42 DEBUG (MainThread) [greeclimate.network] Sending packet: {"t": "scan"} 2022-01-09 13:53:42 ERROR (MainThread) [homeassistant] Error doing job: Fatal write error on datagram transport Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 13:53:42 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 13:53:42 ERROR (MainThread) [greeclimate.network] Connection was closed unexpectedly Traceback (most recent call last): File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 1056, in sendto self._sock.sendto(data, addr) TypeError: str, bytes or bytearray expected, not NoneType 2022-01-09 13:53:43 DEBUG (MainThread) [greeclimate.network] Received packet from 192.168.137.11: {"t": "pack", "i": 1, "uid": 0, "cid": "502cc603d455", "tcid": "", "pack": {"t": "dev", "cid": "502cc603d455", "bc": "", "brand": "gree", "catalog": "gree", "mac": "502cc603d455", "mid": "10001", "model": "gree", "name": "c603d455", "series": "gr> 2022-01-09 13:53:43 INFO (MainThread) [greeclimate.discovery] Found gree device Device: c603d455 @ 192.168.137.11:7000 (mac: 502cc603d455) 2022-01-09 13:53:43 DEBUG (MainThread) [greeclimate.network] Received packet from 192.168.137.11: {"t": "pack", "i": 1, "uid": 0, "cid": "502cc603d455", "tcid": "", "pack": {"t": "dev", "cid": "502cc603d455", "bc": "", "brand": "gree", "catalog": "gree", "mac": "502cc603d455", "mid": "10001", "model": "gree", "name": "c603d455", "series": "gr> 2022-01-09 13:53:43 INFO (MainThread) [greeclimate.device] Starting device binding to Device: c603d455 @ 192.168.137.11:7000 (mac: 502cc603d455) 2022-01-09 13:53:43 DEBUG (MainThread) [greeclimate.network] Sending packet: {"cid": "app", "i": 1, "t": "pack", "uid": 0, "tcid": "502cc603d455", "pack": {"mac": "502cc603d455", "t": "bind", "uid": 0}} 2022-01-09 13:53:43 DEBUG (MainThread) [greeclimate.network] Received packet from 192.168.137.11: {"t": "pack", "i": 1, "uid": 0, "cid": "502cc603d455", "tcid": "", "pack": {"t": "dev", "cid": "502cc603d455", "bc": "", "brand": "gree", "catalog": "gree", "mac": "502cc603d455", "mid": "10001", "model": "gree", "name": "c603d455", "series": "gr> 2022-01-09 13:53:43 DEBUG (MainThread) [greeclimate.network] Received packet: {"t": "pack", "i": 1, "uid": 0, "cid": "502cc603d455", "tcid": "", "pack": {"t": "bindok", "mac": "502cc603d455", "key": "xxxxxxx", "r": 200}} 2022-01-09 13:53:43 INFO (MainThread) [greeclimate.device] Bound to device using key xxxxxxx 2022-01-09 13:53:43 DEBUG (MainThread) [greeclimate.device] Updating device properties for (Device: c603d455 @ 192.168.137.11:7000 (mac: 502cc603d455)) 2022-01-09 13:53:43 DEBUG (MainThread) [greeclimate.network] Sending packet: {"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "502cc603d455", "pack": {"mac": "502cc603d455", "t": "status", "cols": ["hid"]}} 2022-01-09 13:53:43 DEBUG (MainThread) [greeclimate.network] Received packet: {"t": "pack", "i": 0, "uid": 0, "cid": "502cc603d455", "tcid": "", "pack": {"t": "dat", "mac": "502cc603d455", "r": 200, "cols": ["hid"], "dat": ["362001000762+U-CS532AE(LT)V3.31.bin"]}} 2022-01-09 13:53:43 DEBUG (MainThread) [greeclimate.network] Sending packet: {"cid": "app", "i": 0, "t": "pack", "uid": 0, "tcid": "502cc603d455", "pack": {"mac": "502cc603d455", "t": "status", "cols": ["Pow", "Mod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "SwingL> 2022-01-09 13:53:43 DEBUG (MainThread) [greeclimate.network] Received packet: {"t": "pack", "i": 0, "uid": 0, "cid": "502cc603d455", "tcid": "", "pack": {"t": "dat", "mac": "502cc603d455", "r": 200, "cols": ["Pow", "Mod", "SetTem", "TemSen", "TemUn", "TemRec", "WdSpd", "Air", "Blo", "Health", "SwhSlp", "SlpMod", "Lig", "Sw>

Issue seems to happen when a scan is issued on interfaces "using None". Those are my wireguard interfaces.

wg0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:192.168.6.1 P-t-P:192.168.6.1 Mask:255.255.255.0 UP POINTOPOINT RUNNING NOARP MTU:1420 Metric:1 RX packets:57387 errors:0 dropped:0 overruns:0 frame:0 TX packets:14301 errors:5 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:4603776 (4.3 MiB) TX bytes:4236664 (4.0 MiB)

pia Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 inet addr:10.1.149.176 P-t-P:10.1.149.176 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MTU:1420 Metric:1 RX packets:4479 errors:0 dropped:0 overruns:0 frame:0 TX packets:12117 errors:0 dropped:4 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1002076 (978.5 KiB) TX bytes:972532 (949.7 KiB)

cmroche commented 2 years ago

@gpolosa I see that you have wireguard, there was a bug in this fixed I think in November, and it’s generating an error that looks to be related. What version of HA core are you using at the moment?

gpolosa commented 2 years ago

I'm running the latest docker container.

Frontend version: 20211229.0 - latest System Health Version core-2021.12.8 Installation Type Home Assistant Container Development false Supervisor false Docker true User root Virtual Environment false Python Version 3.9.7 Operating System Family Linux Operating System Version 5.4.0-91-generic CPU Architecture x86_64 Timezone America/Toronto

cmroche commented 2 years ago

Thanks, I think that’s enough information for me to go on then.

gpolosa commented 2 years ago

Thank you for the plugin and the assistance.

cmroche commented 2 years ago

@gpolosa I merged a change that I think will fix the issue, would you be able to run the setup and test from here to confirm: https://github.com/cmroche/greeclimate#running-the-discovery-tests it shouldn't generate any errors on the output when running the discovery test.

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 1.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

gpolosa commented 2 years ago

Looking good. Well done and thank you!