diy solar

diy solar

Home Assistant - Solar Monitoring and Management

butter_fry

New Member
Joined
Mar 31, 2021
Messages
29
Location
Seattle, WA
The IoT world is really wide open these days and I'm surprised I'm not seeing more systems that people have integrated with their solar setups.
So.. I'll start.

I've been building solar setups for years, and have some pretty funky "Solar Generator" boxes that came before the time of LFP and the IoT revolution. They're quaint now... but still work.

A few years ago I bought one of those PVC inflatable hot tubs. I ran it for a 6 months or so and the power bill was eye popping.... so down the rabbit hole I went.

It was a long journey of writing a Hot Tub controller in PHP, then tossing that out for Home Assistant a year or so later. What I ended up with is a Solar Powered, LFP battery run, A/C backed, LPG Heated automatic hot tub system.

The interface is basic, but only limited by my desire to not put too much time into it. I'm always tweaking it, but it's been stable now for a few years.

The Solar parts are the following:

- Victron 75/15 mppt
- Victron Smart battery monitor Bluetooth thingy
- 400w of mix and match panels in a 24v series
- A RPi3 that runs the Victron VenusOS / connected to the MPPT via USB for control/data collection
- A RPi4 that runs home assistant and a ton of other home automation stuff
- I'm using 8x 40a LFP pouch cells in a water tight container, backed by heating pads.
- For a simple transfer switch, Home Assistant monitors pack voltage. When the batteries are drained it flips on a simple IoT switch to a 24v power supply. Not a charger, or anything. Just a simple 300w 24v power supply that runs the system and levels up the batteries till they get charge from the panels in the morning. Super simple and effective.
- A (now) older Daly BMS w/o temp monitoring

The data that HA uses comes via the Modbus interface that the Victron system provides. It's basic, and these days I wouldn't have to go with Victron, but it's been lights out perfect since Installed it. Victron was the only company making anything just a few years ago that I could pull data from and could trust.

I don't attempt to run the OEM heater/pump unit of this small setup. It's upward of 14a with everything going. It only gets used for short bursts when the main LPG gas heater is running. Mostly for pump augmentation and flow. I even hacked the touch panel circuit board, so that a 8 channel IoT switch can interact with the buttons, simulating button presses. All 8 channels are used, and it's hidden inside the heater unit behind the touch panel. That allows me to interact with the unit via home assistant as if I was physically pressing the various buttons in-person.

The rest of the hot tub is all automated with little motorized valves to direct water flow to either the oem "Egg" (as I call it) heater/pump unit. Or when very quick heating is required to the Instant Hot Water camping heater and secondary pump. This will heat the tub from ~90 to 104f in less than an hour. I had to get the flow just right, as to not literally boil the water. The problems arise in the fact that these hot water heaters are designed to heat COLD water. Hot Tub water is already hot, so one of the only ways to regulate heat is to pump as much through it as possible to keep the time in heater down, thus manageably cooler water output.

It also includes a hot water shower as you can see from the photos. There is a servo attached to the gas dial on the heater. When the shower on button is pressed, the system samples water temps and sets it at a nice hot outdoor shower temperature. When the shower is done, the servo flips back over to low-heat mode that the tub uses.

In all, the system idles at 15w or so. When heating it's around 220w. like I said, really basic but this is more about what we can do in monitoring and interacting with the solar controllers and setups these days.

there is a bunch more.. but that is for a different forum. Thought I'd share the solar bits. Ask me anything or if you need advise I've probably crossed that bridge in the Solar > IoT trail in the past few years.
-Butter
 

Attachments

  • ha-main.png
    ha-main.png
    88 KB · Views: 122
  • ha-solar.png
    ha-solar.png
    343.7 KB · Views: 118
Last edited:

Open-source home automation that puts local control and privacy first. Runs on a Raspberry Pi or a local server.

How's it do for adding sensors?
For example, a competitor like SmartThings is always adding new sensors, has a large following on GitHub, and has a pretty easy mechanism to add them if they're based on the Zigbee/Zwave HA (home automation) standard. Bluetooth and WiFi based sensors are a bit tougher to add (if not available on GitHub) to something like SmartThings as they require an api.

