jrfernandes / ontario_energy_board

Home Assistant component that installs a sensor with the current energy rate for Ontario energy companies
MIT License
41 stars 10 forks source link

How do I add this to dashboard? #8

Closed mjb83 closed 1 year ago

mjb83 commented 2 years ago

Sorry for incredible noob question, but I can't seem to find the entity for this once I've installed via HACS?

My assumption is that an entity is created when I install, but I'm not seeing anything related to Ontario energy when I scroll through my entities.

kwkid commented 2 years ago

It's a 2-step install...

  1. Install via HACS. Seems like you have done this already.
  2. Go to Settings -> Device and Services -> Add Integration...you should now see this
  3. Install

image

mjb83 commented 2 years ago

Yep, super noob couldn't find it.

Thanks very much for taking the time to answer. Working great!

mjb83 commented 2 years ago

What about mapping the attributes so I can have each of them on their own entity card? Is this possible?

For instance, I have "sensor.alectra_utilities_corporation_brampton_rate_zone_residential_rate" currently set as a gauge card showing off_peak as 'green' zone, mid_peak as 'yellow' zone, and on_peak as 'red' zone. Is there a way for me to show the attribute 'active_peak' as its own entity so I can have it on its own entity card?

Been trying something like this is configuration.yaml but I can't seem to get it to map:

sensor:

kwkid commented 2 years ago

for your example try this.... be careful around spacing / indentation

1st line: start with dash platform: template (you had template1) 2nd line...align sensors under platform 3rd line...indent 2 spaces for sensor name 4th line...align value_template under alectra..... (double quotes with inner single quotes) 5th line...align friendly_name under alectra....

once your sensor is setup...you reference it as sensor.alectra_utilities_active peak in your Entities card.

drop the platform: alectra_utilities tag...

kwkid commented 2 years ago

should be like this...seems the editor in this tool drops the spaces...

image

mjb83 commented 2 years ago

I feel like I need a line above - platform: template

Does the first line need to be the hacs install name? I tried sensor below but I'm getting an error for duplicate key.

OntarioPowerAttributes

sensor:

jrfernandes commented 1 year ago

This should work:

sensor: 
  - platform: template
    sensors:
      alectra_utilities_active_peak:
        value_template: "{{ state_attr('sensor.alectra_utilities_corporation_brampton_rate_zone_residential_rate', 'active_peak') }}"
        friendly_name: Alectra Active Peak

Line 1 is if you're adding this to your configuration.yaml file directly, as opposed to using a separate YAML file for sensors. If that's the case, skip line 1. Line 4 is the ID of your new sensor. Make sure it's unique. Line 5 gets the active peak from the attribute of the OEB sensor. Make sure the sensor ID matches what you have. Line 6 is just the friendly name for the sensor, it can be anything.

kwkid commented 1 year ago

It depends on whether this is the only sensor you have and where is the sensor stored (are your sensors in configuration.yaml or have you broken the sensors out into a separate file sensor.yaml)… Personally I have broken out my sensors into a separate sensor.yaml file with a reference to this file in configuration.yaml..there are plenty of examples like this..

On May 23, 2022, at 11:40 AM, mjb83 @.***> wrote:



I feel like I need a line above - platform: template

Does the first line need to be the hacs install name? I tried sensor below but I'm getting an error for duplicate key.

OntarioPowerAttributes

sensor:

— Reply to this email directly, view it on GitHubhttps://github.com/jrfernandes/ontario_energy_board/issues/8#issuecomment-1134833081, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASPBD66Q72R4KRFZ4BJODQLVLORGVANCNFSM5WQXKIWA. You are receiving this because you commented.Message ID: @.***>