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

Getting a template sensor to work

$
0
0

@rch1708 wrote:

Hello Experts,

To begin, I’m new to HA - attempting to move over from OpenHAB. In my current config, I have a ‘switch’ entity that has a (power consumption) value associated with it. I want to extract the power consumption value and make it a ‘sensor’ entity so that I can graph it. To this end I have setup the following configuration in “sensor.yaml”, after having checked it in the Template Editor:

sensor:
  - platform: template
    sensors:
      american_fridge_power:
        friendly_name: "American Fridge Power"
        unit_of_measurement: 'Watt'
        value_template: "{{ states.switch.americanfridge.attributes.current_consumption }}"

Sensor.yaml is hooked into configuration.yaml with an include. The Template Editor gives the following result:

sensor:
  - platform: template
    sensors:
      american_fridge_power:
        friendly_name: "American Fridge Power"
        unit_of_measurement: 'Watt'
        value_template: "90.1"

The problem is that I have no evidence that this configuration results in a sensor being created. I don’t see a sensor called ‘american_fridge_power’ appear anywhere ie not in the ‘Entities’ list. But neither do I have any evidence that the sensor is not being created - ie there’s nothing in the log file to indicate a problem.

So what am I doing wrong? Have I missed a step out somewhere? Or has the sensor been created and I’ve not yet found it.

Many thanks.

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95399

Trending Articles



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