-
Notifications
You must be signed in to change notification settings - Fork 37
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
Quick question about the BMS Watthours sensor; #95
Comments
It’s a 32-bit value and the config needs updating. I’ll put in a PR this evening. |
Thanks 👍 |
Just to note, I have to make some assumptions here about the values. It would help if someone could implement this on their HA and report back. These two uint16 values can then be turned into a uint32.
|
I'll give this a go now. Will let you know what happens. |
Foxcloud gives my throughput currently as 9983.055 (kWh I assume? that would make sense for my typical throughput and length of service). |
Based on those values (0x00EC544F) that should be 15,488,079 Have a play with that and I'll check back in later. |
OK. So my (Foxcloud) total throughput was 9983055 or 0x0098544F, so it looks like the low bytes are correct, but hi bytes (236 or 0x00EC) are not. |
If you're reading a 32bit value across 2 sensors then is HA getting it right? If you use data_type: unit32 then HA's modbus implementation should calculate the register count correctly, but perhaps it isn't? This is working for me in that it's not throwing an error, and it appears to have read a value on restarting HA, but can someone else try this: |
Hey @StealthChesnut I'm looking at raw can logs to decipher this register. What I see is an energy counter, uint32 little endian. The specific can frame shows [.., 0x79, 0x43, 0x00, 0x00, ..] = 17273, and that rising in line with energy in and out of the BMS over time. This value may reset at midnight, or some arbitrary time. I noticed that the can logs I have show this decoded value starting at exactly 10,000Wh which seems a little suspect for a lifetime counter. That probably means a name and unit (Ah ->Wh) change is in order once confirmed. |
Hi Chris, I just tried uint32 count: 2, I do get a value from this sensor which is pretty much the same as @rand12345 calculated earlier from the hi/lo byte sum; The value is increasing too at what seems like a sensible rate (based on short period it's been running) But is not really close to what Foxcloud data report shows (9.9 e6 Wh) |
Not particularly happy with this sensor, there appears to be some sort of arbitrary offset which I can't test for. Might be better to yank it @StealthChesnut |
Probably not a coincidence given it’s a 1 in 65335 chance! Submit that sensor as a PR. |
Is the outcome that the bms watt hours sensor needs to come out for now, and x48 go in as battery cycles? |
@StealthChesnut @rand12345 I'm not 100% sure! 48 does look like cycle count, but I can also get throughput to match up by taking the 32 bit 48+49 and subtracting 84*16^4.... confused. |
ok - lets see what happens over the next day or two with these, see if we can work out what they are for definite before making more changes. |
Hmmm, this is strange. However, this morning throughput is reading spot on again (!?) even though cycles are at 237 still, after it took a step change back down of 65536; Rather than keep bunging up this thread with more random screenshots (!), I'll set up HA with a load of other registers and spend some time seeing if I can spot which one(s) may be impacting this number. |
Please never think they're unwelcome! Sharing your datapoints gives extra info to anyone else looking at this, and saves us all duplicating work. Keep the info coming! |
No data to support this, but looking at some other 32 bit values, they seem to be in pairs but skipping one address each time, as I understand it? So, is BMS KwH Total something like 11047 + 11049 with BMS Cycle Count in the middle at 11048? Kind of like Battery Charge Today at 11074 with Battery Charge Total at 11073 and 11075? |
@FozzieUK has done a bunch of work on this sensor: nathanmarlor/foxess_modbus#110 |
Battery charge total is at 11073 and 11072? Battery Discharge Total is at 11076 and 11075, and battery_charge_today at 11074. |
This thread got a bit out of date, there's more discussion and example code in #112 and explanation of what Input Energy Total / Today seems to be. Here's the latest spreadsheet with the entity data I try to keep up to date. H1 modbus map.xlsx I've also backed up my current running code with these counters working here: https://github.com/TonyM1958/HA-FoxESS-Modbus. You are welcome to take anything from there that's useful. |
Should this be the same as the kWh (x1000) value that is available in the Foxcloud data report?
If so then I think I have a problem;
Foxcloud reports my throughput as roughly 9947kWh or 9,947,000 Wh.
The sensor I am pullling in from register 11049 is giving me odd values in HA;
It peaked at 32,731 then dropped to -32749 (more or less 2^15 to -2^15) so is this a stack overflow issue?
In modbus config for this sensor I tried adding data_type: xxxxx (int16, int32, int64, uint16, uint32, uint64) but none of these worked either!
Originally posted by @Daibutt in #92 (comment)
The text was updated successfully, but these errors were encountered: