Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95365

Accessing entities' attributes via templae

$
0
0

@steinebr wrote:

Hello,

I want to access attributes of an entitiy (my FritzBox). I’ve already found out, that I have to create a template in configuration.yaml. The entitiy is “sensor.fritz_box_6591_cable” and the attributes are “transmission_rate_up” / “transmission_rate_down”.

sensor:
  - platform: template
    sensors:
      transmission_down_speed_kbps:
        friendly_name: "Transmission Down Speed"
        entity_id: sensor.fritz_box_6591_cable
        unit_of_measurement: 'kB/s'
        value_template: "{{ states('sensor.fritz_box_6591_cable', 'transmission_rate_down')|float * 1024 }}"

      transmission_up_speed_kbps:
        friendly_name: "Transmission Up Speed"
        entity_id: sensor.fritz_box_6591_cable
        unit_of_measurement: 'kB/s'
        value_template: "{{ states('sensor.fritz_box_6591_cable', 'transmission_rate_up')|float * 1024 }}"

After restarting HA, I have no syntax errors in log. But also no extra state objects I can access via UI.
I’ve searched the web and this forum but haven’t found anything applying to my case.
I guess it’s only a small thing that is missing.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95365

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>