0.112: Making things faster; Logbook & History

Hi All,

I see this in the text how to combine entities in 1 condition:

condition:
  - platform: state
    entity_id:
      - light.kitchen
      - light.living_room
      - light.office
    state: 'on'

Will this also work. Because all my automations using this. Or do I change - condition now to - platform?

  condition:
    - condition: state
      entity_id: sun.sun
      state: "below_horizon"

    - condition: state
      entity_id:
        - switch.scene_evening
        - switch.scene_goodnight
        - sensor.harmony
      state: "off"

Or do i change it to:

  condition:
    - platform: state
      entity_id: sun.sun
      state: "below_horizon"

    - platform: state
      entity_id:
        - switch.scene_evening
        - switch.scene_goodnight
        - sensor.harmony
      state: "off"

Cheers,
Peter

That’s not the hamburger menu when you open it up…

The new configuration options will not break legacy rules (at least for the moment and you’ll get lots of notice when they do)
Both statements seem valid to me and they are the same number of lines.
Though with automations, I’ve never seen a condition not needing a double condition header before listing the conditions, this looks more like a script to me

Thank you for the feedback. All my automations are this way.
What I will do is change them to how the example shows it. Then 1, I learned something and 2, when they will change im good how it must be.

As stated in the first post, this is a “shorthand” form.
There is no “must be” but to be fair, it’s completely up to you.

1 Like

If you can document that the issue is in the Apple Safari browser then I will gladly raise a bug report with Apple - which they will ignore.

But I doubt this is the case. All browsers implement both Javascript and CSS slightly different and some are more tolerant to mistakes than others. The way the page behaves it that it loads with a compressed line of colours and then it all turns white.

IOS devices is not a niche thing. HA should work in IOS.

History does not work on iPad. It does not work on iPhone either. It does not work in the Home Assistant official IOS app on an iPhone. It does not work in Google Chrome on an iPhone. It does not work in any browser I have tried on IOS. I have tried many different devices. Exact same behaviour.
IOS represents approx 40% of all mobile devices globally. It is 40 % of us that cannot see the History in our mobile devices. You must obviously be an Android user.

You say “Have you raised a github issue?” I only wrote 7 lines of text. And the github link is one of the lines. Here it is again. https://github.com/home-assistant/frontend/issues/3340
I did not raise it. It was already there. I have commented on it several times to keep it from being closed by the stalebot. I do not expect bugs to be closed immediate when raised. But after a year, I think it is OK with a little friendly reminder to raise awareness.

I use my iPhone and iPad 90% of the time I interface Home Assistant. It is annoying that this feature is not working. Especially now that it has been improved.

3 Likes

You are correct, my apologies - my skim reading is at fault - again ! :rofl:

Edit1: BUT … if 40% of HA users have issues, why is the github issues not covered in “Me Too’s”

  • Come on Safari users, take action, show the weight of the “Problem”.

Edit2:

I’ve just commented out the xiaomi_aqara section of configuration.yaml and setup the Xiaomi Gateway (Aqara) integration and all my sensors came across fine.

1 Like

I believe that may be a typo. The documents still use:

  condition:
    - condition: state

Yes, I tried it with platform and get a error.
But thanks for the message!

The history page works on my iPhone, both in the official app and a safari browser. I don’t use chrome or any other browser on my phone and I don’t have an iPad to test.

Don’t generalize and say all iOS devices have this issue when you can’t prove it. If it’s not working for you no matter what you use, I suggest you check your HA install.

That’s not true. I use history every week to track my hours at work, on an iPhone.

The Android app, now unable to load the Logbook.

In that case it is specific content that triggers the problem.

I can only talk for my own case and the history page is blank on any IOS device. I did not raise the original bug report so I am not alone.

Anyone having issue with MariaDB when upgrading, seems to fail at the DB migration phase with a connection issue after about 40-50 minutes, but the DB doesn’t go down, any help greatly appreciated, I have had to restore the DB and regress to 0.111.4 for now.:

