A Useful Way Do Do Zero Export

I decided to re-do how my system performs zero export. Instead of that potential going to waste, I decided to get creative. I was able to get my hands on a bitcoin miner. There is a plugin for Home Assistant that allows you to control and monitor almost any popular bitcoin miner on the market. I decided to use this to my advantage. My system currently does pay me for the excess energy I generate, the process to do that is long, expensive and for the size of my system, would not be worth it in the long run. I have played with mining various crypto currencies in the past and it is neat how it all works and their is potential to earn a lot of money with very little effort. Here is the issue, Mining crypto is very intensive and to be profitable, you often need specific hardware. I was able to score a second hand Antminer A9 which is an older miner and normally would not turn a profit with the 1500+ watts of power needed to run it. Normally it costs more to run in electricity than I would see in return. When I mine, I use nicehash which is a mining pool. I could solo mine, however the chances of mining a block is very small. Pool mining, you get paid as share based on how much computing power you contributed and the earnings are more stable. Newer miners are more efficient and can net a decent profit, however they cost sometimes thousands of dollars. Used ones can be had for much less. I bought mine for around $100.

One of the reasons I like the Antminers is the huge support they have and they have many active communities. The firmware is actively maintained and they have an API connection for third party monitoring and control. Using a plugin for Home Assistant called “Miner”

My inspiration was this thread I came across…

https://community.home-assistant.io/t/controlling-bitcoin-antminer-for-house-heating/753510

After reading this, My idea was at least a very real possibility and thanks to the Home Assistant Community, can be done very easily. Here is the code I used to make it happen!

First create a template sensor that will compare the energy being used by my home and the energy being produced by my solar inverter.

template:
  - sensor:
      - name: "Excess Solar Power"
        unit_of_measurement: "W"
        state_class: measurement
        state: >
          {% set solar = states('sensor.solar_output') | float(0) %}
          {% set house = states('sensor.house_energy_use') | float(0) %}
          {{ (solar - house) | round(0) }}

Then create the automation.

alias: Control Crypto Miner
description: Adjust miner power using excess solar with 150W hysteresis
mode: single

trigger:
  - platform: state
    entity_id:
      - sensor.excess_solar_power
    for: "00:00:10"

condition: []

action:
  - variables:
      excess_power: "{{ states('sensor.excess_solar_power') | float(0) }}"
      max_miner_power: 1000
      current_miner_power: "{{ states('number.crypto_miner_power_level') | float(0) }}"
      proposed_power: >
        {% set raw = [excess_power, max_miner_power] | min %}
        {% if raw < 0 %}
          0
        {% else %}
          {{ raw | round(0) }}
        {% endif %}
      power_diff: "{{ (proposed_power - current_miner_power) | abs }}"

  - choose:
      - conditions:
          - condition: template
            value_template: "{{ power_diff > 150 }}"
        sequence:
          - service: number.set_value
            target:
              entity_id: number.crypto_miner_power_level
            data:
              value: "{{ proposed_power }}"

Then if you want to say turn on an indicator in your HA dashboard or some kind of physical indicator, create a Binary sensor. This part isn’t needed, but I have a “light” that comes on in my solar dashboard when I am actively mining.

template:
  - binary_sensor:
      - name: "Enough Solar for Miner"
        state: >
          {{ states('sensor.excess_solar_power') | float(0) > 100 }}

Just make sure if you use this code to change the names of your sensors to match your particular setup. I used generic names here to make the code easier to understand. You can control more than one miner and if you used something different than an Antminer, you may have to tweak the code further.

So far so good!

So far so good! My solar setup is half way completed and it has already made a small dent in my electric bill. It has been cloudy the past few weeks so my numbers are a bit on the low side. I received my first electric bill and so far, $9 lower. Not a big dent. But it is a start!

Added A Second String

This weekend, I decided to add an additional 6 panels to my system. This doubled my output and I can now generate a useful amount even when it is cloudy. I was going to call my project finished with the 2 strings of 6 panels, but I have the capacity, they space and the panels to add 3 more strings. I will have to add a second PV Combiner box, but my inverter and wiring is more than capable to handle the additional capacity. My inverter will be running close or at its maximum capacity, but that will not be an issue. Where I have the inverter installed is inside my detached shed. It is insulated and will be air conditioned in the summer so the inverter will stay nice and cool, even at full load. I plan on integrating some bitcoin miners into the system for days when my solar system is exceeding what my home is using. I figured why not, free money!

Successful Test!

