0.113: Automations & Scripts, and even more performance!

jodur I’m having issues with a media player with 113. My Volumio entity renamed itself and now automations don’t control the player. You get it figured out?

You have a lot of nerve! If you don’t like the feature, well then just don’t use it!! I never!!!

:stuck_out_tongue_winking_eye:

1 Like

Hell no. That would be a major breaking change.

2 Likes

Please don’t default to queued. Multi-press (often accidentally) would make it run twice, terrible. Current single default is best choice.Although previous version was more like restart, but single is the preferred default.

Phil has already indicated that this will not happen.

I did not see his reply until after I had replied.

What I meant with the documentation was that the new feature had examples only using state changes and I had to spend some time putting the things together (based on the exact docs you link to).

I encourage to use more complete examples in the documentation in general. I remember how it was a year ago when I started. The fully working examples on this forum and the github configs many have shared have been a life saver for me.

So I just wanted to share a fully working example where the trigger is events.

I just posted the first two “if then” in my example. When you have the full example where the 4-button remote is used with several functions per butten then you need more than can be handled in a data_template.

I have more than 20 remotes and there is also some value in having the exact same yaml structure in all of them. If you try to be too smart, and come back in 6 months to tweak something then it becomes more difficult to maintain. Sometimes 5 lines of code is better than being smart and compact

I like the example of

{{ trigger.event.data.event in (1001, 1002) }}

instead of my “or” syntax. I will use that. The beauty of open source. You contribute something and you get even more in return.

3 Likes

Guessing it’s this problem. So no upgrades for me for a while.

In the actual example where the only difference is the brightness could be done like that.
But the other buttons have different functions and often I use completely different actions for the long press features.
My missions was to show and share how to use the new automation feature where the trigger is an event instead of a state change.

I’m having the same issue of the rollback happening 10min after 0.113 booting (looks rather successful in the frontend and logs up until then), but I’m not using tensorflow. So it’s probably another component that’s blocking my upgrade. Unfortunately the logs give me no indication which one it could be…

Try the code in this PR to enable logging to help find the integration blocking startup.

Yep, rolled back as well - all my LightwaveRF ‘Mood’ switches failed. Really don’t want to have to go through every device one by one.

Whilst I’m sure there are reasons for these changes, I can’t help but think this changes breaks more than they anticipated, or was tested in a fairly limited scope.

0.113: great work has been done, my compliments!
What I noticed is that the errors/warnings/etc in Logs has almost been reduced to Zero. :+1:

1 Like

after restarting the system with the restart an error message appears and it seems that home assistant has not finished starting

20-07-24 10:27:06 WARNING (MainThread) [supervisor.homeassistant] Don’t wait anymore of Home Assistant startup!
20-07-24 10:27:06 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name=‘Task-241647’ coro=<process_lock..wrap_api() done, defined at /usr/src/supervisor/supervisor/utils/init.py:22> exception=HomeAssistantError()>
Traceback (most recent call last):
File “/usr/src/supervisor/supervisor/utils/init.py”, line 31, in wrap_api
return await method(api, *args, **kwargs)
File “/usr/src/supervisor/supervisor/homeassistant.py”, line 421, in restart
await self._block_till_run()
File “/usr/src/supervisor/supervisor/homeassistant.py”, line 638, in _block_till_run
raise HomeAssistantError()
supervisor.exceptions.HomeAssistantError

+1
i try comment all inegration. then upgrade. see more glich. then i roolback

Getting the same error and restart taking over ten minutes to fully complete

20-07-24 07:20:22 INFO (SyncWorker_1) [supervisor.docker.interface] Restart homeassistant/raspberrypi4-homeassistant
20-07-24 07:20:22 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API error: Received message 8:1000 is not str
20-07-24 07:20:22 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API connection is closed
20-07-24 07:20:46 INFO (MainThread) [supervisor.homeassistant] Home Assistant pip installation in progress
20-07-24 07:21:23 INFO (MainThread) [supervisor.homeassistant] Home Assistant pip installation done
20-07-24 07:23:00 INFO (MainThread) [supervisor.homeassistant] Updated Home Assistant API token
20-07-24 07:30:34 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/stable.json
20-07-24 07:31:27 WARNING (MainThread) [supervisor.homeassistant] Don't wait anymore of Home Assistant startup!
20-07-24 07:31:27 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-211227' coro=<process_lock.<locals>.wrap_api() done, defined at /usr/src/supervisor/supervisor/utils/__init__.py:22> exception=HomeAssistantError()>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 31, in wrap_api
    return await method(api, *args, **kwargs)
  File "/usr/src/supervisor/supervisor/homeassistant.py", line 421, in restart
    await self._block_till_run()
  File "/usr/src/supervisor/supervisor/homeassistant.py", line 638, in _block_till_run
    raise HomeAssistantError()
supervisor.exceptions.HomeAssistantError
20-07-24 07:32:57 INFO (SyncWorker_5) [supervisor.docker.interface] Restart homeassistant/raspberrypi4-homeassistant
20-07-24 07:33:17 INFO (MainThread) [supervisor.homeassistant] Home Assistant pip installation in progress
20-07-24 07:33:54 INFO (MainThread) [supervisor.homeassistant] Home Assistant pip installation done
20-07-24 07:34:15 INFO (MainThread) [supervisor.homeassistant] Detect a running Home Assistant instance
20-07-24 07:34:17 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
20-07-24 07:34:17 INFO (MainThread) [supervisor.api.proxy] WebSocket access from a0d7b954_appdaemon
20-07-24 07:34:17 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running#

I’m suspecting the Amcrest Integration?

thnx for that examle, gonna change my deconz automations also

you guys dont have issues with Tuya? i see a lot of errors like below , sometimes it works, sometimes errors

2020-07-24 12:49:04 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.tuya_2 fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.8/http/client.py", line 1332, in getresponse
    response.begin()
  File "/usr/local/lib/python3.8/http/client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.8/http/client.py", line 272, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 726, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 403, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.8/site-packages/urllib3/packages/six.py", line 734, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.8/http/client.py", line 1332, in getresponse
    response.begin()
  File "/usr/local/lib/python3.8/http/client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.8/http/client.py", line 272, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 272, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 465, in async_device_update
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tuya/__init__.py", line 254, in update
    self._tuya.update()
  File "/usr/local/lib/python3.8/site-packages/tuyaha/devices/switch.py", line 29, in update
    devices = self.api.discovery()
  File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 117, in discovery
    response = self._request("Discovery", "discovery")
  File "/usr/local/lib/python3.8/site-packages/tuyaha/tuyaapi.py", line 163, in _request
    response = self.requestSession.post(
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 578, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

No, managed to get rid of all my TUYA stuff… :grinning:

1 Like

EDIT: Disregard.

This explanation has answered so many “why did it do that?” from the past – thank you! And thanks for the great new extensions to scripts and automations.