#Sensors from configuration.yaml are not availble for energy dashboard

1 messages · Page 1 of 1 (latest)

maiden basalt
#

I include a separate file for sensor configurations:

sensor: !include sensors.yaml
#

In the sensor.yaml I defined the following:

#
- platform: integration
  source: sensor.desk_socket_office_w
  unique_id: desk_socket_office_kwh
  unit_prefix: k
  round: 2
- platform: integration
  source: sensor.floor_lamp_socket_office_w
  unique_id: floor_lamp_socket_office_kwh
  unit_prefix: k
  round: 2
- platform: integration
  source: sensor.lab_socket_office_w
  unique_id: lab_socket_office_kwh
  unit_prefix: k
  round: 2
- platform: group
  type: sum
  entities:
    - sensor.desktop_socket_office_kwh
    - sensor.floor_lamp_socket_office_kwh
    - sensor.lab_socket_office_kww
  unique_id: office_power_consumption_kwh
  device_class: energy
#

Unfortunately the group sensor is not available in my energy dashboard as a source.

plush cloak
#

do all the integration sensors have valid values?

maiden basalt
#

I can not access the integration sensors

#

The source sensors have valid values

plush cloak
#

what do you mean you can't access them?

#

they have to be created

maiden basalt
#

Nope, they don't

plush cloak
#

???

maiden basalt
#

If I go to Geräte & Dienste -> Entitäten and search for one of the sensors (e.g. sensor.sensor.desk_socket_office_kwh), I got no results.

#

The source sensors can be found

plush cloak
#

well then they weren't created

maiden basalt
#

obviously, the question is why and how can I debug here?

plush cloak
#

did you reload the yaml config? If yes, try reloading HA itself

maiden basalt
#

Yes I tried, Yaml reload, HA reload, HA reboot

#

Nothing happens

plush cloak
#

can you try creating the integration sensor in the UI

maiden basalt
#

This will work

#

But I want to have the ability to change riemann sum sensors if needed, but this is not possible in ui

maiden basalt
#

I tested a bit with the configuration. If I comment out unique_id the sensor will be created. But without this parameter no changes in Web UI are possible.

maiden basalt
#

Do I facing here a bug or what could I do to create sensors this way with own unique_ids and names?

plush cloak
#

have you tried generating a true uuid?

#

unique_id: "aa29bace-88cd-4eb4-b41e-54ed284193be" for example

#

the unique_id doesn't have to be anything readable because you will not see it (it's not the entity_id)

maiden basalt
#

If I follow the documentation for Riemann sum integral (https://www.home-assistant.io/integrations/integration/) than unique_id needs only to be unique and not an uuid.

unique_id string (optional)
An ID that uniquely identifies the integration sensor. Set this to a unique value to allow customization through the UI.
plush cloak
#

that might block it from being created

#

that was the only thing I could think of, otherwise I have no idea

maiden basalt
#

Ok got it. Finally, with this information I was able to make the sensors and groups available. I did the following:

  1. Use an UUID as proposed for unique_id. Other values than UUID don't seem to work
  2. Use my naming scheme for name (e.g. entertainment_socket_living_room_kwh)
  3. Restart Home Assistant, as YAML reload doesn't seem enought for integrations

Finally, my sensors.yaml looks like this:

- platform: integration
  source: sensor.entertainment_socket_living_room_w
  name: entertainment_socket_living_room_kwh
  unique_id: 065641b3-18dd-414a-8c67-a1f8605ac937
  unit_prefix: k
  round: 2
- platform: group
  type: sum
  entities:
    - sensor.entertainment_socket_living_room_kwh
  name: power_consumption_living_room
  unique_id: dd5b852d-cc86-4b3e-a747-8089ec19287f
  device_class: energy
#

With this configuration I am also able to configure details for the entities within the WebUI.

#

I would suggest to adapt the documentation to reflect the findings.

sick mica
#

You can verify that by looking at my configuration, i do not use UUID's for any unique_id.

#

You can also use anything for the name, it does not need to have _'s.

maiden basalt
sick mica
#

Alright, I'm just informing you that you have a miss conception about bullet 1

#

Also, bullet 3 you have a miss conception as well

#

yaml reloading only works if the integration supports yaml reloading. If you add an integration for the first time, you have to restart HA.

#

After that, a button will appear on the reloading page if the integration supports it. If it does, the reload button at the top will work.