Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pazuri Powerwall
#11
(08-06-2020, 04:18 AM)ajw22 Wrote: I think your BMS+Bluetooth are compatible with those I use. I use a RaspberryPi3 to query and log all the data. My amateurish Python code should be somewhere in my project page.
Note that the RPi onboard bluetooth adapter seems to have stability issues, best to use a USB dongle.
The data also contains temperature, which might be useful in deciding when to turn on/off heating.

And several TPLink HS105 to automatically/remotely control various loads, such as EV charging. In your case, might come in handy to turn on/off heating.

Thanks for this. It couldn't have come at a more timely time. Can you share the updated source code if you have done updates on it? I will share back any improvements that I make.
ajw22 likes this post
Reply
#12
(08-06-2020, 07:39 AM)Solloh Wrote:
(08-06-2020, 04:18 AM)ajw22 Wrote: I think your BMS+Bluetooth are compatible with those I use. I use a RaspberryPi3 to query and log all the data. My amateurish Python code should be somewhere in my project page.
Note that the RPi onboard bluetooth adapter seems to have stability issues, best to use a USB dongle.
The data also contains temperature, which might be useful in deciding when to turn on/off heating.

And several TPLink HS105 to automatically/remotely control various loads, such as EV charging. In your case, might come in handy to turn on/off heating.

Thanks for this. It couldn't have come at a more timely time. Can you share the updated source code if you have done updates on it? I will share back any improvements that I make.


Posted it here:
https://secondlifestorage.com/showthread...7#pid65907
Modular PowerShelf using 3D printed packs.  60kWh and growing.
https://secondlifestorage.com/showthread.php?tid=6458
Reply
#13
Thanks ajw22.

I have started modifying it and testing it. Would you mind if I clean it up, add a readme on how to use it and post it online publicly?
ajw22 likes this post
Reply
#14
(08-09-2020, 04:05 AM)Solloh Wrote: Thanks ajw22.

I have started modifying it and testing it. Would you mind if I clean it up, add a readme on how to use it and post it online publicly?

Go ahead - remember to share the proceeds if it should become a m[/b]illion dollar business Wink
I just noticed that I reset both hci0/hci1 on any BT exception, but then only reconnect the BMS it's currently trying to query from.  Probably need to reconnect to all BMSs.
Might explain the occasional data glitches I have in my graphs.
Modular PowerShelf using 3D printed packs.  60kWh and growing.
https://secondlifestorage.com/showthread.php?tid=6458
Reply
#15
(08-09-2020, 08:17 AM)ajw22 Wrote:
(08-09-2020, 04:05 AM)Solloh Wrote: Thanks ajw22.

I have started modifying it and testing it. Would you mind if I clean it up, add a readme on how to use it and post it online publicly?

Go ahead - remember to share the proceeds if it should become a m[/b]illion dollar business Wink
I just noticed that I reset both hci0/hci1 on any BT exception, but then only reconnect the BMS it's currently trying to query from.  Probably need to reconnect to all BMSs.
Might explain the occasional data glitches I have in my graphs.

Hahaha, I will. No worries, all credits and links have been given. See https://github.com/badili/diy_powerwall_monitoring

Some of the improvements so far:
  1. Added instructions on using the code
  2. I am running it on a virtual environment. Much cleaner than installing modules system wide. python has crazy dependancy issues, then there are modules for each version of python. Just safer to use a virtual environment if you want to use the system for other things
  3. Automatic discovery of characteristic handle id. The handle id was hardcoded and it didn't work for me. On some reading I found that you can scan for the writable characteristics of a bluetooth periphery. Once found, try writing with response set to True. If it writes well, thats your characteristic for reading data. Check the function determine_data_characteristic of https://github.com/badili/diy_powerwall_...ter/bms.py 
  4. I have also defined a variable for the bluetooth devices and their mac addresses
  5. I noted the reset on any exception so I added a general exception for all other exceptions
I added a flag on whether to write to db or not, in such a way that it can easily be toggled and data can be written to a local database or just printed to the console (I haven't really tested on writing to the db since I am certain I fiddled with the data structure and it might fail. I will let you know once its tested).

Next plans:
  1. Use sqlite3 for local logging (sqlite3 is resource friendly for the tiny pi as compared to PostgreSQL and MySQL)
  2. Setup an online grafana system for visualizations
  3. Setup an online MySQL db for saving the data.
  4. Send data from the pi to the online DB and configure grafana to use the DB as a data source
ajw22 likes this post
Reply
#16
I control a lot of my stuff with Home Assistant, so I've taken the code and nailed some MQTT stuff to it.

My code now includes passwords etc, so I wasn't sure how to share it on github, but if anyone is interested let me know. 

BTW I had to disable psycopg2 to get it to run on my fresh RaspberryOS install on a Pi Zero. Most likely because I don't have DB stuff installed.
Reply
#17
(10-13-2020, 04:52 PM)dragonfly Wrote: I control a lot of my stuff with Home Assistant, so I've taken the code and nailed some MQTT stuff to it.

My code now includes passwords etc, so I wasn't sure how to share it on github, but if anyone is interested let me know. 

BTW I had to disable psycopg2 to get it to run on my fresh RaspberryOS install on a Pi Zero. Most likely because I don't have DB stuff installed.

This is awesome. You can mask out the passwords and push to github or include all the passwords in a secrets file and omit it from the commit.

Thanks
Reply
#18
I tried commiting my changes but I get

remote: Permission to badili/diy_powerwall_monitoring.git denied to dragonflyuk.
fatal: unable to access 'https://github.com/badili/diy_powerwall_monitoring.git/': The requested URL returned error: 403
Reply
#19
(10-15-2020, 03:44 PM)dragonfly Wrote: I tried commiting my changes but I get

remote: Permission to badili/diy_powerwall_monitoring.git denied to dragonflyuk.
fatal: unable to access 'https://github.com/badili/diy_powerwall_monitoring.git/': The requested URL returned error: 403

This is great that you are trying to push changes to the repo. Awesome.

For github to submit the changes, you are meant to create a pull request. It is easy and very straightforward. I will then merge the changes.

Thanks
Reply
#20
I must be missing something, I'm using linux commandline, because I run it on the pi zero, over ssh

I created a local branch call dragonfly, then I try to commit it with

git push origin dragonfly

but that's when I get the error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)