Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions rdtech-controller-c3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,15 @@ text_sensor:
- 60065 -> RD6006P
- 60121 -> RD6012
- 60181 -> RD6018
# Single source of truth for regulation mode; published from cv_mode binary
# sensor (see binary_sensor: section). Use this in lieu of the legacy
# "Constant Voltage" / "Constant Current" binary sensors which are kept for
# backward compatibility but represent the same underlying bit.
- platform: template
id: regulation_mode
name: "Regulation Mode"
icon: "mdi:tune-variant"
update_interval: never

binary_sensor:
- platform: modbus_controller
Expand Down Expand Up @@ -370,14 +379,23 @@ binary_sensor:
address: 16
register_type: holding
bitmask: 0x2
# Note: "Constant Voltage" and "Constant Current" below are kept for
# backward compatibility. They derive from the same bit and are tautologically
# opposite. Prefer the "Regulation Mode" text_sensor (above in text_sensor:)
# which exposes the mode as "CV" / "CC" directly.
- platform: modbus_controller
id: cv_mode
modbus_controller_id: powersupply
name: "Constant Voltage"
address: 17
register_type: holding
bitmask: 0x1
filters:
- invert:
on_state:
then:
- lambda: |-
id(regulation_mode).publish_state(x ? "CV" : "CC");
- platform: modbus_controller
modbus_controller_id: powersupply
name: "Constant Current"
Expand Down
18 changes: 18 additions & 0 deletions rdtech-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,15 @@ text_sensor:
- 60065 -> RD6006P
- 60121 -> RD6012
- 60181 -> RD6018
# Single source of truth for regulation mode; published from cv_mode binary
# sensor (see binary_sensor: section). Use this in lieu of the legacy
# "Constant Voltage" / "Constant Current" binary sensors which are kept for
# backward compatibility but represent the same underlying bit.
- platform: template
id: regulation_mode
name: "Regulation Mode"
icon: "mdi:tune-variant"
update_interval: never

binary_sensor:
- platform: modbus_controller
Expand Down Expand Up @@ -368,14 +377,23 @@ binary_sensor:
address: 16
register_type: holding
bitmask: 0x2
# Note: "Constant Voltage" and "Constant Current" below are kept for
# backward compatibility. They derive from the same bit and are tautologically
# opposite. Prefer the "Regulation Mode" text_sensor (above in text_sensor:)
# which exposes the mode as "CV" / "CC" directly.
- platform: modbus_controller
id: cv_mode
modbus_controller_id: powersupply
name: "Constant Voltage"
address: 17
register_type: holding
bitmask: 0x1
filters:
- invert:
on_state:
then:
- lambda: |-
id(regulation_mode).publish_state(x ? "CV" : "CC");
- platform: modbus_controller
modbus_controller_id: powersupply
name: "Constant Current"
Expand Down