My Sofar's Fault registers start from 0x0405 to 0x416, each register splits into two bytes and each byte splits into eight bits. How can I modify your code to read Faults?
platform: modbus_controller ## Inverter Fault Message ##
modbus_controller_id: zcs ## Fault 1 ##
name: Errore Inverter
id: inverter_fault_message
register_type: holding
address: 0x0405
skip_updates: 20
response_size: 2
lambda: |-
std::string z = "";
int idx = item->offset;
//byte[0]
if ((data[idx] & 0x1) != 0) z += "ID001 GridOVP,";
if ((data[idx] & 0x2) != 0) z += "ID002 GridUVP,";
if ((data[idx] & 0x4) != 0) z += "ID003 GridOFP,";
if ((data[idx] & 0x8) != 0) z += "ID004 GridUFP,";
if ((data[idx] & 0x128) != 0) z += "ID008 IslandFault,";
My Sofar's Fault registers start from 0x0405 to 0x416, each register splits into two bytes and each byte splits into eight bits. How can I modify your code to read Faults?
what should be written here?
if(z.length() > 0){ z.pop_back(); } return {z};
![Screenshot (47)](https://github.com/pawelka/sofarsolar_esp_rs485_logger/assets/132155698/98964f60-4db9-4367-8b95-be31bb8f9e4e)