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

[Bug] Template switches not being matched #58

Closed
marcovolpato00 opened this issue Nov 2, 2024 · 4 comments
Closed

[Bug] Template switches not being matched #58

marcovolpato00 opened this issue Nov 2, 2024 · 4 comments

Comments

@marcovolpato00
Copy link

Hi, I tried adding template switches to the hub configuration but somehow they don't appear. The following is the hub configuration:

"include": [
      {
        "type": "pattern",
        "value": "switch.all_alexa"
      },
      {
        "type": "label",
        "value": "all_alexa"
      },
      {
        "type": "domain",
        "value": "switch"
      },
    ]

As you can see, I tried including all kinds of filters, but the only switches found are the one that are not templates.

BTW thank you very much for your work 😃

@t0bst4r
Copy link
Owner

t0bst4r commented Nov 2, 2024

Did you restart the addon after adding the switch? 😀

@marcovolpato00
Copy link
Author

Sorry, forgot to add that I'm using the docker image and not the addon. In any case, I've tried restarting the container but there are still no template switches

@t0bst4r
Copy link
Owner

t0bst4r commented Nov 3, 2024

In general it doesn't make any difference, where a device is coming from - if its any integration or a template.
Anyway i just validated that template switches in general work.

Maybe you can share a bit more details:

  • number of bridges
  • full configuration of the bridge
  • screenshot of the bridge and its devices
  • log while creating the bridge
  • attributes of at least one missing template switch (HA -> Developer Tools -> State -> search for the entity -> Screenshot)

@marcovolpato00
Copy link
Author

Found the problem! I figured that the only difference between my template switches (manually created in YAML file) and other switches, is that they do not have an unique ID, which is not mandatory.

After adding one in the unique_id field, they now appear in the bridge devices.

I'm guessing that somewhere in HASS APIs or in your code, entities without an unique ID get filtered out

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