Skip to content
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

Question / help needed #32

Closed
dedabrane opened this issue Mar 24, 2023 · 4 comments
Closed

Question / help needed #32

dedabrane opened this issue Mar 24, 2023 · 4 comments

Comments

@dedabrane
Copy link

Hi @jazzyisj!

I've been testing this script and it has proven to be very useful.
I'm not very good in writing templates and scripts for HA so I need a little help.
I have tested the template posted in the issue #16 and is it working great.
Now my question is: how can this be changed so that I can list which integration so monitor, for example add a couple of them.
If there are a lot of integrations it's easier to list the ones you want to monitor than exclude the rest if that means for example 3 out of 20.

Thanks!

@jazzyisj
Copy link
Owner

This should do what you want.

{% set entities = expand(integration_entities('alarmo')
    + integration_entities('browser_mod') 
    + integration_entities('glances'))
  |rejectattr('last_changed','ge',ignore_ts)
  |selectattr('state','in',['unavailable','unknown'])  %}

@dedabrane
Copy link
Author

Hi!
Thanks for this, it seems to work as it should.
One question though, I don't know if you know the answer...
I wanted to monitor among other things ESPHome integration and devices.
One of those devices is called "doorbell" and for this to work instead of putting "ESPHome" in the template I have to put the device name "doorbell". Same for the other ESPHome devices.
Any idea why this is not listing entities with integration name in the template?

Thanks!

@jazzyisj
Copy link
Owner

jazzyisj commented Mar 25, 2023

Are you sure "ESPHome" is the correct integration slug? I don't use it so I can't check for you.

One way to check is find the core.config_entries file in the hidden .storage folder and look for the domain parameter of the esp home entry. Here is an example from my file for the Open UV integration. The domain is openuv, so you would use integration entities('openuv'). Do NOT edit this file. You'll be in for a bad time if you don't know exactly what you are doing.

      {
        "entry_id": "ed077502dbf45b39ff540b008614cbf7",
        "version": 2,
        "domain": "openuv",   <------------------------------------------------------
        "title": "42.304285, -82.9256952",
        "data": {
          "api_key": "e1cfd1f5633e305d1c4abcc2ba1ca4ed",
          "latitude": 42.304285,
          "longitude": -82.9256952,
          "elevation": 190.0
        },
        "options": {},
        "pref_disable_new_entities": false,
        "pref_disable_polling": true,
        "source": "user",
        "unique_id": "42.304285, -82.9256952",
        "disabled_by": null
      },

@dedabrane
Copy link
Author

Well, when one knows the tricks of the trade helping others is a snap :-)
Thanks again for pointing me in the right direction.
First, it didn't cross my mind that this could be case sensitive, even more because in the UI it is ESPHome when filtering the devices, but in fact it is esphome in the core.config...

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants