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

Publish HA discovery mqtt data before bms sample data #163

Closed
scotthernandez opened this issue Nov 22, 2023 · 9 comments
Closed

Publish HA discovery mqtt data before bms sample data #163

scotthernandez opened this issue Nov 22, 2023 · 9 comments

Comments

@scotthernandez
Copy link

Unfortunately my daly bms doesn't quite work with the current code:
'''
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/bmslib/models/daly.py", line 144, in _q
raise TimeoutError(
TimeoutError: timeout awaiting result 95, got 5/6 responses

08:02:48 INFO [sampling] connecting bms DalyBt(18:81:03:03:05:EF,lifepo4-solar-1)
08:02:58 INFO [daly] normal connect failed (<class 'TimeoutError'>), connecting with scanner
'''

And because of the timeout in the last sample I suspect it is never able to publish the discovery mqtt topics that HA needs for creating the sensors.

Can you please check to see if it is easy to rearrange things to publish the discovery data before the sample data?

@fl4p
Copy link
Owner

fl4p commented Nov 22, 2023

For how many cells did you configure the BMS?

@scotthernandez
Copy link
Author

It is a 15 cell pack - 48v system.

@scotthernandez
Copy link
Author

It does publish data for these topics:

  • meter
  • switch
  • mosfet_status
  • soc

If that helps.

@fl4p
Copy link
Owner

fl4p commented Nov 22, 2023

Thanks, I found a bug where the code wrongly computes the number of responses (the BMS sends voltages in tuples of 3)
Ill fix this with the next release.

@scotthernandez
Copy link
Author

Great, thanks.

Does it make sense to move the discovery mqtt data check before reading/publishing the samples?

@fl4p
Copy link
Owner

fl4p commented Nov 22, 2023

Yeah kind of. The discovery function currently needs samples voltages to publish the number of cells and skip the nan fields.
I'll rewrite the code so discovery is sent out even if voltages fetch failed.

@scotthernandez
Copy link
Author

scotthernandez commented Nov 22, 2023 via email

@fl4p
Copy link
Owner

fl4p commented Nov 26, 2023

fix dfd6e4a
is in the next release
please re-open if needed

@fl4p fl4p closed this as completed Nov 26, 2023
@scotthernandez
Copy link
Author

scotthernandez commented Nov 26, 2023 via email

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