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

some minor things missing on type A #2

Closed
gkathan opened this issue Apr 1, 2024 · 30 comments
Closed

some minor things missing on type A #2

gkathan opened this issue Apr 1, 2024 · 30 comments

Comments

@gkathan
Copy link

gkathan commented Apr 1, 2024

hi sir,

I gave it a final look and detected following issues here in my setup (type-A battery)

  1. two values are always "0" (Current and Power) - it looks like "Current" matches what I see in the offgridtec app (see screenshot), "Power" is not shown in the app ... but should also not be zero

  2. very important (at least for me) is to see (as displayed in the app) that the battery is either "charging", "discharging" or "idling" => but I suspect that this is just a calculated value derived from simple rule to check whether "Current" is positive, negative or zero value => but would be nice to gave that as an entity too in the integration

  3. the switching between using your integration and the offgridtec is currently also a bit quirky => tested to disable the integration => this worked after some time (30 min) that the offgridtec app again could connect BUT from then on it was no longer possible to re-enable succesfully the integration => it just showed "unavailable error" => only removing the device and the integration and re-adding the integration cured the situation

OK thats it from my side - i hope we can fix these last glitches => then it will be perfect and maybe even point 3) is irrelevant as all relevant data is provided by HA

cheerz
greetings from vienna
ble_offgridtec
Screenshot_20230916-070415-EDIT

@patman15
Copy link
Owner

patman15 commented Apr 1, 2024

Hi!

I gave it a final look and detected following issues here in my setup (type-A battery)

Thanks a lot!

1. two values are always "0" (Current and Power)

This should be fixed in version 1.0.1. Need to dig deeper into the topic, but it should work now. Thanks for spotting this!

2. very important (at least for me) is to see (as displayed in the app) that the battery is either "charging", "discharging" or "idling" => but I suspect that this is just a calculated value derived from simple rule to check whether "Current" is positive, negative or zero value => but would be nice to gave that as an entity too in the integration

Yes, the app just goes with the current. I could add a binary sensor battery_charging which is foreseen by HA. Is that what you would be looking for? (This would not cover the state idle though.)

3. the switching between using your integration and the offgridtec is currently also a bit quirky

True, did not think of this as a real use-case ... Anyway, to switch from the app to the integration, you need to click Scanning on the right top of the app and confirm to close the bluetooth connection. If you just close the app it still blocks the connection to the BMS and the integration cannot read values. The other way round I need to dig much deeper, as I have not seen how HA cleans up connections on deactivation actively.

@gkathan
Copy link
Author

gkathan commented Apr 1, 2024

hej,
just updated to 1.01 - to be 100% sure the updated version is actually used I even removed the device and re-added the integration which found the battery immediatly ...

ad 1) this still shows zero at "Current" and "Power" but there is a router + raspi4 running in my van eating around 0,6A constantly - which i can see that the SOC percentage slooowly is going down (so in general it seems to work) - again - do you have a type-A battery to test your code ? or shall I jump into this role ;-) what I anyhow already do :-)

ad 2) yez - should not be a big deal to add this binary sensor ... would appreciate it

ad 3) agree this sounds a bit more complicated especially if connection handling and termination seems to be quite vague :-)

thanx & cheerz
Screenshot 2024-04-01 222347

@patman15
Copy link
Owner

patman15 commented Apr 1, 2024

Ah, one thing, did you reboot HA? Updates via HACS require that ...
ad 1) weired, I tested it with my battery and also with my emulated A type battery. Could you please enable debug mode, ensure there is some current (in or out) and send attach the log? (If you leave debug on for some minutes and then disable it, HA will automatically offer you the download.)
Log would be great as next step for analysis. Thanks.

@gkathan
Copy link
Author

gkathan commented Apr 2, 2024

good morning,

  • ok did also just fully reboot HA to be sure
  • still zeroes in Current and Power
  • and yez - there is definitely current in the battery (as you eg see in the SOC history graph - this is going down accordingly, and as I said it's a POE switch, peplink router and raspi4 HA running ... otherwise I would not be able to access the van here from home 💚✨)
  • ok turned on debug now for 5 minutes - log attached
    see ya laterScreenshot_20240402-062354~2.png
    error_log-3.txt

@gkathan
Copy link
Author

gkathan commented Apr 2, 2024

just one more information:

  • it's a rather low current ... I guess around 0,6Ah ... as these 3 devices consume around 20W ...
  • ... in 2 weeks two fixed solar panels (250W) will be mounted on my van roof and will hopefully keep my lipo4 battery up with that constant load
    cheerz

@patman15
Copy link
Owner

patman15 commented Apr 2, 2024

Morning! Please provide me a debug log (see my previous message on how to do it), so I can check what's happening! Thanks!

@gkathan
Copy link
Author

gkathan commented Apr 2, 2024 via email

@patman15
Copy link
Owner

patman15 commented Apr 2, 2024

Sorry, overlooked the file below the huge picture. 😎 I'll have a look at it soon, first glance indicates that A type batteries use a different data format for the current. Strange implementation.
The number of cycles is correct? I see 4 and 8 values ...

@patman15
Copy link
Owner

patman15 commented Apr 2, 2024

Hey @gkathan, I just drafted a fix for the current issue. Can you check the v1.0.2-beta version? You can download it via HACS by enabling beta versions after clicking "download again". Let me know if it helps. Thanks a lot!

@gkathan
Copy link
Author

gkathan commented Apr 2, 2024 via email

@gkathan
Copy link
Author

gkathan commented Apr 2, 2024

FANTASTIC 🤘💚

you nailed it ! now both values are accurate

awesome

so to keep you busy ;-) one more (very minor) feedback for the "Runtime" Sensor .. would be cool to have it also split in days (d) when Runtime is larger than 24h as current format is not really human readable ( how many days are 123h again 🤭) and if you still would consider to add the boolean value (charging/discharging) we have a perfect version 1.2

curious as I am ... what was the issue withe two values ?Screenshot_20240402-204424~2.png

cheeerz from vienna

@gkathan
Copy link
Author

gkathan commented Apr 2, 2024

... one more thing

  • the Current and Power values seem a bit too low ... will check tomorrow by comparing what the offgridtec app shows with the integration
  • as I mentioned a peplink router and a raspi4 with together below 2W ... bit strange ... but most important is that we have love data Reading now
    c

@patman15
Copy link
Owner

patman15 commented Apr 2, 2024

* the Current and Power values seem a bit too low ... will check tomorrow by comparing what the offgridtec app shows with the integration

I think I know. Factor of 10 missing, give me a minute ...

@patman15
Copy link
Owner

patman15 commented Apr 2, 2024

Fixed. I did not do a new version, just select main under beta-versions.

@gkathan
Copy link
Author

gkathan commented Apr 2, 2024

...trying to select "main" ... but always jumps back to 1.2-beta ... seems to be sticky ... cannot see r anything else than 1.2-beta

any ideas ? what does the comment window tell me ? "..use service call for update entities .."

🤔Screenshot_20240402-215512.png

Screenshot_20240402-215523.png

@gkathan
Copy link
Author

gkathan commented Apr 2, 2024

ok ... got it ... stupid me was on the wrong HA instance 🤭😂

values look very reasonable now

good night - let's follow up tomorrow
c

@patman15
Copy link
Owner

patman15 commented Apr 2, 2024

ok ... got it ... stupid me was on the wrong HA instance 🤭😂

Then it's already to late in the day. 😄

BTW, I have your charging indicator implemented, but it needs cleanup. Will make a new version tomorrow.

curious as I am ... what was the issue withe two values ?

Type B uses the format <16bit current><8 bit multiplier> while type A only has the <16bit current> without multiplier. The integration always read the multiplier, which then was 0 so it multiplied the current with 0 ...
Power is voltage*current so also 0 in that case.

Have a good night!

@patman15
Copy link
Owner

patman15 commented Apr 3, 2024

@gkathan so, good news, just published v1.1.0-beta which has:

  • the strongly missed charging indicator
  • feature to disconnect the battery on disabling it in HA (to allow access by the app again, remember to click scanning in the app to disconnect the battery if switching back to the integration)
  • fixed exception handling

Hope that solves your request stuff in this issue. 😄

"Runtime" Sensor .. would be cool to have it also split in days

