wogri / hass-blinds

Homessistant Blind library
Apache License 2.0
17 stars 1 forks source link

concurrent.futures._base.TimeoutError #3

Closed kaczkalolo closed 3 years ago

kaczkalolo commented 3 years ago

I'm getting that error:

2021-08-03 22:09:49.119978 WARNING blind_livingroom1: ------------------------------------------------------------ 2021-08-03 22:09:49.122436 WARNING blind_livingroom1: Unexpected error in worker for App blind_livingroom1: 2021-08-03 22:09:49.124175 WARNING blind_livingroom1: Worker Ags: {'id': 'c752cba686df484ba3e183e3396e73fa', 'name': 'blind_livingroom1', 'objectid': 'b12d4d1557924715ae6d07c3bcf36097', 'type': 'scheduler', 'function': <bound method Blinds.tick of <blinds.B linds object at 0x7fa5749610>>, 'pin_app': True, 'pin_thread': 2, 'kwargs': {'interval': 60, 'thread_id': 'thread-2'}} 2021-08-03 22:09:49.126040 WARNING blind_livingroom1: ------------------------------------------------------------ 2021-08-03 22:09:49.132927 WARNING blind_livingroom1: Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 890, in worker funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"])) File "/config/appdaemon/apps/hass-blinds/blinds.py", line 179, in tick self.evaluate() File "/config/appdaemon/apps/hass-blinds/blinds.py", line 86, in evaluate self.call_service("cover/set_cover_position", entity_id=self.args["blind"], position=position) File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 197, in inner_sync_wrapper f = run_coroutine_threadsafe(self, coro(self, *args, **kwargs)) File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 308, in run_coroutine_threadsafe result = future.result(self.AD.internal_function_timeout) File "/usr/lib/python3.8/concurrent/futures/_base.py", line 446, in result raise TimeoutError() concurrent.futures._base.TimeoutError 2021-08-03 22:09:49.135303 WARNING blind_livingroom1: ------------------------------------------------------------ 2021-08-03 22:09:49.140000 WARNING AppDaemon: callback tick() in blind_livingroom1 has now completed 2021-08-03 22:09:50.249724 WARNING blind_diningroom3: ------------------------------------------------------------ 2021-08-03 22:09:50.252018 WARNING blind_diningroom3: Unexpected error in worker for App blind_diningroom3: 2021-08-03 22:09:50.254048 WARNING blind_diningroom3: Worker Ags: {'id': 'fa48a2eb7fc44b59bd242c776e35632f', 'name': 'blind_diningroom3', 'objectid': 'ae712b55ed194b2d93c13915bb0171b5', 'type': 'scheduler', 'function': <bound method Blinds.tick of <blinds.B linds object at 0x7fa5749640>>, 'pin_app': True, 'pin_thread': 6, 'kwargs': {'interval': 60, 'thread_id': 'thread-6'}} 2021-08-03 22:09:50.255920 WARNING blind_diningroom3: ------------------------------------------------------------ 2021-08-03 22:09:50.258342 WARNING blind_diningroom3: Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/appdaemon/threading.py", line 890, in worker funcref(self.AD.sched.sanitize_timer_kwargs(app, args["kwargs"])) File "/config/appdaemon/apps/hass-blinds/blinds.py", line 179, in tick self.evaluate() File "/config/appdaemon/apps/hass-blinds/blinds.py", line 86, in evaluate self.call_service("cover/set_cover_position", entity_id=self.args["blind"], position=position) File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 197, in inner_sync_wrapper f = run_coroutine_threadsafe(self, coro(self, *args, **kwargs)) File "/usr/lib/python3.8/site-packages/appdaemon/utils.py", line 308, in run_coroutine_threadsafe result = future.result(self.AD.internal_function_timeout) File "/usr/lib/python3.8/concurrent/futures/_base.py", line 446, in result raise TimeoutError() concurrent.futures._base.TimeoutError

That only happens at night when blinds are closed. During the day everything is just fine. Also at night i can see in log that hass-blinds is trying all the time to move blinds and it is doing that through out the whole night until blinds are closed for night:

