New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template sensors to not track all state changes #17276

Merged
merged 2 commits into from Oct 10, 2018

Conversation

Projects
None yet
5 participants
@balloob
Member

balloob commented Oct 9, 2018

Description:

When templates are passed in, we try to extract the entities that are needed to track to make sure the entity stays up to date.

We used to just track all state changes if we could not detect it. This change that logic to force the user to specify the entity to track using the existing entity_id configuration option.

This will probably solve a lot of timer out of sync messages as people were rendering too many damn templates.

Related issue (if applicable): home-assistant/architecture#85

Example entry for configuration.yaml (if applicable):

sensor:
  platform: template
  sensors:
    invalid:
      value_template: {{ 1 + 1 }}

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@balloob

This comment has been minimized.

Member

balloob commented Oct 9, 2018

Have a new idea for this PR. Instead of disabling it, going to limit them to manual updates. PR to trigger manual updates incoming.

@balloob balloob referenced this pull request Oct 9, 2018

Merged

Manual updates #17278

3 of 3 tasks complete
@pvizeli

pvizeli approved these changes Oct 9, 2018

@balloob balloob changed the title from Disable template sensor match all to WIP: Disable template sensor match all Oct 9, 2018

@bachya bachya added the Hacktoberfest label Oct 9, 2018

@balloob balloob changed the title from WIP: Disable template sensor match all to Template sensors to not track all state changes Oct 10, 2018

@balloob

This comment has been minimized.

Member

balloob commented Oct 10, 2018

I've updated the PR to still allow template sensors and now instead mention about manual updates.

@balloob balloob merged commit a1dac28 into dev Oct 10, 2018

6 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.001%) to 93.481%
Details

@balloob balloob deleted the disable-template-sensor-match-all branch Oct 10, 2018

@wafflebot wafflebot bot removed the in progress label Oct 10, 2018

@balloob balloob referenced this pull request Oct 10, 2018

Merged

Template Lock #17288

4 of 4 tasks complete

@balloob balloob referenced this pull request Oct 26, 2018

Merged

0.81 #17809

@tedstriker

This comment has been minimized.

Contributor

tedstriker commented Oct 27, 2018

is the logic for entity determination able to find dynamic entities from within groups
or does it reintroduce this problem #11863

tl;dr: can it find entities, which are not explicitly named in the sensor?

@ludeeus ludeeus referenced this pull request Oct 27, 2018

Merged

Added note about entity_id and homeassistant.update_entity #7159

2 of 2 tasks complete

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Oct 28, 2018

Apocrathia referenced this pull request in Apocrathia/home-assistant-config Oct 29, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.