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

Possible to get error codes from battery? #93

Open
nowcodingaway opened this issue Nov 22, 2024 · 4 comments
Open

Possible to get error codes from battery? #93

nowcodingaway opened this issue Nov 22, 2024 · 4 comments

Comments

@nowcodingaway
Copy link

nowcodingaway commented Nov 22, 2024

Is it possible to get any errors that the battery might encounter?

E.g. over current protection, under current protection, low temperature shut off etc?

The intention is to replace the Renogy M1 / OneCore devices, but currently they would be the only way to know about an error and the battery can't be connected to more than one device at a time.

I didn't see anywhere that errors could be collected and reported on in the debug lots or code.

Would something like this work? Are these the correct registers?

 {'register': 5030, 'words': 1, 'parser': self.parse_battery_status},
 {'register': 5031, 'words': 1, 'parser': self.parse_alarm_status}
 
  def parse_battery_status(self, bs):
        status = bytes_to_int(bs, 0, 2)
        # Interpret the status bits as needed
        self.data['battery_status'] = status

    def parse_alarm_status(self, bs):
        alarm = bytes_to_int(bs, 0, 2)
        # Interpret the alarm bits as needed
        self.data['alarm_status'] = alarm
@cyrils
Copy link
Owner

cyrils commented Nov 22, 2024

Is this for RoverClient or BatteryClient?

@nowcodingaway
Copy link
Author

For the battery. Specifically RBT200LFP12-BT

@cyrils
Copy link
Owner

cyrils commented Nov 22, 2024

Its more complicated than that. Each cell has alarm code. And two bits each represent code for a cell:

{'register': 5100, 'words': 2, 'parser': self.parse_cell_voltage_alarm}

Then each of those bits need to be parsed. Ex:

def parse_cell_voltage_alarm(self, bs):
       alarm_bytes = bs[3:4]
       # Interpret the alarm bits as needed
       # Bit0-Bit1: Cell 1 voltage alarm
       # Bit2-Bit3: Cell 2 voltage alarm

@nowcodingaway
Copy link
Author

Thank you for at least taking some time to look into it and let me know.

Quite a bit above my beginner skills, so I will just make do without the errors for now, and if anything stops working, fire up the DC Home app and do a direct connection.

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

2 participants