Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fault register #26

Open
vinceg0267 opened this issue Aug 24, 2023 · 0 comments
Open

Fault register #26

vinceg0267 opened this issue Aug 24, 2023 · 0 comments

Comments

@vinceg0267
Copy link

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,";

what should be written here?

 if(z.length() > 0){
    z.pop_back();
  }
  return {z};

Screenshot (45)
Screenshot (46)
Screenshot (47)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant