Skip to content

Configuration warning for yaml subtract group #2963

Not planned
@RN-Say

Description

System Health details

System Information

version core-2025.1.2
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.13.1
os_name Linux
os_version 6.6.66-haos
arch x86_64
timezone Asia/Nicosia
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
HACS Data ok
GitHub API Calls Remaining 5000
Installed Version 2.0.3
Stage running
Available Repositories 1504
Downloaded Repositories 30
Home Assistant Cloud
logged_in true
subscription_expiration June 27, 2025 at 3:00 AM
relayer_connected true
relayer_region eu-central-1
remote_enabled true
remote_connected true
alexa_enabled false
google_enabled true
cloud_ice_servers_enabled true
remote_server eu-central-1-12.ui.nabu.casa
certificate_status ready
instance_id f5741608d2354931bbe8c53ea678795e
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Home Assistant OS 14.1
update_channel stable
supervisor_version supervisor-2024.12.3
agent_version 1.6.0
docker_version 27.2.0
disk_total 457.7 GB
disk_used 160.9 GB
healthy true
supported true
host_connectivity true
supervisor_connectivity true
ntp_synchronized true
virtualization
board generic-x86-64
supervisor_api ok
version_api ok
installed_addons File editor (5.8.0), Frigate (0.14.1), Grafana (10.2.2), Home Assistant Google Drive Backup (0.112.1), InfluxDB (5.0.1), Mosquitto broker (6.5.0), Samba share (12.3.3), Terminal & SSH (9.16.0), Zigbee2MQTT (2.0.0-2), Log Viewer (0.17.1), ESPresense Companion (1.0.15), Studio Code Server (5.18.0)
Dashboards
dashboards 5
resources 23
views 39
mode storage
Miele
component_version 2025.1.0
reach_miele_cloud ok
Recorder
oldest_recorder_run January 4, 2025 at 3:13 PM
current_recorder_run January 15, 2025 at 11:49 AM
estimated_db_size 2791.40 MiB
database_engine sqlite
database_version 3.47.1
Sonoff
version 3.8.1 (ffa7e22)
cloud_online 5 / 9
local_online 8 / 8

Checklist

  • I have read the FAQ to see if there is a known solution to my problem.
    I have enabled debug logging for my installation.
    I have filled out the issue template to the best of my ability.
    This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
    This issue is not a duplicate issue of currently previous issues..

Describe the issue

powercalc:
  sensors:
    - create_group: klo_net_power
      group_type: subtract
      entity_id: sensor.klo_socket_circuit_power
      subtract_entities: 
        - entity_id: sensor.r_office_right_plug_current_power
        - entity_id: sensor.r_office_left_plug_current_power

Generates the following warning:

Configuration warnings
Invalid config for 'powercalc' at configuration.yaml, line 36: value should be a string 'powercalc->sensors->0->subtract_entities->0', got {'entity_id': 'sensor.r_office_right_plug_current_power'}
Invalid config for 'powercalc' at configuration.yaml, line 37: value should be a string 'powercalc->sensors->0->subtract_entities->1', got {'entity_id': 'sensor.r_office_left_plug_current_power'}

Using the same entities, I am able to create the group in the GUI

I also tried this configuration, which doesn't generate the errors but also doesn't work (entity not created by Powercalc).

powercalc:
  sensors:
    - create_group: klo_net_power
      group_type: subtract
      entity_id: sensor.klo_socket_circuit_power
      subtract_entities: 
        - sensor.r_office_right_plug_current_power
        - sensor.r_office_left_plug_current_power

Reproduction steps

  1. Create yaml file
  2. Developer Tools
  3. Check Configuration
    ...

Debug logs

I didn't see anything in the logs since I didn't proceed further with a restart when I saw the configuration error.

Diagnostics dump or YAML config

No response

Activity

bramstroker

bramstroker commented on Jan 16, 2025

@bramstroker
Owner

Your first example was wrong indeed.

subtract_entities should be a list, like in your second example.

powercalc:
  sensors:
    - create_group: klo_net_power
      group_type: subtract
      entity_id: sensor.klo_socket_circuit_power
      subtract_entities: 
        - sensor.r_office_right_plug_current_power
        - sensor.r_office_left_plug_current_power

Not sure why no entity is created, this should work.
Did you enable debug logs and check that logs after startup?

bramstroker

bramstroker commented on Jan 16, 2025

@bramstroker
Owner

I see the docs were wrong btw, so that's why you used wrong configuration.
That will be updated. https://docs.powercalc.nl/sensor-types/group/subtract/

RN-Say

RN-Say commented on Jan 16, 2025

@RN-Say
Author

Thanks for having a look. I'll try with the second method again. Maybe that's when I messed up the indentation or something.

github-actions

github-actions commented on Feb 16, 2025

@github-actions
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions

github-actions commented on Feb 22, 2025

@github-actions
Contributor

This issue was closed because it has been stalled for 5 days with no 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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Configuration warning for yaml subtract group · Issue #2963 · bramstroker/homeassistant-powercalc