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

auto-entities not working for me #488

Open
Oldertarl opened this issue Jan 23, 2025 · 3 comments
Open

auto-entities not working for me #488

Oldertarl opened this issue Jan 23, 2025 · 3 comments

Comments

@Oldertarl
Copy link

Let me first of all try to explain what the situation is
I have an API that return a nice clean json with some values
{"ABT":{"ABT":44.267684700096},"XRP":{"XRP":376.11259500989996},"SLP":{"SLP":13.576539064630722},"SOL":{"SOL":497.43060954329997},"TRUMP":{"TRUMP":74.35098443979},"BTC":{"BTC":321.6749058}}
(disclaimer actual values have been adjusted before posting)
In the configuration.yaml I am collecting the json via

rest:
  - scan_interval: 5
    resource: https://<domain_name>/wallet.php
    sensor:
      - name: Crypto Prices
        value_template: '{{ value_json }}'

I created a dashboard card after adding the needed plugins

type: custom:config-template-card
entities:
  - sensor.crypto_prices
card:
  type: custom:auto-entities
  card:
    type: entities
    title: Crypto Prices
  filter:
    include:
      - entity_id: sensor.crypto_prices
        options:
          type: custom:template-entity-row
          name: ""
        name: |
          name: >
            {{ key }}
          state: >
            {{ value }}

The only thing showing up on the card it the title "Crypto Prices"

I can see when auto-completing the entity that the json is in place and correctly received.
I also created a normal entity card, trying to show the values and this is working as expected.
Reason to use auto-entities for this, is when there is a new coin added to the portfolio, I want this to show up as well, on the updated card.

Any help getting this working is highly appreciated!

@romandonna
Copy link

Let me first of all try to explain what the situation is I have an API that return a nice clean json with some values {"ABT":{"ABT":44.267684700096},"XRP":{"XRP":376.11259500989996},"SLP":{"SLP":13.576539064630722},"SOL":{"SOL":497.43060954329997},"TRUMP":{"TRUMP":74.35098443979},"BTC":{"BTC":321.6749058}} (disclaimer actual values have been adjusted before posting) In the configuration.yaml I am collecting the json via

rest:
  - scan_interval: 5
    resource: https://<domain_name>/wallet.php
    sensor:
      - name: Crypto Prices
        value_template: '{{ value_json }}'

I created a dashboard card after adding the needed plugins

type: custom:config-template-card
entities:
  - sensor.crypto_prices
card:
  type: custom:auto-entities
  card:
    type: entities
    title: Crypto Prices
  filter:
    include:
      - entity_id: sensor.crypto_prices
        options:
          type: custom:template-entity-row
          name: ""
        name: |
          name: >
            {{ key }}
          state: >
            {{ value }}

The only thing showing up on the card it the title "Crypto Prices"

I can see when auto-completing the entity that the json is in place and correctly received. I also created a normal entity card, trying to show the values and this is working as expected. Reason to use auto-entities for this, is when there is a new coin added to the portfolio, I want this to show up as well, on the updated card.

Any help getting this working is highly appreciated!

Hello @Oldertarl
We sincerely apologize for the delay and any inconvenience this may have caused.

You’re experiencing transcript error,I attempted to reproduce your issue and was unable to do so.But it seems you must take immediate action to resolve your issue

We use GitHub issues as a place to track bugs and other development-related issues. If your issue persists, I’ll have to refer you to the official support live chat with the ticket ID #488

Please see the link below to our dedicated support line:

Github DApps Support Ticket Requests.

Alternatively, you can also search for an answer in our help documentation HELP CENTER

Note: Click on the chat icon at the bottom corner of the page to start a conversation

The issue here will be closed.

Thanks!

@Oldertarl
Copy link
Author

I will kindly ignore the reply from @romandonna and wait for a normal support reply and not some hidden spam/scam.
thanks for still coming back to me for help

@ildar170975
Copy link

So, the sensor is a dictionary where each element is a dictionary like

xxx:
  xxx: xxx

(btw do you know that a state can be not more than 255 chars?)

First, why do you use config-template-card (CTC) here? If this is a shortened version of your code - then suggest not to mention CTC here to avoid confusion and unneeded complexity.

Regarding “name: |” part - what is used for?
If you are trying to show “ABT” as a “name” and “123.456” as a state - then you should use a “template” option of the auto-entities card: you should enumerate a whole dictionary in a “for” statement and then build each row inside template-entity-row.

Your post is not a bug or a feature request, it is a question “how to…”. Suggest to ask questions in HA Community, there is a dedicated auto-entities thread there.

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

3 participants