dsmr: also migrate entries for devices with correct serial
When the dsmr code could not find the serial_nr for the gas meter,
it creates the gas meter device with the entry_id as identifier.
But when there is a correct serial_nr, it will use that as identifier
for the dsmr gas device.
Now the migration code did not take this into account, so migration to
the new name failed since it didn't look for the device with correct
serial_nr.
This commit fixes this and adds a test for this.
* Add diagnostic information to DSMR
Switches to runtime_data to get access
to the last telegram received.
* Correct import of domain
* Apply suggestions from code review
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
---------
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
current_average_demand and maximum_demand_current_month are missing a state class, which gives errors in the statistics tab in HA.
So adding them to the sensor.
* Add support for multiple mbus devices in dsmr
A dsmr meter can have 4 mbus devices.
Support them all and also add support for a water meter on the mbus
device.
* Apply suggestions from code review
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
* Rewrite old gas sensor to new mbus sensor
* No force updates + fix mbus entity unique_id
* Remove old gas device
* Add additional tests
* Fix remarks from last review + move migrated 5b gas meter to new device_id
* Fix ruff error
* Last fixes
---------
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
* Fix 5B Gas meter in dsmr
In commit 1b73219 the gas meter broke for 5B.
As the change can't be reverted easily without removing the peak usage
sensors, we implement a workaround.
The first MBUS_METER_READING2 value will contain the gas meter data just
like the previous BELGIUM_5MIN_GAS_METER_READING did.
But this without the need to touch dsmr_parser (version).
Fixes: #103306, #103293
* Use parametrize
* Apply suggestions from code review
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
* Add additional tests + typo fix
---------
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
* Add deduplicate script
* Fix forecast_solar incorrect key with space
* Fix utf-8
* Do not create references to other arbitrary other integrations
* Add commented code to only allow applying to referencing integrations
* Tweak
* Bug fix
* Add command line arg for limit reference
* never suggest to update common keys
* Output of script
* Apply suggestions from code review
Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
---------
Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* Fix package names to match pypi index metadata
* uses _
* uses -
* fix metadata