2021-08-03 22:01:40.735321 INFO blind_kitchen_1: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:01:40.784467 INFO blind_kitchen_2: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:01:40.925547 INFO blind_diningroom2: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:01:40.935724 INFO blind_diningroom3: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:01:40.939432 INFO blind_diningroom4: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:02:39.097050 INFO blind_livingroom2: Changing position of blind cover.living_room_blind_2 from 10 to 15 because: Down because of darkness 2021-08-03 22:02:39.131060 INFO blind_livingroom1: Changing position of blind cover.living_room_blind_1 from 10 to 15 because: Down because of darkness 2021-08-03 22:02:39.139049 INFO blind_diningroom1: Changing position of blind cover.dining_room_blind_1 from 10 to 15 because: Down because of darkness 2021-08-03 22:02:39.627122 INFO blind_livingroom1: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:02:39.644450 INFO blind_livingroom2: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:02:39.657246 INFO blind_diningroom1: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:02:40.255416 INFO blind_diningroom4: Changing position of blind cover.dining_room_blind_4 from 10 to 15 because: Down because of darkness 2021-08-03 22:02:40.263810 INFO blind_diningroom3: Changing position of blind cover.dining_room_blind_3 from 10 to 15 because: Down because of darkness 2021-08-03 22:02:40.270591 INFO blind_diningroom2: Changing position of blind cover.dining_room_blind_2 from 10 to 15 because: Down because of darkness 2021-08-03 22:02:40.287754 INFO blind_boiler_room: Changing position of blind cover.boiler_room_blind from 10 to 15 because: Down because of darkness 2021-08-03 22:02:40.293216 INFO blind_kitchen_1: Changing position of blind cover.kitchen_blind_1 from 10 to 15 because: Down because of darkness 2021-08-03 22:02:40.296801 INFO blind_kitchen_2: Changing position of blind cover.kitchen_blind_2 from 10 to 15 because: Down because of darkness 2021-08-03 22:02:40.678526 INFO blind_diningroom4: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:02:40.697423 INFO blind_diningroom2: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:02:40.699385 INFO blind_diningroom3: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:02:40.989583 INFO blind_kitchen_1: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:02:41.052562 INFO blind_boiler_room: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:02:41.072908 INFO blind_kitchen_2: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:03:39.087141 INFO blind_livingroom1: Changing position of blind cover.living_room_blind_1 from 10 to 15 because: Down because of darkness 2021-08-03 22:03:39.126650 INFO blind_livingroom2: Changing position of blind cover.living_room_blind_2 from 10 to 15 because: Down because of darkness 2021-08-03 22:03:39.142635 INFO blind_diningroom1: Changing position of blind cover.dining_room_blind_1 from 10 to 15 because: Down because of darkness 2021-08-03 22:03:39.573358 INFO blind_livingroom2: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:03:39.590256 INFO blind_livingroom1: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:03:39.603295 INFO blind_diningroom1: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:03:40.283849 INFO blind_kitchen_2: Changing position of blind cover.kitchen_blind_2 from 10 to 15 because: Down because of darkness 2021-08-03 22:03:40.287421 INFO blind_diningroom4: Changing position of blind cover.dining_room_blind_4 from 10 to 15 because: Down because of darkness 2021-08-03 22:03:40.302321 INFO blind_diningroom3: Changing position of blind cover.dining_room_blind_3 from 10 to 15 because: Down because of darkness 2021-08-03 22:03:40.305440 INFO blind_kitchen_1: Changing position of blind cover.kitchen_blind_1 from 10 to 15 because: Down because of darkness 2021-08-03 22:03:40.318532 INFO blind_diningroom2: Changing position of blind cover.dining_room_blind_2 from 10 to 15 because: Down because of darkness 2021-08-03 22:03:40.330051 INFO blind_boiler_room: Changing position of blind cover.boiler_room_blind from 10 to 15 because: Down because of darkness 2021-08-03 22:03:40.764573 INFO blind_kitchen_2: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:03:40.782961 INFO blind_diningroom4: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:03:40.797023 INFO blind_diningroom3: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:03:41.160587 INFO blind_boiler_room: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:03:41.176613 INFO blind_kitchen_1: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:03:41.190346 INFO blind_diningroom2: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:04:39.119606 INFO blind_livingroom2: Changing position of blind cover.living_room_blind_2 from 10 to 15 because: Down because of darkness 2021-08-03 22:04:39.152517 INFO blind_livingroom1: Changing position of blind cover.living_room_blind_1 from 10 to 15 because: Down because of darkness 2021-08-03 22:04:39.163050 INFO blind_diningroom1: Changing position of blind cover.dining_room_blind_1 from 10 to 15 because: Down because of darkness 2021-08-03 22:04:39.625424 INFO blind_livingroom2: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:04:39.641341 INFO blind_diningroom1: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:04:39.696909 INFO blind_livingroom1: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:04:40.277518 INFO blind_kitchen_2: Changing position of blind cover.kitchen_blind_2 from 10 to 15 because: Down because of darkness 2021-08-03 22:04:40.287437 INFO blind_diningroom2: Changing position of blind cover.dining_room_blind_2 from 10 to 15 because: Down because of darkness 2021-08-03 22:04:40.312289 INFO blind_diningroom3: Changing position of blind cover.dining_room_blind_3 from 10 to 15 because: Down because of darkness 2021-08-03 22:04:40.317200 INFO blind_boiler_room: Changing position of blind cover.boiler_room_blind from 10 to 15 because: Down because of darkness 2021-08-03 22:04:40.338734 INFO blind_kitchen_1: Changing position of blind cover.kitchen_blind_1 from 10 to 15 because: Down because of darkness 2021-08-03 22:04:40.353546 INFO blind_diningroom4: Changing position of blind cover.dining_room_blind_4 from 10 to 15 because: Down because of darkness 2021-08-03 22:04:40.700631 INFO blind_kitchen_2: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:04:40.706146 INFO blind_diningroom2: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:04:40.712906 INFO blind_diningroom3: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:04:40.910853 INFO blind_kitchen_1: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:04:40.925861 INFO blind_boiler_room: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:04:41.238595 INFO blind_diningroom4: Not setting the tilt as these blinds don't have that feature. 2021-08-03 22:05:39.082364 INFO blind_livingroom1: Changing position of blind cover.living_room_blind_1 from 10 to 15 because: Down because of darkness 2021-08-03 22:05:39.116118 INFO blind_diningroom1: Changing position of blind cover.dining_room_blind_1 from 10 to 15 because: Down because of darkness 2021-08-03 22:05:39.140191 INFO blind_livingroom2: Changing position of blind cover.living_room_blind_2 from 10 to 15 because: Down because of darkness

