I like to tinker and love working on home automation to try to make things easier. So when I got solar I was pretty excited, but also saw endless possibilities integrated with other things in my home. One cool use case was to be able to load my washing machine and then automatically trigger it to start when the battery recharged to a specific value in the morning.

Unfortunately, my Tesla system is not easily accessible with local APIs and I prefer to have local control in case the internet goes out or something changes with a vendor’s cloud. I also have a SPAN panel with no official API or dev support either but there is a community that has reverse engineered some of the calls to create local control and poll for information. The two devices are physically connected and communicating so I figured there had to be some information I can pull on my Powerwall from the Span.

With some digging, I found an API call on the SPAN to get the state of energy (SOE) of a connected battery and figured I would put in a features request on the git repos that manages the HACS integration.

I used to work with a guy who said “what one man can do, another can do,” and I submitted my feature request this phrase kept repeating in my head. As I hit submit, I thought “let me give it a go.” Worst case, I can’t do it and the request is still out there for someone else to look at. Best case, I solve my problem, learn something and am able to make a contribution.

Well… two days later I had something to show off.

Battery Percentage via SPAN in Home Assistant.

Battery Percentage via SPAN in Home Assistant.

I could now pull the battery sensor within my home assistant dev environment but what about those people without a battery? After submitting the initial feature for review, I added an options config flow so that users had to deliberately turn on the sensor and had this added to the mainline code. After some clean up on my end, I shared with a subset of users and no issues reported. Working as designed.

Option flow to enable battery sensor in Home Assistant.

Option flow to enable battery sensor in Home Assistant.

Shortly after, my pull request was merged with the original project in a beta release before finally being published on the main branch as release v1.0.2 of SpanPanel/Span

Release notes for my first contribution.

Release notes for my first contribution.

I have always wanted to contribute to community projects. I think they are a great way to learn new things meet interesting new people. With this experience I was able to create something and share that with others and have already gotten some feedback on how to code better but also how my contribution helped them accomplish their goals. For some may be a small bit, but for me, it pushed me and now I am eager for the next Home Assistant project contribution I can make!