Hi @del13r no problem at all… I’ve excluded all the regular ESP home stuff and just have the Paladin specific stuff…
# Enable time component to reset at midnight
time:
- platform: sntp
id: my_time
uart:
id: uart_bus
tx_pin: 1
rx_pin: 3
baud_rate: 57600
debug:
direction: RX
dummy_receiver: true
after:
delimiter: "\r\n"
sequence:
- lambda: |-
UARTDebug::log_string(direction, bytes); //Still log the data
float sensors_values[20] = {0}; //array to hold the converted float values
//Example to convert uart text to string
std::string str(bytes.begin(), bytes.end());
//watch for potential problems with non printable or special characters in string
id(paladin_rawstring).publish_state(str.c_str());
if (sscanf(str.c_str(), "%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f", &sensors_values[0], &sensors_values[1], &sensors_values[2], &sensors_values[3], &sensors_values[4], &sensors_values[5], &sensors_values[6], &sensors_values[7], &sensors_values[8], &sensors_values[9], &sensors_values[10], &sensors_values[11], &sensors_values[12], &sensors_values[13], &sensors_values[14], &sensors_values[15], &sensors_values[16], &sensors_values[17], &sensors_values[18], &sensors_values[19]) == 20 ) {
// 1 = Mains Watts Now (-ve = Grid In)
// 2 = Transfer Watts Now
// 3 = Solar Watts Now
// 4 = Hot Water Temp
// 5 = Delta Temp
// 6 = Min temp Set
// 7 = Max Temp Set
// 8 = Total Mains IN (all Watt Hrs below)
// 9 = Total Mains OUT
// 10 = Total Transfer
// 11 = Total TopUp
// 12 = Total Solar
// 13 = Hours to Health Top Up
// 14 = Inverter Active Flag
// 15 = Charger Active Flag
// 16 = Force Export Flag
// 17 = Export Active
// 18 = Import Active
// 19 = Overflow
// 20 = ESP Time
// Array numbering starts at [0] for the first value
id(paladin_mainswattsnow).publish_state(sensors_values[0]);
id(paladin_transferwattsnow).publish_state(sensors_values[1]);
id(paladin_solarwattsnow).publish_state(sensors_values[2]);
id(paladin_tanktemp).publish_state(sensors_values[3]);
id(paladin_deltatemp).publish_state(sensors_values[4]);
id(paladin_mintempset).publish_state(sensors_values[5]);
id(paladin_maxtempset).publish_state(sensors_values[6]);
id(paladin_totalmainsin).publish_state(sensors_values[7]);
id(paladin_totalmainsout).publish_state(sensors_values[8]);
id(paladin_totaltransfer).publish_state(sensors_values[9]);
id(paladin_totaltopup).publish_state(sensors_values[10]);
id(paladin_totalsolar).publish_state(sensors_values[11]);
id(paladin_hourstomht).publish_state(sensors_values[12]);
id(paladin_inverteractive).publish_state(sensors_values[13]);
id(paladin_chargeractive).publish_state(sensors_values[14]);
id(paladin_forceexport).publish_state(sensors_values[15]);
id(paladin_exportactive).publish_state(sensors_values[16]);
id(paladin_importactive).publish_state(sensors_values[17]);
id(paladin_overflow).publish_state(sensors_values[18]);
}
interval:
- interval: 10s
then:
- uart.write: 'A'
sensor:
- platform: template
name: "Overflow"
id: "paladin_overflow"
- platform: template
name: "Import Active"
id: "paladin_importactive"
- platform: template
name: "Export Active"
id: "paladin_exportactive"
- platform: template
name: "Force Export"
id: "paladin_forceexport"
- platform: template
name: "Charger Active"
id: "paladin_chargeractive"
- platform: template
name: "Inverter Active"
id: "paladin_inverteractive"
- platform: template
name: "Total Solar"
id: "paladin_totalsolar"
icon: "mdi:transmission-tower"
unit_of_measurement: "W"
device_class: "power"
- platform: template
name: "Total Topup"
id: "paladin_totaltopup"
icon: "mdi:transmission-tower"
unit_of_measurement: "W"
device_class: "power"
- platform: template
name: "Total Transfer"
id: "paladin_totaltransfer"
icon: "mdi:transmission-tower"
unit_of_measurement: "W"
device_class: "power"
- platform: template
name: "Total Mains Out"
id: "paladin_totalmainsout"
icon: "mdi:transmission-tower"
unit_of_measurement: "W"
device_class: "power"
- platform: template
name: "Total Mains In"
id: "paladin_totalmainsin"
icon: "mdi:transmission-tower"
unit_of_measurement: "W"
device_class: "power"
- platform: template
name: "Mains Watts Now"
id: "paladin_mainswattsnow"
icon: "mdi:transmission-tower"
unit_of_measurement: "W"
device_class: "power"
- platform: template
name: "Transfer Watts Now"
id: "paladin_transferwattsnow"
icon: "mdi:transfer-right"
unit_of_measurement: "W"
device_class: "power"
- platform: template
name: "Solar Watts Now"
id: "paladin_solarwattsnow"
icon: "mdi:solar-power"
unit_of_measurement: "W"
device_class: "power"
- platform: template
name: "Tank Temperature"
id: "paladin_tanktemp"
unit_of_measurement: "°C"
icon: "mdi:coolant-temperature"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 2
- platform: template
name: "Delta Temperature"
id: "paladin_deltatemp"
unit_of_measurement: "°C"
icon: "mdi:coolant-temperature"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 2
- platform: template
name: "Min temp Set"
id: "paladin_mintempset"
unit_of_measurement: "°C"
icon: "mdi:temperature-celsius"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 2
- platform: template
name: "Max Temp Set"
id: "paladin_maxtempset"
unit_of_measurement: "°C"
icon: "mdi:temperature-celsius"
device_class: "temperature"
state_class: "measurement"
accuracy_decimals: 2
- platform: template
name: "Hours To MHT"
id: "paladin_hourstomht"
unit_of_measurement: "h"
icon: "mdi:timer-outline"
device_class: "duration"
accuracy_decimals: 0
button:
- platform: restart
id: restart_button
name: "Restart"
- platform: template
id: paladin_serial_3
name: "Set Min Temp 30 Degrees"
on_press:
- uart.write: '3'
- platform: template
id: paladin_serial_6
name: "Set Min Temp 60 Degrees"
on_press:
- uart.write: '6'
- platform: template
id: paladin_serial_7
name: "Set Min Temp 70 Degrees"
on_press:
- uart.write: '7'
- platform: template
id: paladin_serial_9
name: "Set Max Temp 10 Degrees"
on_press:
- uart.write: '9'
- platform: template
id: paladin_serial_m
name: "Set Max Temp 73 Degrees"
on_press:
- uart.write: 'm'
- platform: template
id: paladin_serial_X
name: "Reset to Default"
on_press:
- uart.write: 'X'
text_sensor:
- platform: template
name: "Paladin Raw String"
id: "paladin_rawstring"