So a little bit out of order today because the weather has been so nice recently, but I have installed about 1/4 of my panels. After experimenting with different configurations, it turns out my inverter likes DC voltages above 180 vols, I have decided to configure my system with 4 strings of 6 panels. 6 panels in series and 4 strings in parallel. Today was a cloudy day and I wired up the first string and the 240 volt line to the inverter. The results so far are good. My Zero Export configuration is working and for a short time today I was able to 100% power my home with solar! I had a peak output of 780 watts.

Zero Export and Fun with MODBUS-RTU

In order to not get a nasty gram from my power company, I needed to set up zero export. Basically what this does is prevent my solar system from feeding the grid. I thought about doing this and getting paid for my surplus production, but this process is more trouble than it is worth for me. In order to set up the zero export, my inverter needs to know how much power is flowing into and out of both my solar system and the power grid. These two little boxes do that. The bigger of the two boxes is the smart meter. This talks to the inverter and tells it how much power is flowing on the 2 main legs going into my house after my power meter. The issue I was having was the distance. MODBUS-RTU is a bus protocol for automation controls and other devices. It is also known as RS485. This really neat communication protocol uses two wires and is almost always universal between different manufacturers. It has become a standard in the solar industry because of its ease of use and easy to implement. My issue was my inverter is a good distance from my main panel. My solution was to send the data over my network. I am using MODBUS over tcp/ip which eliminates any distance limitations. In theory, I could extend the bus across the world and it wouldn’t matter. I have a second box in my shed with a WiFi bridge and it works flawlessly. I will soon set up a low voltage system in my shed to power this equipment as well as an additional raspberry pi running Solar Assistant for additional more detailed data. This raspberry pi will use the MODBUS protocol to communicate with the inverter and the smart meter and will relay that data to Home Assistant where I can get more advanced with some of my automations and create more detailed custom dashboards. The RS485 bridges I used are from WaveShare and the WiFi bridge I am using is a Vonets Val-11g-300

WiFi bridge…

https://amzn.to/4ivlYXO

WaveShare Rs485 to Ethernet bridge…

https://amzn.to/4c15Tqs

Safety Systems

Today I decided to take advantage of the near 70 degree weather and started wiring up my solar system. I am still waiting on the inverter to come, but I have run the 240 line to the shed where the solar will be installed and have wired up the combiner panel and the DC shutdown switch. I went a little overboard on the wiring, I am using 10/3 for the 240 volt wiring which is rated at 30 amps. My system most likely will not push anything more than 15 amps but I decided to go this route so I can upgrade my system down the road if need be. The oversize circuit will have an added benefit of minimizing the voltage drop across the 75 feet of electrical wiring between the solar inverter and my main electrical panel. As for the DC side, I am using outdoor rated and UV resistant 10 gauge wiring. The wiring also has thick insulation designed to handle high voltage DC. The DC circuit for my panels will be running around 180 to 230 volts. Each string has the potential to operate at 6 amps and I plan to have 3 or 4 strings. The combiner panel has several safeguards. Each string is on an independent 15 amp fuse. The entire combiner box is protected by a 60 amp breaker and has surge and lightning protection modules protecting both the Positive and Negative connections for the system. Any fault current will be safely sent to ground protecting not only the system, but anyone near it. This will also prevent a fire if there is a voltage leak or fault wire.

As an additional layer of protection, my DC shutoff switch is over rated and has additional surge suppression devices. The reason for the rapid DC shutdown is to kill power to the system if their is an emergency. The inverter is designed to shutdown in the event of AC power loss as a safety measure to protect linemen from getting electrocuted while working on power lines. The inverter will also shutdown in the event of DC power loss. My system will have both AC and DC shutdown switched located on the exterior of my shed so the solar system can be completely disconnected and safely shut down.

Getting Into Solar

So due to the rising costs of electricity in my area, I have decided to dive in to solar energy. I am learning as I go and I want to share what I am doing and am open to any suggestions. So far I was able to purchase 30 used solar panels for next to nothing. Only 3 in the lot are broken, but amazingly still produce a good amount of power. Not only do I plan on supplementing my home’s power with solar, I want to move my home network equipment and servers on their own dedicated solar system to further reduce my energy usage. I am still gathering the necessary components to make everything work and to ensure it is all done safely. So far, I have the panels and soon the connectors, combiner box and inverter. I am also installing a rapid DC shutdown switch in case of emergencies. I will share here my progress and what I learn and improve upon as time goes on.

Welcome!

Welcome to my new site! I am working on posting content soon. So far all I have is how I set this site up and instructions on how to do it yourself. This site will contain a little bit of everything from outdoor adventures to electronics and more!