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

missing values "virtual load output" "state [bulk, float, absorption]" #26

Open
pkoevesdi opened this issue Sep 6, 2023 · 8 comments
Open

Comments

@pkoevesdi
Copy link

pkoevesdi commented Sep 6, 2023

Hey,

very fine project, meeting quite exactly my use case: getting my SmartSolar values via bluetooth and mqtt into the home assistant of my camper.
Sadly, I'm missing these values: "virtual load output" and "state [bulk, float, absorption]". I'm not sure, why:

  • Just not reverse engineered? How can I help? Maybe some basic hints how to filter the debug log or something, then I'm really pleased to contribute.
  • Just not implemented, not sent via MQTT?

Since the official GATT-protocol ist officially not available for other devices than SmartShunt (or did I miss something?), I think, I'm connecting via reverse engineered VictronConnect-protocol? I use this in config.yml:

devices:
    - name: SmartSolar
      type: smartsolar
      protocol: bluetooth
      mac: ...

The advertisement protocol is no solution, since it doesn't contain the (for me important) virtual load output state - neither the App show this value in the preview values section, nor the spec includes it. Further more, the advertisment doesn't include the panel voltage and current, which I get here.

Thank You very much for hints how to get these values and how to contribute.

@birdie1
Copy link
Owner

birdie1 commented Sep 6, 2023

Hello,
yes, these values are not reversed engineered. The reverse engineering is quite difficult and I am not really good at it.

If you want to try it: https://github.com/vvvrrooomm/victron did most of the research I am using for my code. In this repo there is wireshark prorocol dissector. We tried using the app and wireshark to find out which bluetooth hex value could be which.
In my code you can set the loglevel to debug, than it should output all the data which it is not able to interprete. If you combine both, you may find more values.
I am still looking for a way to get the history values from the smartsolar as well. The value are already reverse engineered, but it looks like I need to send something towards the smartsolar, that it will send the history back. This would be very interesting as well.
I would be very happy if you find some more values :)

All values currently gathered are send to mqtt.

If you specify 'bluetooth' as protocol, it will use the reverse engineered procotol. bluetooth-ble is the gatt protocol, but you are right, it is only available on smartshunt.

Even if it does not help in your case, I will have a look at the advertisement protocol. Sounds nice to implement this as well.

@pkoevesdi
Copy link
Author

Ok, thank You for the feedback. I'll try to figure out some stuff, but it can take a whole while, I'm very limited in time. Maybe next weekend.
For using the advertisement data, I had quick success with this project:
https://github.com/keshavdv/victron-ble
Instead of querying the sqlite database, You can simply get the encryption key from the app under settings, product-info, at the bottom, see here: https://community.victronenergy.com/questions/187303/victron-bluetooth-advertising-protocol.html
I'd suggest to keep this issue open, until we find these parameters.

@birdie1
Copy link
Owner

birdie1 commented Sep 6, 2023

Yes sure, we can leave it open.

Thanks for the links. I will add it probably beginning ob october to my code.

@pkoevesdi
Copy link
Author

pkoevesdi commented Sep 10, 2023

Ok, I took a look at it and found out almost everything that VictronConnect displays for my SmartSolar, including the load output. I'm not yet sure about the state and what to send to get the history.
I posted my findings into victron.lua in vvvrrooomm/victron#2

@birdie1
Copy link
Owner

birdie1 commented Sep 12, 2023

Nice, thanks for your work. I will add it to my code

@pkoevesdi
Copy link
Author

So, now I found acutally almost all information, public since years:
https://www.victronenergy.de/upload/documents/VE.Can-registers-public.pdf
https://www.victronenergy.com/upload/documents/BlueSolar-HEX-protocol.pdf
The only thing missing was all the time the bluetooth stuff around, but the payload - the VREGs are open.
So, I'll stop putting all that into the wireshark lua.
I found also the state I was missing, it is VREG 0x0201.
Maybe You can look through for the command for getting the history?
I'll see what I can do to implement the (for me) important stuff here...

@robinsalyon
Copy link

robinsalyon commented Sep 26, 2023

Thank you both, I'm interested in these parameters too (in json).

@pkoevesdi
Copy link
Author

@birdie1, can You provide me with some starter's help how to implement new found values into Your source code? I'm a bit lost and don't know where to put them. I've documented a lot of stuff in the .lua in mentioned pull request, but I don't need it in wireshark, I need it in mqtt. ;-)

Thank You!

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

3 participants