core: modbus: invalid config after Update to 2023.10

The problem

Using Modbus for Sungrow inverter. After the latest update this does no longer work:

Logger: homeassistant.config Source: config.py:501 First occurred: 22:12:45 (1 occurrences) Last logged: 22:12:45

Invalid config for [modbus]: BDC rated power: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][19]. Got {‘name’: ‘BDC rated power’, ‘unique_id’: ‘sg_bdc_rated_power’, ‘slave’: 1, ‘address’: 5627, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 100, ‘scan_interval’: 10} BMS max. charging current: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][20]. Got {‘name’: ‘BMS max. charging current’, ‘unique_id’: ‘sg_bms_max_charging_current’, ‘slave’: 1, ‘address’: 5634, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 0, ‘unit_of_measurement’: ‘A’, ‘device_class’: ‘Current’, ‘scale’: 1, ‘scan_interval’: 60} BMS max. discharging current: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][21]. Got {‘name’: ‘BMS max. discharging current’, ‘unique_id’: ‘sg_bms_max_discharging_current’, ‘slave’: 1, ‘address’: 5635, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 0, ‘unit_of_measurement’: ‘A’, ‘device_class’: ‘Current’, ‘scale’: 1, ‘scan_interval’: 60} Backup phase A power: count: 1 cannot be combined with data_type: int16 @ data[‘modbus’][0][‘sensors’][23]. Got {‘name’: ‘Backup phase A power’, ‘unique_id’: ‘sg_backup_phase_a_power’, ‘slave’: 1, ‘address’: 5722, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘int16’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Backup phase B power: count: 1 cannot be combined with data_type: int16 @ data[‘modbus’][0][‘sensors’][24]. Got {‘name’: ‘Backup phase B power’, ‘unique_id’: ‘sg_backup_phase_b_power’, ‘slave’: 1, ‘address’: 5723, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘int16’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Backup phase C power: count: 1 cannot be combined with data_type: int16 @ data[‘modbus’][0][‘sensors’][25]. Got {‘name’: ‘Backup phase C power’, ‘unique_id’: ‘sg_backup_phase_c_power’, ‘slave’: 1, ‘address’: 5724, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘int16’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Battery SoC reserve: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][62]. Got {‘name’: ‘Battery SoC reserve’, ‘unique_id’: ‘sg_battery_soc_reserve’, ‘slave’: 1, ‘address’: 13099, ‘input_type’: ‘holding’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘unit_of_measurement’: ‘%’, ‘device_class’: ‘battery’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 10} Battery current: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][39]. Got {‘name’: ‘Battery current’, ‘unique_id’: ‘sg_battery_current’, ‘slave’: 1, ‘address’: 13020, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘A’, ‘device_class’: ‘Current’, ‘scale’: 0.1, ‘scan_interval’: 10} Battery forced charge discharge cmd raw: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][58]. Got {‘name’: ‘Battery forced charge discharge cmd raw’, ‘unique_id’: ‘sg_battery_forced_charge_discharge_cmd_raw’, ‘slave’: 1, ‘address’: 13050, ‘input_type’: ‘holding’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 0, ‘scan_interval’: 10} Battery forced charge discharge power: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][59]. Got {‘name’: ‘Battery forced charge discharge power’, ‘unique_id’: ‘sg_battery_forced_charge_discharge_power’, ‘slave’: 1, ‘address’: 13051, ‘input_type’: ‘holding’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scan_interval’: 10} Battery level: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][41]. Got {‘name’: ‘Battery level’, ‘unique_id’: ‘sg_battery_level’, ‘slave’: 1, ‘address’: 13022, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘%’, ‘device_class’: ‘battery’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 60} Battery power: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][40]. Got {‘name’: ‘Battery power’, ‘unique_id’: ‘sg_battery_power’, ‘slave’: 1, ‘address’: 13021, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Battery state of health: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][42]. Got {‘name’: ‘Battery state of health’, ‘unique_id’: ‘sg_battery_state_of_health’, ‘slave’: 1, ‘address’: 13023, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 0, ‘unit_of_measurement’: ‘%’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 10} Battery temperature: count: 1 cannot be combined with data_type: int16 @ data[‘modbus’][0][‘sensors’][43]. Got {‘name’: ‘Battery temperature’, ‘unique_id’: ‘sg_battery_temperature’, ‘slave’: 1, ‘address’: 13024, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘int16’, ‘precision’: 1, ‘unit_of_measurement’: ‘°C’, ‘device_class’: ‘Temperature’, ‘scale’: 0.1, ‘scan_interval’: 60} Battery voltage: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][38]. Got {‘name’: ‘Battery voltage’, ‘unique_id’: ‘sg_battery_voltage’, ‘slave’: 1, ‘address’: 13019, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 0, ‘unit_of_measurement’: ‘V’, ‘device_class’: ‘Voltage’, ‘scale’: 0.1, ‘scan_interval’: 10} Daily PV generation & battery discharge: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][1]. Got {‘name’: ‘Daily PV generation & battery discharge’, ‘unique_id’: ‘sg_daily_pv_gen_battery_discharge’, ‘slave’: 1, ‘address’: 5002, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘total_increasing’, ‘scale’: 0.1, ‘scan_interval’: 600} Daily PV generation: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][28]. Got {‘name’: ‘Daily PV generation’, ‘unique_id’: ‘sg_daily_pv_generation’, ‘slave’: 1, ‘address’: 13001, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 600} Daily battery charge from PV: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][34]. Got {‘name’: ‘Daily battery charge from PV’, ‘unique_id’: ‘sg_daily_battery_charge_from_pv’, ‘slave’: 1, ‘address’: 13011, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 600} Daily battery charge: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][52]. Got {‘name’: ‘Daily battery charge’, ‘unique_id’: ‘sg_daily_battery_charge’, ‘slave’: 1, ‘address’: 13039, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 600} Daily battery discharge: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][44]. Got {‘name’: ‘Daily battery discharge’, ‘unique_id’: ‘sg_daily_battery_discharge’, ‘slave’: 1, ‘address’: 13025, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 600} Daily direct energy consumption: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][36]. Got {‘name’: ‘Daily direct energy consumption’, ‘unique_id’: ‘sg_daily_direct_energy_consumption’, ‘slave’: 1, ‘address’: 13016, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 600} Daily exported energy from PV: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][30]. Got {‘name’: ‘Daily exported energy from PV’, ‘unique_id’: ‘sg_daily_exported_energy_from_PV’, ‘slave’: 1, ‘address’: 13004, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 600} Daily exported energy: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][54]. Got {‘name’: ‘Daily exported energy’, ‘unique_id’: ‘sg_daily_exported_energy’, ‘slave’: 1, ‘address’: 13044, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 600} Daily imported energy: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][50]. Got {‘name’: ‘Daily imported energy’, ‘unique_id’: ‘sg_daily_imported_energy’, ‘slave’: 1, ‘address’: 13035, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 600} EMS mode selection raw: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][57]. Got {‘name’: ‘EMS mode selection raw’, ‘unique_id’: ‘sg_ems_mode_selection_raw’, ‘slave’: 1, ‘address’: 13049, ‘input_type’: ‘holding’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘scan_interval’: 10} Export power raw: count: 2 cannot be combined with data_type: int32 @ data[‘modbus’][0][‘sensors’][33]. Got {‘name’: ‘Export power raw’, ‘unique_id’: ‘sg_battery_export_power_raw’, ‘slave’: 1, ‘address’: 13009, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘int32’, ‘swap’: ‘word’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Grid frequency: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][12]. Got {‘name’: ‘Grid frequency’, ‘unique_id’: ‘sg_grid_frequency’, ‘slave’: 1, ‘address’: 5035, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 2, ‘unit_of_measurement’: ‘Hz’, ‘device_class’: ‘frequency’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 10} Inverter start stop: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][56]. Got {‘name’: ‘Inverter start stop’, ‘unique_id’: ‘sg_inverter_start_stop’, ‘slave’: 1, ‘address’: 12999, ‘input_type’: ‘holding’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 0, ‘scan_interval’: 10} Inverter temperature: count: 1 cannot be combined with data_type: int16 @ data[‘modbus’][0][‘sensors’][3]. Got {‘name’: ‘Inverter temperature’, ‘unique_id’: ‘sg_inverter_temperature’, ‘slave’: 1, ‘address’: 5007, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘int16’, ‘precision’: 1, ‘unit_of_measurement’: ‘°C’, ‘device_class’: ‘Temperature’, ‘scale’: 0.1, ‘scan_interval’: 10} Load power: count: 2 cannot be combined with data_type: int32 @ data[‘modbus’][0][‘sensors’][32]. Got {‘name’: ‘Load power’, ‘unique_id’: ‘sg_load_power’, ‘slave’: 1, ‘address’: 13007, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘int32’, ‘swap’: ‘word’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} MPPT1 current: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][5]. Got {‘name’: ‘MPPT1 current’, ‘unique_id’: ‘sg_mppt1_current’, ‘slave’: 1, ‘address’: 5011, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 2, ‘unit_of_measurement’: ‘A’, ‘device_class’: ‘Current’, ‘scale’: 0.1, ‘scan_interval’: 10} MPPT1 voltage: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][4]. Got {‘name’: ‘MPPT1 voltage’, ‘unique_id’: ‘sg_mppt1_voltage’, ‘slave’: 1, ‘address’: 5010, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘V’, ‘device_class’: ‘Voltage’, ‘scale’: 0.1, ‘scan_interval’: 10} MPPT2 current: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][7]. Got {‘name’: ‘MPPT2 current’, ‘unique_id’: ‘sg_mppt2_current’, ‘slave’: 1, ‘address’: 5013, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 2, ‘unit_of_measurement’: ‘A’, ‘device_class’: ‘Current’, ‘scale’: 0.1, ‘scan_interval’: 10} MPPT2 voltage: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][6]. Got {‘name’: ‘MPPT2 voltage’, ‘unique_id’: ‘sg_mppt2_voltage’, ‘slave’: 1, ‘address’: 5012, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘V’, ‘device_class’: ‘Voltage’, ‘scale’: 0.1, ‘scan_interval’: 10} Max SoC: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][60]. Got {‘name’: ‘Max SoC’, ‘unique_id’: ‘sg_max_soc’, ‘slave’: 1, ‘address’: 13057, ‘input_type’: ‘holding’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘%’, ‘device_class’: ‘battery’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 10} Meter active power: count: 2 cannot be combined with data_type: int32 @ data[‘modbus’][0][‘sensors’][15]. Got {‘name’: ‘Meter active power’, ‘unique_id’: ‘sg_meter_active_power’, ‘slave’: 1, ‘address’: 5600, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘int32’, ‘swap’: ‘word’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Meter phase A active power: count: 2 cannot be combined with data_type: int32 @ data[‘modbus’][0][‘sensors’][16]. Got {‘name’: ‘Meter phase A active power’, ‘unique_id’: ‘sg_meter_phase_a_active_power’, ‘slave’: 1, ‘address’: 5602, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘int32’, ‘swap’: ‘word’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Meter phase B active power: count: 2 cannot be combined with data_type: int32 @ data[‘modbus’][0][‘sensors’][17]. Got {‘name’: ‘Meter phase B active power’, ‘unique_id’: ‘sg_meter_phase_b_active_power’, ‘slave’: 1, ‘address’: 5604, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘int32’, ‘swap’: ‘word’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Meter phase C active power: count: 2 cannot be combined with data_type: int32 @ data[‘modbus’][0][‘sensors’][18]. Got {‘name’: ‘Meter phase C active power’, ‘unique_id’: ‘sg_meter_phase_c_active_power’, ‘slave’: 1, ‘address’: 5606, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘int32’, ‘swap’: ‘word’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Min SoC: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][61]. Got {‘name’: ‘Min SoC’, ‘unique_id’: ‘sg_min_soc’, ‘slave’: 1, ‘address’: 13058, ‘input_type’: ‘holding’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘%’, ‘device_class’: ‘battery’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 10} Phase A current: count: 1 cannot be combined with data_type: int16 @ data[‘modbus’][0][‘sensors’][46]. Got {‘name’: ‘Phase A current’, ‘unique_id’: ‘sg_phase_a_current’, ‘slave’: 1, ‘address’: 13030, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘int16’, ‘precision’: 1, ‘unit_of_measurement’: ‘A’, ‘device_class’: ‘current’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 10} Phase A voltage: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][9]. Got {‘name’: ‘Phase A voltage’, ‘unique_id’: ‘sg_phase_a_voltage’, ‘slave’: 1, ‘address’: 5018, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘V’, ‘device_class’: ‘Voltage’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 10} Phase B current: count: 1 cannot be combined with data_type: int16 @ data[‘modbus’][0][‘sensors’][47]. Got {‘name’: ‘Phase B current’, ‘unique_id’: ‘sg_phase_b_current’, ‘slave’: 1, ‘address’: 13031, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘int16’, ‘precision’: 1, ‘unit_of_measurement’: ‘A’, ‘device_class’: ‘current’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 10} Phase B voltage: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][10]. Got {‘name’: ‘Phase B voltage’, ‘unique_id’: ‘sg_phase_b_voltage’, ‘slave’: 1, ‘address’: 5019, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘V’, ‘device_class’: ‘Voltage’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 10} Phase C current: count: 1 cannot be combined with data_type: int16 @ data[‘modbus’][0][‘sensors’][48]. Got {‘name’: ‘Phase C current’, ‘unique_id’: ‘sg_phase_c_current’, ‘slave’: 1, ‘address’: 13032, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘int16’, ‘precision’: 1, ‘unit_of_measurement’: ‘A’, ‘device_class’: ‘current’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 10} Phase C voltage: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][11]. Got {‘name’: ‘Phase C voltage’, ‘unique_id’: ‘sg_phase_c_voltage’, ‘slave’: 1, ‘address’: 5020, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 1, ‘unit_of_measurement’: ‘V’, ‘device_class’: ‘Voltage’, ‘state_class’: ‘measurement’, ‘scale’: 0.1, ‘scan_interval’: 10} Power factor: count: 1 cannot be combined with data_type: int16 @ data[‘modbus’][0][‘sensors’][14]. Got {‘name’: ‘Power factor’, ‘unique_id’: ‘sg_power_factor’, ‘slave’: 1, ‘address’: 5034, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘int16’, ‘precision’: 3, ‘unit_of_measurement’: ‘%’, ‘device_class’: ‘power_factor’, ‘state_class’: ‘measurement’, ‘scale’: 0.001, ‘scan_interval’: 10} Reactive power: count: 2 cannot be combined with data_type: int32 @ data[‘modbus’][0][‘sensors’][13]. Got {‘name’: ‘Reactive power’, ‘unique_id’: ‘sg_reactive_power’, ‘slave’: 1, ‘address’: 5032, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘int32’, ‘swap’: ‘word’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Running state: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][27]. Got {‘name’: ‘Running state’, ‘unique_id’: ‘sg_running_state’, ‘slave’: 1, ‘address’: 13000, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 0, ‘scale’: 1, ‘scan_interval’: 10} Sungrow device type code: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][0]. Got {‘name’: ‘Sungrow device type code’, ‘unique_id’: ‘sg_dev_code’, ‘slave’: 1, ‘address’: 4999, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘scan_interval’: 600} System state: count: 1 cannot be combined with data_type: uint16 @ data[‘modbus’][0][‘sensors’][26]. Got {‘name’: ‘System state’, ‘unique_id’: ‘sg_system_state’, ‘slave’: 1, ‘address’: 12999, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘uint16’, ‘precision’: 0, ‘scale’: 1, ‘scan_interval’: 10} Total DC power: count: 2 cannot be combined with data_type: uint32 @ data[‘modbus’][0][‘sensors’][8]. Got {‘name’: ‘Total DC power’, ‘unique_id’: ‘sg_total_dc_power’, ‘slave’: 1, ‘address’: 5016, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘uint32’, ‘swap’: ‘word’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Total PV generation & battery discharge: count: 2 cannot be combined with data_type: uint32 @ data[‘modbus’][0][‘sensors’][2]. Got {‘name’: ‘Total PV generation & battery discharge’, ‘unique_id’: ‘sg_total_pv_gen_battery_discharge’, ‘slave’: 1, ‘address’: 5003, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘uint32’, ‘swap’: ‘word’, ‘unit_of_measurement’: ‘kWh’, ‘precision’: 1, ‘device_class’: ‘energy’, ‘state_class’: ‘total_increasing’, ‘scale’: 0.1, ‘scan_interval’: 600} Total PV generation: count: 2 cannot be combined with data_type: uint32 @ data[‘modbus’][0][‘sensors’][29]. Got {‘name’: ‘Total PV generation’, ‘unique_id’: ‘sg_total_pv_generation’, ‘slave’: 1, ‘address’: 13002, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘uint32’, ‘swap’: ‘word’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘total_increasing’, ‘scale’: 0.1, ‘scan_interval’: 600} Total active power: count: 2 cannot be combined with data_type: int32 @ data[‘modbus’][0][‘sensors’][49]. Got {‘name’: ‘Total active power’, ‘unique_id’: ‘sg_total_active_power’, ‘slave’: 1, ‘address’: 13033, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘int32’, ‘swap’: ‘word’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Total backup power: count: 1 cannot be combined with data_type: int16 @ data[‘modbus’][0][‘sensors’][22]. Got {‘name’: ‘Total backup power’, ‘slave’: 1, ‘unique_id’: ‘sg_total_backup_power’, ‘address’: 5725, ‘input_type’: ‘input’, ‘count’: 1, ‘data_type’: ‘int16’, ‘precision’: 0, ‘unit_of_measurement’: ‘W’, ‘device_class’: ‘power’, ‘state_class’: ‘measurement’, ‘scale’: 1, ‘scan_interval’: 10} Total battery charge from PV: count: 2 cannot be combined with data_type: uint32 @ data[‘modbus’][0][‘sensors’][35]. Got {‘name’: ‘Total battery charge from PV’, ‘unique_id’: ‘sg_total_battery_charge_from_pv’, ‘slave’: 1, ‘address’: 13012, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘uint32’, ‘swap’: ‘word’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘total_increasing’, ‘scale’: 0.1, ‘scan_interval’: 600} Total battery charge: count: 2 cannot be combined with data_type: uint32 @ data[‘modbus’][0][‘sensors’][53]. Got {‘name’: ‘Total battery charge’, ‘unique_id’: ‘sg_total_battery_charge’, ‘slave’: 1, ‘address’: 13040, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘uint32’, ‘swap’: ‘word’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘total_increasing’, ‘scale’: 0.1, ‘scan_interval’: 600} Total battery discharge: count: 2 cannot be combined with data_type: uint32 @ data[‘modbus’][0][‘sensors’][45]. Got {‘name’: ‘Total battery discharge’, ‘unique_id’: ‘sg_total_battery_discharge’, ‘slave’: 1, ‘address’: 13026, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘uint32’, ‘swap’: ‘word’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘total_increasing’, ‘scale’: 0.1, ‘scan_interval’: 10} Total direct energy consumption: count: 2 cannot be combined with data_type: uint32 @ data[‘modbus’][0][‘sensors’][37]. Got {‘name’: ‘Total direct energy consumption’, ‘unique_id’: ‘sg_total_direct_energy_consumption’, ‘slave’: 1, ‘address’: 13017, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘uint32’, ‘swap’: ‘word’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘total_increasing’, ‘scale’: 0.1, ‘scan_interval’: 600} Total exported energy from PV: count: 2 cannot be combined with data_type: uint32 @ data[‘modbus’][0][‘sensors’][31]. Got {‘name’: ‘Total exported energy from PV’, ‘unique_id’: ‘sg_total_exported_energy_from_pv’, ‘slave’: 1, ‘address’: 13005, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘uint32’, ‘swap’: ‘word’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘total_increasing’, ‘scale’: 0.1, ‘scan_interval’: 600} Total exported energy: count: 2 cannot be combined with data_type: uint32 @ data[‘modbus’][0][‘sensors’][55]. Got {‘name’: ‘Total exported energy’, ‘unique_id’: ‘sg_total_exported_energy’, ‘slave’: 1, ‘address’: 13045, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘uint32’, ‘swap’: ‘word’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘total_increasing’, ‘scale’: 0.1, ‘scan_interval’: 600} Total imported energy: count: 2 cannot be combined with data_type: uint32 @ data[‘modbus’][0][‘sensors’][51]. Got {‘name’: ‘Total imported energy’, ‘unique_id’: ‘sg_total_imported_energy’, ‘slave’: 1, ‘address’: 13036, ‘input_type’: ‘input’, ‘count’: 2, ‘data_type’: ‘uint32’, ‘swap’: ‘word’, ‘precision’: 1, ‘unit_of_measurement’: ‘kWh’, ‘device_class’: ‘energy’, ‘state_class’: ‘total_increasing’, ‘scale’: 0.1, ‘scan_interval’: 600}. (See ?, line ?). Please check the docs at https://www.home-assistant.io/integrations/modbus

What version of Home Assistant Core has the issue?

core-2023.10.0

What was the last working version of Home Assistant Core?

core-2023.9.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

modbus

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 5
  • Comments: 79 (33 by maintainers)

Most upvoted comments

I solved this by editing the configuration, removing the count:... lines where the data type was int16 or uint16 or int32 or uint32.

This is announced breaking change, please read the log and update the configuration.

The modbus integration broke my installation 2 times in the last 2 months; both times by introducing a more pedantic config parser. This is ok for me, I understand it, being a developer myself. But wouldn’t it be better to issue a deprecation notification on startup or whatever to give people time to prepare for such changes, instead of letting the integration crash?

The integration does not crash, it issues a log message telling exactly what is wrong.

There are a couple of other config changes, where keywords are deprecated, these generates an issue, and in 2024.4 will no longer be accepted.

Problem solved. Please remove count=## lines from the modbus config part of configuration.yaml because now count is only valid for data_type: custom and data_type: string and is invalid for all other data types like int16, uint16 etc.

And many users, for the same reason, do not update their system!

Nobody forces you to update your system, but when you do it is fair to expect that you read the release logs.

Breaking changes only happens in the monthly release! please read the HA release policy.

I did. But the only change mentioned was about close_comm_on_error. Screenshot_2023-10-05-13-31-42-101_com android chrome

Where was this announced? The docs for 2923.10 only say something about close_comm_on_error.

Regarding "I’m using a Smart Meter from a Portuguese Energy Company. I cannot believe that these devices are using MODBUS on an unsupported / out of scope.“

As a developer, I can tell you that there are many devices from big companies whose software does not correctly implement some specification. Which doesn’t necessarily mean this is the case with your device.

I agree with Jan’s direction to support the standard only. Keep in mind that it is impossible for the developers to test with devices which are not spec-compliant.

So the way you should go is: As a short-term solution, downgrade to the previous version. Then either create a PR which introduces something like a configurable register_size_in_bytes with a default of 2 (and a different value for your device), or create a custom integration. Anyway, this means you have to start participating in the development or find someone who can do this for you.

@BrunoN17 You asked why you had the error “8 bytes received but 4 expected” independent of count, and you got the response that 8 bytes is INT64, which is correct.

The problem you have is that your device delivers: count * 4 bytes, where the standard says it should deliver: count * 2 bytes

I have never said you used a shady device, I do not know your device, but fact is that it is NOT following parts of the modbus standard.

If you or others can show where the standard modbus allows registers to be 16 or 32 bit, it will be supported !

You and others have used a bug in the integration to solve your problem, now this bug is fixed, which is good news for all users with devices that follow the modbus standard.

I have already made 3 suggestions and acknowledged a third one:

  • define the sensor as “datatype: string”, and manipulate the string in an automation or similar
  • use an older version of the integration as a custom component, which would work at least for now, but you will not get updated, and there might be a problem when we update the pymodbus (the library) in the future
  • have a developer make a pull request that allows non-standard protocol, but in a way that it does not endanger the correct usage (see earlier messages)
  • someone suggested define the sensor as “datatype: custom”, that might work but I cannot confirm it.

You want to use the modbus integration for something it was not meant to support, so please do not keep blaming me for making it impossible by fixing a bug for the correct usage.

I still can’t find this in the release notes of HA. Can you point to it?

And if you knew that many users would have to change their config, then by definition this was a breaking change and it should have been announced as such. Maybe next time…

Anyway, now this has forced everyone to clean up the config (and to understand the config partially). So the positive takeaway is that we learned something and the config is cleaner now.

While we obviously don’t agree on this topic, I appreciate your good work generally.

It was mentioned in the changelog, which is part of the release notes, it was not mentioned as a breaking change because the parameters are still available and have their use. To me this was not “shit happens” it was a change that was needed.

count: 1, uint16 is in reality not a problem and I agree it can be considered redundant. BUT count:1, uint32 is a problem…and this is the reason why we removed it, and at the same time the reason why some using non-standard devices want to keep it. You need to see this issue combined with “slave_count”, which adds a factor of complexity. Think of:

   slave_count: 2
  count: 1
  datatype: UINT32

here the older releases expected to receive 4 bytes (1 register pr sensor), each sensor got half of the 32bit, which contradict the datatype.

versus

   slave_count: 2
  count: 2
  datatype: UINT32

here the older releases expected to receive 8 bytes, each sensor being 32bit, so all OK.

How should we interpret:

   count: 2
  datatype: UNIT16

Should we expect 4 bytes or 2 bytes?

The complexity of the possibilities and to determine what the configuration was expected to do was not maintainable.

As I announced a couple of releases back, we are in the process of making bigger changes in the modbus integration, and for that reason there will be changes over the coming months. Making the configuration more “pedantic” is not because we have fun, but actually to solve problems and remove double meanings and that way pave the way for a less complex configuration.

We actually changed the wording of the log and issues texts during the review process, to ensure they were easy to understand, but we were aware that a lot of configurations needed to be changed.

Nobody forces you to update your system, but when you do it is fair to expect that you read the release logs.

Yes, but the point is, this is not included in the breaking changes list! This should not happen, ever.

Same problem with me as well after upgrading to 2023.10

Personally I did not understand that the upgrade to 2023.10 would entail such issues. The work done on the modbus by Janiversen is really amazing and a huge asset to HA. That being said, and given that most users of HA are not modbus experts (or even IT professionals), it would be advisable that any such breaking changes be communicated more clearly in the future, especially given that they may affect core functions such as HVAC. Once again many thanks for the amazing work.

PS: the future development should ideally taken into account the reality that many systems do not fully comply with the modbus standard…

if it is data_type: custom then it shouldnt have those check test, dont know how anyone will pass jan tests it seems to me that he dont want that and the concept of custom is way off

It seems to me that the data_type: custom should allow users to define datatype: UINT32 together with count: 1 like the name says data_type: custom, then it should overwrite the check sense is a custom and people use it at there risk, there is alot companys that dont follow the standarts and instead of divide the comunity it should have a option to solve the problem and keep the community together

No problem, and no there are no specific discord channel, problem is I would for a large part be discussing with myself 😀

The pymodbus project have “discussions” where we sometimes discuss HA issues as well as how the main modbus development progresses.

Because it is not a breaking change ! it is solving problems due to an illegal configuration! It is in the release notes.

Yes, count is calculated… UINT32 is 4 bytes, so count is set to 2 (each register is 2bytes pr definition)… (UINT16 is 2 bytes, with count 1).

I have exactly the same problem 😬😢

Same issue on my side after update to 2023.10, restored to 2023.9.3

I have the same problem, updated and broke modbus, this happened on last month’s update as well.