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

Change not visualized #187

Open
Alarico77 opened this issue Dec 18, 2024 · 3 comments
Open

Change not visualized #187

Alarico77 opened this issue Dec 18, 2024 · 3 comments

Comments

@Alarico77
Copy link

Is correct this? Why don't I see any monitored conditions?
in configuration.yaml
sensor:

  • platform: avanza_stock
    stock: 745886 # ID del titolo azionario
    monitored_conditions:
    • change # Variazione del prezzo
    • changePercent # Percentuale di variazione
    • totalVolumeTraded # Volume totale degli scambi
    • totalValueTraded # Valore totale degli scambi

in lovelace:
type: entities
title: Informazioni Stock
entities:

  • entity: sensor.avanza_stock_745886
  • entity: sensor.avanza_stock_745886_change
  • entity: sensor.avanza_stock_745886_changePercent
@claha
Copy link
Member

claha commented Dec 18, 2024

Please use code blocks for the code, but it seems to look ok. Is the sensor created at all? Any error in logs?

@Alarico77
Copy link
Author

I solved it like this:

  • platform: avanza_stock
    stock: 745886 # ID del titolo azionario

  • platform: template
    sensors:
    avanza_stock_745886_change:
    friendly_name: "Variazione Prezzo"
    value_template: "{{ (state_attr('sensor.avanza_stock_745886', 'change') | round(3)) }}"

    avanza_stock_745886_change_percent:
    friendly_name: "Percentuale Variazione"
    value_template: "{{ (state_attr('sensor.avanza_stock_745886', 'changePercent') | round(2)) }}"

    avanza_stock_745886_total_volume_traded:
    friendly_name: "Volume Totale"
    value_template: "{{ (state_attr('sensor.avanza_stock_745886', 'totalVolumeTraded') | round(1)) }}"

@Alarico77
Copy link
Author

Thank you

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