Maybe that has something to do???

wogri commented 3 years ago

Can you show me your current appdaemon.yaml? Did you set the number of threads?

Also can you show me the diff of your lib/blinds.py to my upstream version (it seems you changed the value for DOWN?)? The fact that it tries to change the position from 10 to 15 could mean that it sends a command to the blind ("go to position 15 because you are in position 10"), but the blind doesn't support that for whatever reason and keeps reporting position 10?

kaczkalolo commented 3 years ago

I added it just now - forgot yesterday - but when i looked at the log it says: 2021-08-04 07:27:03.258692 WARNING AppDaemon: Threads directive is deprecated apps - will be pinned. Use total_threads if you want to unpin your apps

cat config/appdaemon/appdaemon.yaml

secrets: /config/secrets.yaml appdaemon: threads: 40 latitude: xx longitude: xx elevation: 214 time_zone: Europe/Warsaw plugins: HASS: type: hass http: url: http://127.0.0.1:5050 admin: api: hadashboard:

About the blinds- i can set them to whatever postition and they report that exact position. I will double check it today at night. But at day time when it closes blinds they also go to 15 and there is no such thing in log. At night app is saying always about 10 so i feel like there is something in the code...

kaczkalolo commented 3 years ago

diff blinds_lib.py /config/appdaemon/apps/hass-blinds/lib/blinds_lib.py 50c50 < DOWN = 0 --- > DOWN = 15

wogri commented 3 years ago

Threads directive is deprecated apps - will be pinned. Use total_threads if you want to unpin your apps

Please try to set total_threads in that case.

Also please check the reported position in homeassistant at night. I suspect that home assistant will be of the opinion that the position is at 10, but I'm not sure at this point.

wogri commented 3 years ago

Oh, I just realized a thing; because of how my blinds work (when you adjust the angle the position gets slightly modified) I round on a precision of 10, so if you set your blinds to a position of 15 it will not work. set it to 10 or 20 and it will not spill the logs with useless information.

kaczkalolo commented 3 years ago

cool - will try