2020-07-02 11:56:17 WARNING (Recorder) [homeassistant.components.recorder.migration] Database is about to upgrade. Schema version: 7
2020-07-02 11:56:17 WARNING (Recorder) [homeassistant.components.recorder.migration] Adding columns context_parent_id to table events. Note: this can take several minutes on large databases and slow computers. Please be patient!
2020-07-02 11:56:26 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
2020-07-02 12:37:54 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '192.168.1.220' (115)")
(Background on this error at: http://sqlalche.me/e/e3q8)
2020-07-02 12:37:54 ERROR (Recorder) [sqlalchemy.pool.impl.QueuePool] Exception during reset or similar
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2345, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 364, in connect
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 500, in checkout
    rec._checkin_failed(err)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
    exc_value, with_traceback=exc_tb,
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 497, in checkout
    dbapi_connection = rec.get_connection()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 610, in get_connection
    self.__connect()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 661, in __connect
    pool.logger.debug("Error on connect(): %s", e)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
    exc_value, with_traceback=exc_tb,
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
    connection = pool._invoke_creator(self)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 490, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.7/site-packages/MySQLdb/__init__.py", line 84, in Connect
    return Connection(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/MySQLdb/connections.py", line 179, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
MySQLdb._exceptions.OperationalError: (2002, "Can't connect to MySQL server on '192.168.1.220' (115)")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 27, in session_scope
    yield session
  File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 52, in migrate_schema
    _apply_update(instance.engine, new_version, current_version)
  File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 268, in _apply_update
    _add_columns(engine, "events", ["context_parent_id CHARACTER(36)"])
  File "/usr/src/homeassistant/homeassistant/components/recorder/migration.py", line 203, in _add_columns
    table=table_name, column_def=column_def
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2243, in execute
    connection = self._contextual_connect(close_with_result=True)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2311, in _contextual_connect
    self._wrap_pool_connect(self.pool.connect, None),
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2349, in _wrap_pool_connect
    e, dialect, self
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1591, in _handle_dbapi_exception_noconnection
    sqlalchemy_exception, with_traceback=exc_info[2], from_=e
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2345, in _wrap_pool_connect
    return fn()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 364, in connect
    return _ConnectionFairy._checkout(self)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 500, in checkout
    rec._checkin_failed(err)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
    exc_value, with_traceback=exc_tb,
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 497, in checkout
    dbapi_connection = rec.get_connection()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 610, in get_connection
    self.__connect()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 661, in __connect
    pool.logger.debug("Error on connect(): %s", e)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
    exc_value, with_traceback=exc_tb,
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
    connection = pool._invoke_creator(self)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
    return dialect.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 490, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/usr/local/lib/python3.7/site-packages/MySQLdb/__init__.py", line 84, in Connect
    return Connection(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/MySQLdb/connections.py", line 179, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '192.168.1.220' (115)")
(Background on this error at: http://sqlalche.me/e/e3q8)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 752, in _rollback_impl
    self.engine.dialect.do_rollback(self.connection)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/dialects/mysql/base.py", line 2351, in do_rollback
    dbapi_connection.rollback()
MySQLdb._exceptions.OperationalError: (2013, 'Lost connection to MySQL server during query')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 697, in _finalize_fairy
    fairy._reset(pool)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 891, in _reset
    self._reset_agent.rollback()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1760, in rollback
    self._do_rollback()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1798, in _do_rollback
    self.connection._rollback_impl()
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 754, in _rollback_impl
    self._handle_dbapi_exception(e, None, None, None, None)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1518, in _handle_dbapi_exception
    sqlalchemy_exception, with_traceback=exc_info[2], from_=e
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
    raise exception
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 752, in _rollback_impl
    self.engine.dialect.do_rollback(self.connection)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/dialects/mysql/base.py", line 2351, in do_rollback
    dbapi_connection.rollback()
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (2013, 'Lost connection to MySQL server during query')
(Background on this error at: http://sqlalche.me/e/e3q8)
2020-07-02 12:37:54 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '192.168.1.220' (115)")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:37:57 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '192.168.1.220' (115)")
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:00 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:03 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:06 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:09 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:12 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:16 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:19 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:22 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (MySQLdb._exceptions.OperationalError) (1932, "Table 'homeassistant.events' doesn't exist in engine")
[SQL: DESCRIBE `events`]
(Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)
2020-07-02 12:38:22 ERROR (MainThread) [homeassistant.setup] Setup failed for recorder: Integration failed to initialize.

You sure you’re waiting long enough? In previous releases if you had a pi running HA and a large database, it would take upwards of 30 seconds to display a single day of history.

I lost my mediaplayer Denon AVR-X2100W with 0.112.
i have remove it from configuration.yaml, restart HA
then it’s found on new integration, but ever off. no state change.

log

> 020-07-02 13:02:54 ERROR (SyncWorker_13) [DenonAVR] No connection to /goform/AppCommand.xml end point on host 192.168.1. 142
> 2020-07-02 13:02:54 ERROR (SyncWorker_13) [DenonAVR] Getting renamed and deleted sources failed.
> 2020-07-02 13:02:54 ERROR (ThreadPoolExecutor-1_0) [DenonSSDP] During DenonAVR device identification, when trying to request http://192.168.1. 142:8080/description.xml the following error occurred: HTTPConnectionPool(host='192.168.1.%20142', port=8080): Max retries exceeded with url: /description.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x6ad473f0>: Failed to establish a new connection: [Errno -2] Name does not resolve'))
> 2020-07-02 13:02:54 WARNING (ThreadPoolExecutor-1_1) [DenonAVR] Receiver name could not be determined. Using standard name: Denon AVR.
> 2020-07-02 13:02:54 ERROR (ThreadPoolExecutor-1_0) [DenonAVR] Unable to get device information of host 192.168.1. 142, can not use the serial number as identification
> 2020-07-02 13:02:54 ERROR (SyncWorker_13) [DenonAVR] Missing status information from XML of Main for: Power, InputFuncSelect, Mute, MasterVolume
> 2020-07-02 13:02:54 ERROR (SyncWorker_13) [DenonAVR] No connection to /goform/AppCommand.xml end point on host 192.168.1. 142
> 2020-07-02 13:02:54 ERROR (SyncWorker_13) [DenonAVR] Getting renamed and deleted sources failed.
> 2020-07-02 13:02:54 ERROR (ThreadPoolExecutor-4_0) [DenonSSDP] During DenonAVR device identification, when trying to request http://192.168.1. 142:8080/description.xml the following error occurred: HTTPConnectionPool(host='192.168.1.%20142', port=8080): Max retries exceeded with url: /description.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x6aa98610>: Failed to establish a new connection: [Errno -2] Name does not resolve'))
> 2020-07-02 13:02:54 ERROR (ThreadPoolExecutor-4_0) [DenonAVR] Unable to get device information of host 192.168.1. 142, can not use the serial number as identification
> 2020-07-02 13:02:54 ERROR (SyncWorker_13) [DenonAVR] Missing status information from XML of Zone2 for: Power, InputFuncSelect, Mute, MasterVolume
> 2020-07-02 13:02:54 ERROR (SyncWorker_13) [DenonAVR] No connection to /goform/AppCommand.xml end point on host 192.168.1. 142
> 2020-07-02 13:02:54 ERROR (SyncWorker_13) [DenonAVR] Getting renamed and deleted sources failed.
> 2020-07-02 13:02:54 ERROR (ThreadPoolExecutor-7_0) [DenonSSDP] During DenonAVR device identification, when trying to request http://192.168.1. 142:8080/description.xml the following error occurred: HTTPConnectionPool(host='192.168.1.%20142', port=8080): Max retries exceeded with url: /description.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x6aaa2d10>: Failed to establish a new connection: [Errno -2] Name does not resolve'))
> 2020-07-02 13:02:54 ERROR (ThreadPoolExecutor-7_0) [DenonAVR] Unable to get device information of host 192.168.1. 142, can not use the serial number as identification
> 2020-07-02 13:02:54 ERROR (SyncWorker_13) [DenonAVR] Missing status information from XML of Zone3 for: Power, InputFuncSelect, Mute, MasterVolume

@frenck look like integration add a space on IP adress :open_mouth:
open issue https://github.com/home-assistant/core/issues/37352 and find a fast fix
edit .storage/core.config_entries with correct IP

It is :sweat:
Just pushed out a change to the blog post to fix that. Should be visible any moment now.

1 Like

Hi Frenck,
just made the upgrade, had to delete and re-include Zigbee (Aquara) as they lost their sensors but the Aquara plug came back without any sensor (current, power, voltage)

Any idea where to look?

Phil

1 Like

Is there anyway to hide custom groups and scenes in the generated lovelace UI? Or is it time to move to customize the UI now that I have a bunch of things showing up that I previously hid (but still used in automations)?