Skip to content

Writing to Modbus registers stopped working #94149

@duan-dt

Description

@duan-dt

The problem

At some point of time (unsure if this was due to an update), writing to a modbus register stopped working for me. I don't use it (writing) often, however for the past week or so I have been trying to write to a modbus register with no success. Writing to the register does not fail or produce an error, it just does not update the register with the new value. I have no problem reading modbus registers and have been able to do so continuously for months already.

I tried different HA installations: HA Supervised, HA OS, different hardware, e.g. Odroid XU4, two different Generic X86-64 machines. The device (a Growatt SPF 5000 ES inverter) is connected via an onboard usb-to-serial device (the underlying chipset is Silicon Lab CP210x).

image

What version of Home Assistant Core has the issue?

2023.5.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

Modbus

Link to integration documentation on our website

https://www.home-assistant.io/integrations/modbus/

Diagnostics information

home-assistant_2023-06-07T09-47-19.107Z.log

Example YAML snippet

odbus:
  - name: Left_Inverter
    type: serial
    port: /dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_789195d4659cec11b292654d73138bba-if00-port0
    baudrate: 9600
    bytesize: 8
    method: rtu
    parity: N
    stopbits: 1
    delay:  3
    retry_on_empty: true
    # retries: 10
    # close_comm_on_error: true
    message_wait_milliseconds: 1000
    #timeout: 5
    sensors:

      - name: Output source config (Left-Inverter)
        scan_interval: 5
        address: 1
        slave: 1
        input_type: holding
        data_type: int16
        scale: 1
        offset: 0
        precision: 0
        unique_id:  Left_Inverter.OutputSourceConfig
      - name: Charging source config (Left-Inverter)
        scan_interval: 5
        address: 2
        slave: 1
        input_type: holding
        data_type: int16
        scale: 1
        offset: 0
        precision: 0
        unique_id:  Left_Inverter.ChargingSourceConfig        

#Snippet of automation / Service call through Developer Tools
service: modbus.write_register
data:
  hub: Left_Inverter
  address: 1
  slave: 1
  value: [2,0]

Anything in the logs that might be useful for us?

No error messages that I could see...

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions