sensor.avanza_stock icon indicating copy to clipboard operation
sensor.avanza_stock copied to clipboard

Change not visualized

Open Alarico77 opened this issue 1 year ago • 3 comments

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

Alarico77 avatar Dec 18 '24 11:12 Alarico77

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

claha avatar Dec 18 '24 11:12 claha

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 avatar Dec 18 '24 13:12 Alarico77

Thank you

Alarico77 avatar Dec 18 '24 13:12 Alarico77