Skip to content

Ensure entity_id is lowercase for all slaves#408

Merged
sfstar merged 7 commits intosfstar:mainfrom
kcoffau:main
Feb 7, 2026
Merged

Ensure entity_id is lowercase for all slaves#408
sfstar merged 7 commits intosfstar:mainfrom
kcoffau:main

Conversation

@kcoffau
Copy link
Contributor

@kcoffau kcoffau commented Feb 5, 2026

Refactor entity_id assignment to ensure lowercase format for all cases. Required for HA 2026.2.0

Breaking change

HA 2026.2.0 requires all entities to be lowercase. Some entities from Victron contain capitals, such as L1, L2 etc.
We now convert these to lower case.

Has been tested to not impact existing integrations, automations, graphs etc.

Old Entity ID: sensor.victron_system_consumption_L1
New Entity ID: sensor.victron_system_consumption_l1

Proposed change

Update sensor.py to include ".lower()" at the end of the Sensor naming convention on line 161 and 164. Suggested update by @ondrom111 on case #407.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • The code has been formatted using Ruff (ruff format custom_components/victron)

Refactor entity_id assignment to ensure lowercase format for all cases. Required for HA 2026.2.0
@kcoffau kcoffau marked this pull request as draft February 5, 2026 05:17
@kcoffau kcoffau marked this pull request as ready for review February 5, 2026 05:18
@kcoffau
Copy link
Contributor Author

kcoffau commented Feb 5, 2026

Can add labels, sorry.

@kcoffau
Copy link
Contributor Author

kcoffau commented Feb 5, 2026

Also fixes #405

Copy link

@mr-p666 mr-p666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in my environment.
Works again! (y)

Copy link

@mr-p666 mr-p666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable. ;-)

Copy link

@mr-p666 mr-p666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And as @ondrom111 already mentioned, these files also need to be updated.

binary_sensor.patch
button.patch
number.patch
select.patch
switch.patch

@pos-ei-don
Copy link

Isbthere a Fork wäre the Patches are applied? So i can Update without manually changing Files? I am remote currentpy and changing Files in the cell Phone ist no fun

@kcoffau
Copy link
Contributor Author

kcoffau commented Feb 5, 2026

And as @ondrom111 already mentioned, these files also need to be updated.

binary_sensor.patch button.patch number.patch select.patch switch.patch

Did you make these changes, or you want me to add another PR?

@andreas-bulling
Copy link

@sfstar would be great if you could accept the pull request and publish a new version so that we don't have to manually edit files. Thanks!

Ensure entity_id is in lowercase for consistency.
Ensure entity_id is consistently lowercased for all cases.
Ensure entity_id is in lowercase for consistency.
Ensure entity_id is in lowercase for consistency.
Convert entity_id to lowercase for consistency.
@kcoffau
Copy link
Contributor Author

kcoffau commented Feb 6, 2026

The remaining files have been updated with lowercase. Ive included #400 as well in this (typo)

@pos-ei-don
Copy link

Can you create a Release in your Fork, so i can use IT untlil sfstar creatrs a New Release?

@kcoffau
Copy link
Contributor Author

kcoffau commented Feb 6, 2026

Can you create a Release in your Fork, so i can use IT untlil sfstar creatrs a New Release?

Ive created one but im unsure it will work as you usually need to do a heap of stuff to make HACS acknowledge it as a new integration, which takes weeks. But if you can get it to work, then coolio!

@kcoffau kcoffau requested a review from mr-p666 February 6, 2026 22:03
@pos-ei-don
Copy link

Ive created one but im unsure it will work as you usually need to do a heap of stuff to make HACS acknowledge it as a new integration, which takes weeks. But if you can get it to work, then coolio!

Thank you, but you are right, it did not work.. i wonder why, because i did this before......

@sfstar
Copy link
Owner

sfstar commented Feb 7, 2026

Thanks for submitting this PR. Will review and release it this afternoon

Copy link
Owner

@sfstar sfstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, will test migration of historical data and provide migration function and then release this on 0.7.x release (also containing new registers).

@sfstar sfstar added the breaking-change A breaking change for existing users. label Feb 7, 2026
@sfstar sfstar merged commit 3d3ec1e into sfstar:main Feb 7, 2026
4 of 5 checks passed
@andreas-bulling
Copy link

@sfstar that'd be great. Looking forward to 0.7!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change A breaking change for existing users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add-on doesn't work with HA 2026.2.0 - grid-related entities are unavailable

5 participants