core
core copied to clipboard
Modbus - swap option not working
The problem
After several check of reading "uint32" with modbus and trying the option SWAP: word , it appears that adding option: swap : word has no effect. Is it implemented ?
=> To be implemented (i hope) or documentation to be corrected Workaround: Using template sensor and swapping HIGH and LOW word
What version of Home Assistant Core has the issue?
Home Assistant 2022.10.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
- name: RS485 total power sell TEST
scan_interval: 30
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
slave: 1
address: 0x021E
count: 2
input_type: holding
data_type: uint32
scale: 1
swap: none
has same effect ( nothing) than
- name: RS485 total power sell TEST
scan_interval: 30
unit_of_measurement: kWh
device_class: energy
state_class: total_increasing
slave: 1
address: 0x021E
count: 2
input_type: holding
data_type: uint32
scale: 1
swap: word
Anything in the logs that might be useful for us?
no warning in log
Additional information
Home Assistant 2022.10.4 Supervisor 2022.10.0 Operating System 9.2 Interface utilisateur : 20221010.0 - latest
Hey there @adamchengtkc, @janiversen, @vzahradnik, 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!
(message by CodeOwnersMention)
modbus documentation modbus source (message by IssueLinks)
Yes it is implemented and part of the test suite, but let me try to simulate your configuration.
What type of sensor are you using ? It is a bit hard to guess because your yaml starts with "- name".
Please have a look at #82308, there we added a test "test_wrap_sensor· where all combinations of wrap are tested and show that wrap is implemented and working.
If you still find it is not working, please run your test with debug log, and provide some logging in your app, that shows the problem.