From 6a6a0fe5ab967a858c472bfbc4f69a0e916099a4 Mon Sep 17 00:00:00 2001 From: CrazyUs3r <91020381+CrazyUs3r@users.noreply.github.com> Date: Thu, 4 Jul 2024 17:42:21 +0200 Subject: [PATCH] Update services.yaml update read and write --- custom_components/solarman/services.yaml | 96 ++++++++++++++++++++++-- 1 file changed, 89 insertions(+), 7 deletions(-) diff --git a/custom_components/solarman/services.yaml b/custom_components/solarman/services.yaml index 4da52f2a..9e22bad0 100644 --- a/custom_components/solarman/services.yaml +++ b/custom_components/solarman/services.yaml @@ -1,8 +1,77 @@ +read_holding_register: + name: Read Holding Register (Modbus Function Code 3) + description: Read a single register value + + fields: + device: + name: Device + description: The Device + example: "inverter_roof" + required: true + selector: + device: + filter: + - integration: solarman + register: + name: Register + description: Modbus register address + example: "16384" + required: true + selector: + number: + min: 0 + max: 65535 + mode: box + +read_multiple_holding_registers: + name: Read Multiple Holding Registers (Modbus Function Code 3) + description: Read values from multiple consecutive registers at once. + + fields: + device: + name: Device + description: The Device + example: "inverter_roof" + required: true + selector: + device: + filter: + - integration: solarman + register: + name: Register + description: Modbus register address + example: "16384" + required: true + selector: + number: + min: 0 + max: 65535 + mode: box + count: + name: Count + description: Count of registers to read + example: "4" + required: true + selector: + number: + min: 1 + max: 65535 + mode: box + write_holding_register: name: Write Holding Register (Modbus Function Code 6) - description: NOTE USE WITH CARE! + description: NOTE USE WITH CARE! (Some devices might not accept Code 6 in this case try to use 'Write Multiple Holding Registers') fields: + device: + name: Device + description: The Device + example: "inverter_roof" + required: true + selector: + device: + filter: + - integration: solarman register: name: Register description: Modbus register address @@ -11,9 +80,8 @@ write_holding_register: selector: number: min: 0 - max: 65535 + max: 65535 mode: box - value: name: Values description: Value to write @@ -25,9 +93,18 @@ write_holding_register: write_multiple_holding_registers: name: Write Multiple Holding Registers (Modbus Function Code 16) - description: NOTE USE WITH CARE! + description: NOTE USE WITH CARE! (Some devices might not accept Code 16 in this case try to use 'Write Holding Register') fields: + device: + name: Device + description: The Device + example: "inverter_roof" + required: true + selector: + device: + filter: + - integration: solarman register: name: Register description: Modbus register address @@ -36,9 +113,8 @@ write_multiple_holding_registers: selector: number: min: 0 - max: 65535 + max: 65535 mode: box - values: name: Values description: Values to write @@ -48,4 +124,10 @@ write_multiple_holding_registers: - 3 required: true selector: - object: + number: + min: 0 + max: 65535 + mode: box + object: + +