Has anyone integrated HomeAssistant with the IotaWatt or the Emporia Vue?
Update: https://github.com/magico13/ha-emporia-vue and https://community.home-assistant.io/t/custom-component-iotawatt-energy-monitor-integration/254110
 
Last edited:
How's it do for adding sensors?
For example, a competitor like SmartThings is always adding new sensors, has a large following on GitHub, and has a pretty easy mechanism to add them if they're based on the Zigbee/Zwave HA (home automation) standard. Bluetooth and WiFi based sensors are a bit tougher to add (if not available on GitHub) to something like SmartThings as they require an api.
There is very very little that Home Assistant doesn't have an integration for.
Sensors? make / or Add any and all the sensors you want. They all work.

SmartThings/Google's Home/all the corporate based Smart Home interfaces are really just a place where you can link things up. Maybe run some basic automation, a single place where a few different types of things can get collated. Home Assistant on the other hand is a top to bottom Automation Platform that is probably best thought about as an Uber Application, It can take on and interact as the main baseline clearing house for all your smart things. You can completely build an application/app within it to run... your hot tub or automate your solar tracking... or monitor and deal with your battery temps. It's really not a good comparison. Home Assistant does more than you can imagine in the Corporate IoT world.
 
SmartThings/Google's Home/all the corporate based Smart Home interfaces are really just a place where you can link things up. Maybe run some basic automation, ...It's really not a good comparison. Home Assistant does more than you can imagine in the Corporate IoT world.
I'm not familiar with Home Assistant but have programmed SmartThings for my mother-in-law and the automation part sounds similar. The imagination is the limit for what you can do with SmartThings:
  1. Carpool notifier - let people in your carpool know when you're close
  2. Medication - a reminder to take your meds if a time has passed and you haven't opened the medicine cabinet
  3. Eldar Care - get a notification if someone hasn't returned from the bathroom at night in a set amount of time or if someone hasn't gotten up out of bed by a certain time
  4. Mold alerts - get notified if conditions in the attic are ripe for mold
1funny753.gif
Watching your battery temperatures or automating solar wouldn't be a big deal for SmartThings. Apps can run locally or in the cloud. Anything programmable in Groovy can be done.

But what can be a PITA with SmartThings is hooking up unknown wifi sensors and it doesn't have a great debugging suite when building apps.
 
Last edited:
svetz,
I guess all i can say is, you're in a corporate garden thinking you're in the forest. Step out into the wild and see what is possible! (without giving everything away to a company to sell and use)
 
svetz,
I guess all i can say is, you're in a corporate garden thinking you're in the forest...
Sorry, but labels and innuendo without any facts as to why it's superior don't really swing my decision meter towards a product.
 
well.. ok then. How about this? sounds like you may have a HIPPA issue if you're writing automations for health care facilities. Home Assistant isn't a product, it's a community based suite of applications that never sends any data outside of your local network (ie: cloud data). It runs on your own hardware and isn't internet connectivity dependent for operation.

you're speaking about basic automation tasks. I'm sure that is well covered by Samsung. I'm familiar with what it can and can't do. I use the Smarthings api to feed devices into Home Assistant myself.

As for temperature sensors, sometimes I use off the shelf Sonoff hardware or sometimes I use custom code on an ESP8266/32 module. It depends on the application and needs. Sometimes all I need is a temp/humidity sensor, others I need a harsh environment DS18B20 water tight probe. There is a project called ESPHome that allows you to literally drag and drop functionality into a raw ESP8266 and make it do anything you want. You might want to look into that for your temperature needs. Publish the temps via MQTT and grab the data for your SmartThings usage (?) I know it can be a pain to jump into a new universe. This guy seems to have run into some of the same issues.

anyhow, my intent here was a bit of wonder that more people aren't using it in this corner of the world. HA is the undisputed king of automation, I'm quite certain of that. I'm just curious as to why we're not seeing more monitoring suites (HA or SmartThings or whatever based) being used is all. Thanks for the lively conversation!
 
well.. ok then. How about this? sounds like you may have a HIPPA issue if you're writing automations for health care facilities.
No, the list was just illustrating that I didn't really see a limit as to what could be done with SmartThings in terms of automation. The real-world app I've built is the dew point calculation for mold. (I don't own one, did it for my mother in law who does).

Home Assistant isn't a product, it's a community based suite of applications that never sends any data outside of your local network (ie: cloud data). It runs on your own hardware and isn't internet connectivity dependent for operation.
I've always found open-source to be a mixed bag, some is phenomenal and your nuts not to use it. Sometimes it's the reverse. For example, in my opinion, OpenOffice isn't as good as Microsoft Office, but it's near as good and free so I use it.

...you're speaking about basic automation tasks.
I don't think so. Well, I thought I was listing some non-basic tasks that are done in SmartThings.

SmartThings has two modes, Automation and SmartApps. Automation seems basic and limited, I suspect that's what you're thinking of. SmartApps is anything under the sun you can program in Groovy (it can't be done from the cellphone app AFAIK, you have to use the web interface). What I don't like about SmartThings is debugging smart apps. I was never able to get the simulator to fire events on demand and it could use a better debugger.

As for temperature sensors, sometimes I use off the shelf Sonoff hardware or sometimes I use custom code on an ESP8266/32 module.
Currently, I'm using a SONOFF SNZB-02 temp/humidity sensor in the attic. I have a smart app that calculates the dew point of the surfaces and sends a text alert if conditions are ripe for mold (this is not a simple if RH >50% then panic, the sensors don't know how to calculate the dew point). It will also turn on an outlet for a dehumidifier; but I haven't gone to the trouble to put one up as it might not be needed. Did a second app to export data to Google Spreadsheets to get trendlines so I can see if I'm getting close.
anyhow, my intent here was a bit of wonder that more people aren't using it in this corner of the world.
There's a bit about it here and there, but folks don't seem to talk about HA so much as the "project" and HA is a subset of it. For example, I posted about my SmartThings experiences here talking about the attic, there's some discussion about HA in the Emporia Vue thread, and a few other places.
 
I used to have a half dozen Smartthings integrations in different sites, and you can do just about anything, when the internet is up AND smartthings servers are up. When Smartthings was down, everything was very limited. I have upgraded everything to hubitat, and tossed my smartthings hubs. Hubitat works when the Internet is down, but the home network is up. So my smarthome is still smart when the Internet is down. If you like Smartthings, you will love hubitat.

Today I have received 3 vue's with 32 CT's and plan to do an integration into my smarthome. I don't have solar, but I have done tons of experience integrating battery/inverter/generator power systems for datacenters. Normally I would just attach the CT's to a small computer like a raspberry pi and put the data on the local network, BUT this time I'm thinking that emporia may have a very nice open integration. I've already had some good answers to let me know I should be able to eventually integrate my 3 Vue's into one system integration.

I'm still just looking at parts in boxes, it is rainy by the main breaker panel, so today I can just do the sub-panel in the garage which will take two Vue's. I think the current version of the app treats each vue as a separate system, the features to integrate multiple vues will be added. So it should be able to integrate generators and solar sourced inputs as well into one system soon.
 
I used to have a half dozen Smartthings integrations in different sites, and you can do just about anything, when the internet is up AND smartthings servers are up. When Smartthings was down, everything was very limited. I have upgraded everything to hubitat, and tossed my smartthings hubs. Hubitat works when the Internet is down, but the home network is up. So my smarthome is still smart when the Internet is down. If you like Smartthings, you will love hubitat.
Thanks for sharing your experiences!

Today I have received 3 vue's with 32 CT's and plan to do an integration into my smarthome.
I hope you take some photos and blog about how it goes!

BUT this time I'm thinking that emporia may have a very nice open integration.
Interesting! I thought some folks picked the IotaWatt over the Vue to have local hosting.
 
Been using HA since the very first release. I have not yet found something it can not do. Excellent piece of open source, albeit the community around it can be a bit overly passionate and opinionated.

I use it at home, in all of our past Sprinter/RV's, and in a bunch of marine applications as well. It is not for critical systems but excellent for automating and convenience functions which should be isolated from your critical systems anyhow.

Runs happily on a rPI that snaps to a DIN rail.
 
I love Home Assistant and I'm really happy you posted this. The pandemic has been a huge boon for Home Assistant development and it has matured considerably in the last year. I've been looking to do some integration of my Victron stuff and my Home Assistant instance but I have too many unfinished projects right now.

What I'm thinking about for HA integration is an automation to turn solar charging off when my camper battery gets to a certain charge while I'm at home. There's no need to charge my batteries to full when I'm home, unless the weather is going to be cloudy for a few days...another automation I could do with HA. The problem I have there is that I can't get data from my Overkill Solar BMS easily nor from my AiLi shunt. So it looks like I might have to upgrade one of those components to a Victron device. But maybe my SmartSolar MPPT has enough information, I don't know.

@butter_fry do you have a preferred resource for help getting VenusOS up and running on a Pi?

If anyone reading this doesn't know about Home Assistant but knows Node-Red, Home Assistant has a Node-Red plugin. It's pretty fantastic for making all sorts of complex automations.
 
Last edited:
I love Home Assistant and I'm really happy you posted this. The pandemic has been a huge boon for Home Assistant development and it has matured considerably in the last year. I've been looking to do some integration of my Victron stuff and my Home Assistant instance but I have too many unfinished projects right now.

What I'm thinking about for HA integration is an automation to turn solar charging off when my camper battery gets to a certain charge while I'm at home. There's no need to charge my batteries to full when I'm home, unless the weather is going to be cloudy for a few days...another automation I could do with HA. The problem I have there is that I can't get data from my Overkill Solar BMS easily nor from my AiLi shunt. So it looks like I might have to upgrade one of those components to a Victron device. But maybe my SmartSolar MPPT has enough information, I don't know.

@butter_fry do you have a preferred resource for help getting VenusOS up and running on a Pi?

If anyone reading this doesn't know about Home Assistant but knows Node-Red, Home Assistant has a Node-Red plugin. It's pretty fantastic for making all sorts of complex automations.

FYI the Victron stuff has a full set of node-red interfaces as well; so you can easily use that data in your node-red automations.

For example my Lynx Shunt shows up as a node-red sensor that is the SOC of the system; which is very helpful for doing the types of automations you propose. You can also directly tell the Victron MPTT to stop charging via node-red.

The original Multiplus is one exception, but I expected then the new GX version comes out we will get full control over it as well; such as input current limit rates, etc, etc.
 
I love Home Assistant and I'm really happy you posted this. The pandemic has been a huge boon for Home Assistant development and it has matured considerably in the last year. I've been looking to do some integration of my Victron stuff and my Home Assistant instance but I have too many unfinished projects right now.

What I'm thinking about for HA integration is an automation to turn solar charging off when my camper battery gets to a certain charge while I'm at home. There's no need to charge my batteries to full when I'm home, unless the weather is going to be cloudy for a few days...another automation I could do with HA. The problem I have there is that I can't get data from my Overkill Solar BMS easily nor from my AiLi shunt. So it looks like I might have to upgrade one of those components to a Victron device. But maybe my SmartSolar MPPT has enough information, I don't know.

@butter_fry do you have a preferred resource for help getting VenusOS up and running on a Pi?

If anyone reading this doesn't know about Home Assistant but knows Node-Red, Home Assistant has a Node-Red plugin. It's pretty fantastic for making all sorts of complex automations.
VenusOS is dead simple to get going. SD Card + ISO Image = done.

As for HA my config looks like this:
Code:
modbus: !include modbus.yaml
and
content of modbus.yaml:
Code:
name: victronsolar
host: 192.168.xxx.xxx
type: tcp
port: 502
and the sensors which is the most complex of all things. You need to get the correct Slave/Register for each of your devices you want to import to HA as a sensor. It depends on the Victron device. They have a spreadsheet that is published and updated called CCGX-Modbus-TCP-Register-list-X.XX.xlsx
It has all the mappings to the UnitID/Registers you need for your devices.
Code:
  - platform: modbus
    scan_interval: 2
    registers:
    - name: bsc
      hub: victronsolar
      slave: 239
      data_type: uint
      register: 775           
    - name: Battery Voltage
      hub: victronsolar
      unit_of_measurement: "V"
      precision: 2
      scale: 0.01
      slave: 239
      register: 771
    - name: Battery SoC
      hub: victronsolar
      unit_of_measurement: "%"
      precision: 3
      scale: 0.1
      slave: 100
      register: 843 
      data_type: uint
    - name: Smart Battery Voltage
      hub: victronsolar
      unit_of_measurement: "V"
      precision: 2
      scale: 0.1
      slave: 100
      register: 840     
    - name: Battery Temperature
      hub: victronsolar
      unit_of_measurement: "°c"
      precision: 0
      data_type: int
      scale: 1000
      slave: 239
      register: 773
    - name: Amps
      hub: victronsolar
      unit_of_measurement: "ah"
      precision: 1
      scale: 0.01
      slave: 100
      register: 845           
    - name: Solar Yield
      hub: victronsolar
      unit_of_measurement: "W"
      slave: 100
      register: 850 
    - name: Battery Current
      hub: victronsolar
      unit_of_measurement: "A"
      precision: 1
      data_type: int
      scale: 0.1
      slave: 239
      register: 772
    - name: Total Daily Yield
      hub: victronsolar
      unit_of_measurement: "Wh"
      scale: 100
      precision: 0
      slave: 239
      register: 784   
    - name: Total Yield
      hub: victronsolar
      unit_of_measurement: "KWh"
      scale: 0.1
      precision: 1
      slave: 239
      register: 790         
    - name: Max Charge Power
      hub: victronsolar
      unit_of_measurement: "W"
      slave: 239
      register: 785     

    - name: Solar Power
      hub: victronsolar
      unit_of_measurement: "W"
      slave: 239
      scale: 0.1
      register: 789     
    - name: Solar Voltage
      hub: victronsolar
      unit_of_measurement: "V"
      slave: 239
      data_type: uint
      precision: 2
      scale: 0.01
      register: 776               
    - name: Solar Current
      hub: victronsolar
      unit_of_measurement: "A"
      slave: 239
      scale: 0.1
      precision: 1
      register: 777
 
Last edited:
Here's an update to Home Assistant and solar monitoring.

I'm using an Overkill Solar BMS in an 8cell EVE 272ah setup. From the Raspberry pi it's pulling data in from both the Charger/Inverter (Growatt SPF3000) and the BMS. The BMS has a full suite of telemetry available, including faults/balance status. Props to the code owner @tgalarneau on github for doing this reverse engineering. The screenshot is taken from a remote location (another HA install) and connected to the onsite Pi via VPN. Only Grafana is running on the remote rendering location. The onsite Pi has Telegraf and Influx.

The Bluetooth BMS monitoring code: https://github.com/tgalarneau/bms
Solar Charger/Inverter monitoring code: https://github.com/johanmeijer/grott

Using a Telegraf / Influx / Grafana stack I can render all that in Home Assistant. It's a work in progress, but I've got all the telemetry in there now so I can do whatever I want with it. The data from the Charger is coming in at a 1min interval (growatt limitation) and the BMS can report at any interval. I've got it set to 8seconds right now.


116729758-6803bd80-a99c-11eb-80ff-f7f9ad211854.png
 
Last edited:
I'm also a long time Home Assistant user. I had my inverter, battery, relays, etc. integrated and solar forecasting via SolCast, to predict when my batteries will be fully charged to switch inverter mode:

image (13).png


I then discovered SolarAssistant and basically abandoned my whole HomeAssistant setup as it gave me many features I wouldn't have. Their power management is also something I was looking for. Since SolarAssistant is a commercial product it pretty much just works out of the box.


I also saw this post:

Now I hear SolarAssistant will soon support MQTT output with automatic discovery in Home Assistant. When that is available I'll probably revive my Home Assistant setup for hobby purposes although I don't really need it anymore.

1620379916977.png



Now to show off my ultra wide screen:

1620379973640.png


1620380062539.png

It's pretty clear that it uses Grafana for charts internally:

1620380114056.png

Then the inverter settings:

1620380189906.png

They seem to provide you with some sort of region based built in VPN. I can access my site remotely via web and mobile without having to do any setup. There seem to be regions for US, australia, europe, africa. The latency I get to my site is amazing. Opens instantly even though I'm in Africa.
 
I'm also a long time Home Assistant user. I had my inverter, battery, relays, etc. integrated and solar forecasting via SolCast, to predict when my batteries will be fully charged to switch inverter mode:

View attachment 48099


I then discovered SolarAssistant and basically abandoned my whole HomeAssistant setup as it gave me many features I wouldn't have. Their power management is also something I was looking for. Since SolarAssistant is a commercial product it pretty much just works out of the box.


I also saw this post:

Now I hear SolarAssistant will soon support MQTT output with automatic discovery in Home Assistant. When that is available I'll probably revive my Home Assistant setup for hobby purposes although I don't really need it anymore.


They seem to provide you with some sort of region based built in VPN. I can access my site remotely via web and mobile without having to do any setup. There seem to be regions for US, australia, europe, africa. The latency I get to my site is amazing. Opens instantly even though I'm in Africa.

Yup, that's great for viewing for sure. It's the MQTT that will make it actionable. It's kind of a different thing, or another thing altogether when you can make smarter use of your power depending on conditions, battery state, temperature.

thanks for sharing
 
I'm also a long time Home Assistant user. I had my inverter, battery, relays, etc. integrated and solar forecasting via SolCast, to predict when my batteries will be fully charged to switch inverter mode:

View attachment 48099


I then discovered SolarAssistant and basically abandoned my whole HomeAssistant setup as it gave me many features I wouldn't have. Their power management is also something I was looking for. Since SolarAssistant is a commercial product it pretty much just works out of the box.


I also saw this post:

Now I hear SolarAssistant will soon support MQTT output with automatic discovery in Home Assistant. When that is available I'll probably revive my Home Assistant setup for hobby purposes although I don't really need it anymore.

View attachment 48101



Now to show off my ultra wide screen:

View attachment 48102


View attachment 48103

It's pretty clear that it uses Grafana for charts internally:

View attachment 48104

Then the inverter settings:

View attachment 48105

They seem to provide you with some sort of region based built in VPN. I can access my site remotely via web and mobile without having to do any setup. There seem to be regions for US, australia, europe, africa. The latency I get to my site is amazing. Opens instantly even though I'm in Africa.

I'd like to have ability to view performance / charts of my system to monitor how it's going and what it's producing, etc. - but I'd prefer not to HAVE to have internet access required for it to work. i.e. What about when my (the) internet is down? Does Solar Assistant require internet access to work?
 
I'd like to have ability to view performance / charts of my system to monitor how it's going and what it's producing, etc. - but I'd prefer not to HAVE to have internet access required for it to work. i.e. What about when my (the) internet is down? Does Solar Assistant require internet access to work?

From the docs:

The device needs internet access in order to be activated. Once activated it can be used without internet and accessed via it's WiFi or LAN.

I'm setting this up today/tomorrow and will report back.
 
From the docs:

The device needs internet access in order to be activated. Once activated it can be used without internet and accessed via it's WiFi or LAN.

I'm setting this up today/tomorrow and will report back.

So I activated and set up Solar Assistant on a Pi Zero W and was able to access the Dashboard offline from a Bluetooth connection in my camper. There's not much (any) data yet from my MPP Solar 1012 in the Grafana dashboards, but it connected and started collecting metrics.
 
Back
Top