After update to 2022.4.0 -> Modbus Problem

Hello !

I have implemented my E3DC photovoltaik battery by modbus sensors. Now, after the update yesterday, I end up with following error in the log and all my sensors do not deliver any results anymore:

Logger: homeassistant.config
Source: config.py:454
First occurred: 11:29:51 (1 occurrences)
Last logged: 11:29:51

Invalid config for [modbus]: value must be one of [<DataType.CUSTOM: ‘custom’>, <DataType.FLOAT16: ‘float16’>, <DataType.FLOAT32: ‘float32’>, <DataType.FLOAT64: ‘float64’>, <DataType.INT16: ‘int16’>, <DataType.INT32: ‘int32’>, <DataType.INT64: ‘int64’>, <DataType.INT8: ‘int8’>, <DataType.STRING: ‘string’>, <DataType.STRING: ‘string’>, <DataType.UINT16: ‘uint16’>, <DataType.UINT32: ‘uint32’>, <DataType.UINT64: ‘uint64’>, <DataType.UINT8: ‘uint8’>] for dictionary value @ data[‘modbus’][0][‘sensors’][7][‘data_type’]. Got ‘uint’. (See /config/configuration.yaml, line 12). Please check the docs at Modbus - Home Assistant

I don’t understand why and how… Can somebody help ?

also i same problem, i can’t figure out where the error is

Ok, I solved it by replacing int with int32, float with float32 etc …

2 Likes

Please see the breaking changes:
image
Maybe you still use one of them…

Yes, I use plenty of int or uint in my config files. Replaced all of them to int32 and uint32, like allesandro mentioned before, but it did not change anything, still having error messages in the config tester:

nvalid config for [binary_sensor.template]: invalid template (TemplateAssertionError: No filter named ‘int32’.) for dictionary value @ data[‘sensors’][‘e3dc_battery_loading_blocked’][‘value_template’]. Got “{{ states(‘sensor.e3dc_ems_state’)|int32|bitwise_and(1) > 0 }}”
invalid template (TemplateAssertionError: No filter named ‘int32’.) for dictionary value @ data[‘sensors’][‘e3dc_battery_unloading_blocked’][‘value_template’]. Got “{{ states(‘sensor.e3dc_ems_state’)|int32|bitwise_and(2) > 0 }}”
invalid template (TemplateAssertionError: No filter named ‘int32’.) for dictionary value @ data[‘sensors’][‘e3dc_emergency_power_available’][‘value_template’]. Got “{{ states(‘sensor.e3dc_ems_state’)|int32|bitwise_and(4) > 0 }}”
invalid template (TemplateAssertionError: No filter named ‘int32’.) for dictionary value @ data[‘sensors’][‘e3dc_power_limiter’][‘value_template’]. Got “{{ states(‘sensor.e3dc_ems_state’)|int32|bitwise_and(16) > 0 }}”
invalid template (TemplateAssertionError: No filter named ‘int32’.) for dictionary value @ data[‘sensors’][‘e3dc_smartcharge_loading_blocked’][‘value_template’]. Got “{{ states(‘sensor.e3dc_ems_state’)|int32|bitwise_and(32) > 0 }}”
invalid template (TemplateAssertionError: No filter named ‘int32’.) for dictionary value @ data[‘sensors’][‘e3dc_smartcharge_unloading_blocked’][‘value_template’]. Got “{{ states(‘sensor.e3dc_ems_state’)|int32|bitwise_and(64) > 0 }}”
invalid template (TemplateAssertionError: No filter named ‘int32’.) for dictionary value @ data[‘sensors’][‘e3dc_weather_based_loading’][‘value_template’]. Got “{{ states(‘sensor.e3dc_ems_state’)|int32|bitwise_and(8) > 0 }}”. (See ?, line ?).
Invalid config for [modbus]: value must be one of [<DataType.CUSTOM: ‘custom’>, <DataType.FLOAT16: ‘float16’>, <DataType.FLOAT32: ‘float32’>, <DataType.FLOAT64: ‘float64’>, <DataType.INT16: ‘int16’>, <DataType.INT32: ‘int32’>, <DataType.INT64: ‘int64’>, <DataType.INT8: ‘int8’>, <DataType.STRING: ‘string’>, <DataType.STRING: ‘string’>, <DataType.UINT16: ‘uint16’>, <DataType.UINT32: ‘uint32’>, <DataType.UINT64: ‘uint64’>, <DataType.UINT8: ‘uint8’>] for dictionary value @ data[‘modbus’][0][‘sensors’][7][‘data_type’]. Got ‘uint’. (See /config/configuration.yaml, line 12).
Invalid config for [sensor.template]: invalid template (TemplateAssertionError: No filter named ‘int32’.) for dictionary value @ data[‘sensors’][‘e3dc_autarky’][‘value_template’]. Got “{{ (states(‘sensor.e3dc_autarky_and_consumption’)|int32 / 256)|round(0,‘floor’) }}”
invalid template (TemplateAssertionError: No filter named ‘int32’.) for dictionary value @ data[‘sensors’][‘e3dc_own_consumption’][‘value_template’]. Got “{{ ((states(‘sensor.e3dc_autarky_and_consumption’)|int32 / 256 - states(‘sensor.e3dc_autarkie’)|int32) * 256)|round(0,‘floor’) }}”. (See ?, line ?).
Invalid config for [sensor.template]: invalid template (TemplateAssertionError: No filter named ‘int32’.) for dictionary value @ data[‘sensors’][‘e3dc_autarky’][‘value_template’]. Got “{{ (states(‘sensor.e3dc_autarky_and_consumption’)|int32 / 256)|round(0,‘floor’) }}”
invalid template (TemplateAssertionError: No filter named ‘int32’.) for dictionary value @ data[‘sensors’][‘e3dc_own_consumption’][‘value_template’]. Got “{{ ((states(‘sensor.e3dc_autarky_and_consumption’)|int32 / 256 - states(‘sensor.e3dc_autarkie’)|int32) * 256)|round(0,‘floor’) }}”. (See ?, line ?).

Sorry, but I really don’t understand any of that… Any chance to solve that or if not: how to revert back to the previous version of Home Assistant ?

Thanks, i had the same issue :slight_smile:

I do not get an error by making that change, it will depend on something else that I cannot find

The change is only in the modbus integration, as noted in the breaking changes. There you change from int to int16 or int32.

Now you get errors from your templates. The int16 from modbus has nothing to do with the int() filter of templates. So, change your templates back to int() and your errors should be gone.

Ok, thank you very much, this last advise made things clear and now it is working again !! :slight_smile:

Hi i’m new to home assistant and had readings from my SMA tripower true modbus everything worked fine but after update 2022.4.7 it stopt working ?
Can anybody please advice me ?