Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration warning for yaml subtract group #2963

Open
5 tasks done
RN-Say opened this issue Jan 16, 2025 · 3 comments
Open
5 tasks done

Configuration warning for yaml subtract group #2963

RN-Say opened this issue Jan 16, 2025 · 3 comments
Labels
bug Something isn't working group

Comments

@RN-Say
Copy link

RN-Say commented Jan 16, 2025

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

@RN-Say RN-Say added the bug Something isn't working label Jan 16, 2025
@bramstroker
Copy link
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
Copy link
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
Copy link
Author

RN-Say commented Jan 16, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working group
Projects
None yet
Development

No branches or pull requests

2 participants