Last active
February 4, 2024 10:57
-
-
Save steveneaston/2c59e19eb736f6eba82214e94c158f02 to your computer and use it in GitHub Desktop.
Samsung ASHP Modbus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esphome: | |
name: "esp-ashp" | |
on_boot: | |
priority: -100 | |
then: | |
- lambda: |- | |
esphome::modbus_controller::ModbusController *controller = id(ashp_modbus); | |
std::vector<uint16_t> outdoor_registers = { | |
0x8238, // Compressor frequency | |
0x8204, // Outdoor temperature | |
}; | |
esphome::modbus_controller::ModbusCommandItem register_hidden_outdoor_functions = | |
esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller, 6000, outdoor_registers.size() , | |
outdoor_registers); | |
std::vector<uint16_t> indoor_registers = { | |
0x4087, // Immersion | |
0x406C, // Backup heater | |
0x42E9, // Water flow | |
0x42F1, // Compressor ratio | |
0x4067, // Three-way valve position | |
}; | |
esphome::modbus_controller::ModbusCommandItem register_hidden_indoor_functions = | |
esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller, 7003, indoor_registers.size() , | |
indoor_registers); | |
controller->queue_command(register_hidden_outdoor_functions); | |
delay(200); | |
controller->queue_command(register_hidden_indoor_functions); | |
ESP_LOGI("ModbusLambda", "Set hidden Modbus functions"); | |
esp32: | |
board: esp32dev | |
framework: | |
type: arduino | |
# Enable logging | |
logger: | |
# Enable Home Assistant API | |
api: | |
ota: | |
wifi: | |
ssid: !secret wifi_ssid | |
password: !secret wifi_password | |
captive_portal: | |
uart: | |
id: mod_bus | |
tx_pin: 17 | |
rx_pin: 16 | |
baud_rate: 9600 | |
data_bits: 8 | |
stop_bits: 1 | |
parity: EVEN | |
modbus: | |
id: ashp | |
send_wait_time: 200ms | |
modbus_controller: | |
- id: ashp_modbus | |
address: 0x1 | |
modbus_id: ashp | |
setup_priority: -10 | |
update_interval: 5s | |
sensor: | |
# == DHW == | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "DHW Status" | |
id: dhw_status | |
register_type: holding | |
address: 72 | |
value_type: U_WORD | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "DHW Mode" | |
id: dhw_mode | |
register_type: holding | |
address: 73 | |
value_type: U_WORD | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "DHW Target Temperature" | |
id: dhw_target_temperature | |
register_type: holding | |
address: 74 | |
unit_of_measurement: "ºC" | |
device_class: "temperature" | |
value_type: U_WORD | |
accuracy_decimals: 1 | |
filters: | |
- multiply: 0.1 | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "DHW Temperature" | |
id: dhw_temperature | |
register_type: holding | |
address: 75 | |
unit_of_measurement: "ºC" | |
device_class: "temperature" | |
value_type: U_WORD | |
accuracy_decimals: 1 | |
filters: | |
- multiply: 0.1 | |
# == Flow == | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "Return Temperature" | |
id: return_temperature | |
register_type: holding | |
address: 65 | |
unit_of_measurement: "ºC" | |
device_class: "temperature" | |
value_type: U_WORD | |
accuracy_decimals: 1 | |
filters: | |
- multiply: 0.1 | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "Flow Temperature" | |
id: flow_temperature | |
register_type: holding | |
address: 66 | |
unit_of_measurement: "ºC" | |
device_class: "temperature" | |
value_type: U_WORD | |
accuracy_decimals: 1 | |
filters: | |
- multiply: 0.1 | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "Target Flow Temperature" | |
id: target_flow_temperature | |
register_type: holding | |
address: 68 | |
unit_of_measurement: "ºC" | |
device_class: "temperature" | |
value_type: U_WORD | |
accuracy_decimals: 1 | |
filters: | |
- multiply: 0.1 | |
# == Hidden == | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "Compressor Frequency" | |
id: compressor_frequency | |
register_type: holding | |
address: 4 | |
unit_of_measurement: "Hz" | |
icon: "mdi:sine-wave" | |
value_type: U_WORD | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "Outdoor Temperature" | |
id: outdoor_temperature | |
register_type: holding | |
address: 5 | |
unit_of_measurement: "ºC" | |
device_class: "temperature" | |
value_type: S_WORD | |
accuracy_decimals: 1 | |
filters: | |
- multiply: 0.1 | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "Flow Rate" | |
id: flow_rate | |
register_type: holding | |
address: 87 | |
unit_of_measurement: "lpm" | |
icon: "mdi:pipe" | |
value_type: U_WORD | |
accuracy_decimals: 1 | |
filters: | |
- multiply: 0.1 | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "Threeway Valve Position" | |
id: threeway_vale | |
register_type: holding | |
icon: "mdi:valve" | |
address: 89 | |
value_type: U_WORD | |
# == Debug == | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "Communication Status" | |
id: comm_status | |
register_type: holding | |
address: 50 | |
value_type: U_WORD | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "Error Code" | |
id: error_code | |
register_type: holding | |
address: 63 | |
value_type: U_WORD | |
binary_sensor: | |
# == Status == | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "CH Status" | |
id: ch_status | |
register_type: holding | |
address: 52 | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "Away Status" | |
id: away_status | |
register_type: holding | |
address: 79 | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "Defrost Status" | |
id: defrost_status | |
register_type: holding | |
address: 2 | |
filters: | |
- lambda: |- | |
if ((id(defrost_status).state == 255) or (id(defrost_status).state == 0)) { | |
return false; | |
} else { | |
return true; | |
} | |
- platform: modbus_controller | |
modbus_controller_id: ashp_modbus | |
name: "Quiet Status" | |
id: quiet_status | |
register_type: holding | |
address: 78 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment