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

Problems with Modbus after update to core 2023.10.0 #101437

Closed
schlakko opened this issue Oct 5, 2023 · 14 comments
Closed

Problems with Modbus after update to core 2023.10.0 #101437

schlakko opened this issue Oct 5, 2023 · 14 comments
Assignees

Comments

@schlakko
Copy link

schlakko commented Oct 5, 2023

The problem

Hello Together,

I am experiencing problems with the Modbus to the KOSTAL KSEM, after updating from 2023.9.3 to 2023.10.0.
Sorry, but a download of the diagnostic data is not available because I already restored the 2023.9.3 backup.

Here the messages I got:

Setup failed for modbus: Invalid config.
04:48:13 – (FEHLER) setup.py
Invalid config for [modbus]: netzbezug_energie_ksem: count: 4 cannot be combined with data_type: uint64 @ data['modbus'][0]['sensors'][2]. Got {'name': 'netzbezug_energie_ksem', 'slave': 1, 'scale': 0.0001, 'precision': 3, 'address': 512, 'scan_interval': 60, 'count': 4, 'input_type': 'holding', 'data_type': 'uint64', 'device_class': 'energy', 'state_class': 'total_increasing', 'unit_of_measurement': 'kWh'} netzbezug_leistung_ksem: count: 2 cannot be combined with data_type: uint32 @ data['modbus'][0]['sensors'][0]. Got {'name': 'netzbezug_leistung_ksem', 'slave': 1, 'device_class': 'power', 'state_class': 'measurement', 'unit_of_measurement': 'W', 'scale': 0.1, 'address': 0, 'scan_interval': 10, 'count': 2, 'input_type': 'holding', 'data_type': 'uint32'} netzeinspeisung_energie_ksem: count: 4 cannot be combined with data_type: uint64 @ data['modbus'][0]['sensors'][3]. Got {'name': 'netzeinspeisung_energie_ksem', 'slave': 1, 'scale': 0.0001, 'precision': 3, 'address': 516, 'scan_interval': 60, 'count': 4, 'input_type': 'holding', 'data_type': 'uint64', 'device_class': 'energy', 'state_class': 'total_increasing', 'unit_of_measurement': 'kWh'} netzeinspeisung_leistung_ksem: count: 2 cannot be combined with data_type: uint32 @ data['modbus'][0]['sensors'][1]. Got {'name': 'netzeinspeisung_leistung_ksem', 'slave': 1, 'device_class': 'power', 'state_class': 'measurement', 'unit_of_measurement': 'W', 'scale': 0.1, 'address': 2, 'scan_interval': 10, 'count': 2, 'input_type': 'holding', 'data_type': 'uint32'}. (See /config/configuration.yaml, line 40). Please check the docs at https://www.home-assistant.io/integrations/modbus
04:48:13 – (FEHLER) config.

Thanks in advance for any help to fix the issue.

Regards

What version of Home Assistant Core has the issue?

2023.10.0

What was the last working version of Home Assistant Core?

2023.9.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

KOSTAL KSEM

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

modbus:
  - name: KSEM 
    type: tcp
    host: xxx.xxx.xxx.xxx
    port: 502
    sensors:
    - name: netzbezug_leistung_ksem
      slave: 1
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      scale: 0.1
      address: 0
      scan_interval: 10 # Defines the update interval of the sensor in seconds.
      count: 2 # Anzahl zu lesenden Register
      input_type: holding
      data_type: uint32

    - name: netzeinspeisung_leistung_ksem
      slave: 1
      device_class: power
      state_class: measurement
      unit_of_measurement: W
      scale: 0.1
      address: 2
      scan_interval: 10 # Defines the update interval of the sensor in seconds.
      count: 2 # Anzahl zu lesenden Register
      input_type: holding
      data_type: uint32

    - name: netzbezug_energie_ksem
      slave: 1
      scale: 0.0001 # wegen kWh (0.1/1000)
      precision: 3
      address: 512
      scan_interval: 60 # Defines the update interval of the sensor in seconds.
      count: 4 # Anzahl zu lesenden Register
      input_type: holding
      data_type: uint64
      device_class: energy
      state_class: total_increasing
      unit_of_measurement: kWh

    - name: netzeinspeisung_energie_ksem
      slave: 1
      scale: 0.0001 # wegen kWh (0.1/1000)
      precision: 3
      address: 516
      scan_interval: 60 # Defines the update interval of the sensor in seconds.
      count: 4 # Anzahl zu lesenden Register
      input_type: holding
      data_type: uint64
      device_class: energy

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Oct 5, 2023

Hey there @janiversen, mind taking a look at this issue as it has been labeled with an integration (modbus) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of modbus can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign modbus Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


modbus documentation
modbus source
(message by IssueLinks)

@austriac1214
Copy link

Exactly same error and messages with modbus values from SMA power inverter after HA core update from 2023.9.3 to 2023.10.0.

@alsFC
Copy link

alsFC commented Oct 5, 2023

count is not allowed for numeric values anymore, only for cutom or string.

@hostrup
Copy link

hostrup commented Oct 5, 2023

Hi! I got the same error for reading my Kamstrup energy meter via a smart-me interface. I simply removed the "count" as this is now autmatically calculated. And it works again.

@janiversen
Copy link
Member

this is announced breaking change!

please read the log
"count: 4 cannot be combined with data_type: uint64" it says what is wrong, please correct it.

This is not a bug.

@janiversen janiversen closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2023
@schlakko
Copy link
Author

schlakko commented Oct 5, 2023

count is not allowed for numeric values anymore, only for cutom or string.

Thanks for the fast response. Will delete the “count” tonight.

@janiversen
Copy link
Member

To all having problems with the configuration, please read the documentation, especially:
https://www.home-assistant.io/integrations/modbus/#parameters-usage-matrix

The latter shows clearly which parameters combinations are allowed.

@34by151
Copy link

34by151 commented Oct 5, 2023

Jan,
Thanks for pointing us at the useage matrix
I missed that

After reading that, am I correct that I need to change

count: 2
data_type: float32

To
slave_count: 2
data_type: float32

@Blakout007
Copy link

Hi! I got the same error for reading my Kamstrup energy meter via a smart-me interface. I simply removed the "count" as this is now autmatically calculated. And it works again.

Thanks. I also got this error in my 'Dantherm' modbus config, but have used the same approach with removing all count-lines. Tomorrow I will see if everything works as usual.

@austriac1214
Copy link

Many thanks for the quick hints!!!
I did read the breaking changes regarding Modbus, but I did not combine that the corresponding entries in the configuration have to be deleted. Mea culpa.
I removed the "count" and now all modbus values are available again : -)

@HynXXXX
Copy link

HynXXXX commented Oct 8, 2023

#101437 (comment)

Jan, Thanks for pointing us at the useage matrix I missed that

After reading that, am I correct that I need to change

count: 2 data_type: float32

To slave_count: 2 data_type: float32

Thank You very much, its working ;-)

@janiversen
Copy link
Member

I assume you want 2 sensors and not 1 as you had earlier. Slave_count have quite a different functionality than count, just read the documentation.

@HynXXXX
Copy link

HynXXXX commented Oct 8, 2023

I assume you want 2 sensors and not 1 as you had earlier. Slave_count have quite a different functionality than count, just read the documentation.

Yes. You are right. My fault. I only changed count to slave_count without inspecting the result in HA.

@operatorian
Copy link

Many thanks. Thats it.

count >>> slave_count

:-)

@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants