Skip to content

variable max #58

Description

@warlordattack

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 :)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions