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

variable max #58

Open
warlordattack opened this issue Aug 19, 2022 · 1 comment
Open

variable max #58

warlordattack opened this issue Aug 19, 2022 · 1 comment

Comments

@warlordattack
Copy link

warlordattack commented Aug 19, 2022

Hello, i have upload/download from my internet box

1/
i want to set max as : upload + download

type: custom:dual-gauge-card
title: fbx
min: 0
max: sensor.my_fbx
outer:
entity: sensor.my_fbx
attribute: up
label: up
inner:
entity: sensor.my_fbx
attribute: down
label: down

sensors.yaml :

  • platform: template
    sensors:
    my_fbx:
    unique_id: my_fbx
    friendly_name: "Freebox u/d max"
    unit_of_measurement: "mbps"
    icon_template: 'mdi:network'
    value_template: >
    {% set u = states('sensor.freebox_upload_speed') | int %}
    {% set d = states('sensor.freebox_download_speed') | int %}
    {{ (u + d) }}
    attribute_templates:
    up: "{{ states('sensor.freebox_upload_speed') | int }}"
    down: "{{ states('sensor.freebox_download_speed') | int }}"
    updown: "{{ (states('sensor.freebox_upload_speed') | int) + (states('sensor.freebox_download_speed') | int) | int }}"

My sensor works well,
but max do not take sensor.my_fbx value wich is equal to up+down
example : up=5 down=7 sensor.my_fbx=12 : max should be 12

2022-08-19_150835
2022-08-19_150925

2/
inside sensor.my_fbx i have 3 attributes : up, down, updown
could i define max as an attribute ?

instead of :
max: sensor.my_fbx

i would like :
max:
entity: sensor.my_fbx
attribute: updown

This syntax seem not work ?

help please :)

@gerar19
Copy link

gerar19 commented Feb 7, 2023

This is perfect, but it doesn't work...

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

No branches or pull requests

2 participants