I haven't found a way to influence the presentation by HA. Also I did not find an example where this is handled, e.g. my UPS integrations acts the same. If you have hints, let me know.

Enjoy and let me know if you see issues so I can make it a final version or fix it.

@gkathan
Copy link
Author

gkathan commented Apr 3, 2024

hi,
just installed beta 1.1.0 .. but on first try I had just "unknown" on all entities ... maybe due to HA core 24.04 update 🤔 ... just rebooting HA to see whether this helps ... otherwise will step back to 1.0.2
OK ... came up now ... and took.around 1 minute till it got the live values ... but now it looks good
will test the app switch tomorrow morning
cheerz

@patman15
Copy link
Owner

patman15 commented Apr 4, 2024

just installed beta 1.1.0 .. but on first try I had just "unknown" on all entities ...

I removed the initial update, so time to first values was longer. This was to speed up HA startup time. Nevertheless, all integrations block for the initial update, so I will reintroduce it.
Should not affect functionality in any way, just takes 30s longer to show first values.

@gkathan
Copy link
Author

gkathan commented Apr 4, 2024

hi,

so just drove home and tested also the switch to the app by disabling the integration => works like a breeze - great (forth and back)

regarding the initial startup => fully agree with what you said

one last thisng => could you replace the text in "Charging" sensor / entity to "discharging" instead of "not charging" as this makes clear that something is pulling from the battery => "not charging" could also mean the battery is idling - just some minor semantic comment ;-)

thanx

@patman15
Copy link
Owner

patman15 commented Apr 4, 2024

Hi @gkathan,

some further solutions for you:

"Runtime" Sensor .. would be cool to have it also split in days (d)

You can use a template sensor or a template card, e.g. Mushroom template card with the following template:
{{ timedelta(seconds=int(states("sensor.smartbat_aXXXXX_runtime"), 0)) }} results in 4 days, 4:20:00

could you replace the text in "Charging" sensor / entity to "discharging"

Sorry, the HA semantic says that the sensor needs to be called BATTERY_CHARGING. Nevertheless, you can create your own threshold sensor based on the current that does exactly what you want. You can even define something other than 0 or hysteresis in addition. 😄

Are we good then with version 1.1.0-beta? I did some further fixes on the startup issue that I would put into the final version.

@gkathan
Copy link
Author

gkathan commented Apr 5, 2024

did not mean the name of the sensor ;-) but the value of the sensor when it is not charging should be "discharging"

@gkathan
Copy link
Author

gkathan commented Apr 5, 2024

ok got it 🤭 ... yes the threshold thing makes sense ... thänx 🤘 too early in the morning

yez - ready to go for 1.1

@patman15
Copy link
Owner

patman15 commented Apr 5, 2024

issue(s) fixed by release v1.1.0 thanks @gkathan

@patman15 patman15 closed this as completed Apr 5, 2024
@gkathan
Copy link
Author

gkathan commented Aug 12, 2024

ahoi
the integration is still working like a breeze 💚🤘 ... short question ... are you aware that offgridtec released a new variant of it's LiPo4 battery ?
https://www.offgridtec.com/offgridtec-12-200-lifepo4-pro-200ah-2560wh-lithiumbatterie-12-8v.html

do you have a clue whether this new variant is working with current integration ?
cheeerz from vienna

@patman15
Copy link
Owner

Hoi!

are you aware that offgridtec released a new variant of it's LiPo4 battery ? https://www.offgridtec.com/offgridtec-12-200-lifepo4-pro-200ah-2560wh-lithiumbatterie-12-8v.html

I did some fixes on the weekend (not yet in a release) and noticed that Offgridtec has deleted all apps from the Play Store. 😠 So I cannot check against the app anymore because I temporarily deleted it from my phone.

do you have a clue whether this new variant is working with current integration ?

I can't see any hint that this battery supports Bluetooth, so I'd say no. And, as said, there are no apps in the store anymore which is also a clue towards that.

Grüße aus dem heißen Wien,
Patrick

@gkathan
Copy link
Author

gkathan commented Aug 12, 2024 via email

@patman15
Copy link
Owner

patman15 commented Aug 13, 2024 via email

@gkathan
Copy link
Author

gkathan commented Aug 13, 2024 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