Need help creating automation for Solar project


I am new to Hubitat. So far, I have two Z-wave smart plugs with Power Metering connected to my Hubitat.

I am attempting to use extra solar power to trigger a heater to turn on when my batteries are full and the sun is shining.

I have set up a relay to provide 120v AC to an outlet (relay outlet) only when batteries are full and sun is shining.

I have one of my smart plugs in the relay outlet. I have my other plug in another room and have a heater plugged into it (heater outlet)

When the relay outlet is energized, I want that to trigger the heater outlet plug to turn on. When the relay outlet is de-energized, I want that to trigger the heater plug to turn off. I need this to be fail safe so that the heater outlet is only on when the relay outlet is energized. Ideally the heater outlet would do some sort of "check in" every 5 minutes to confirm the relay outlet is energized and would turn off if it wasn't energized or it lost communication.

Can anyone out there suggest a rule that would work for this problem?

It might be possible to use Device Watchdog to determine if the solar relay is “live” or not. However, un-powering a Z-Wave device is generally a bad idea.

Alternatively, you could use a device like the Ring Gen 2 Ring Extender to detect if there is power to a 120v outlet. It might also be possible to use the Shelly Uni to determine the battery voltage and only turn it on when it is high enough.

Does that help?

Thanks a lot for the reply and suggestions. I need to look into the device watchdog - that looks like it has potential.

I don't think Shelly Uni will work for my application.

Thanks for letting me know about the bad idea to power on and off Z-wave devices.

I think my biggest issue is going to be finding a dependable solution - it would be a disaster for my heater to ever remain on when there isn't power to the relay outlet and I am not sure hubitat is dependable enough - I need the heater plug to be smart enough to turn itself off if everything isn't working or communicating...

1 Like

Clarify "disaster." Are we talking risk to life and property or just a larger than expected energy bill?

In industrial controls we sometimes use two smart devices... one on each end of the link. The failsafe device expects some sort of "keep alive" or "heartbeat" from the central controller. If it doesn't get that signal, it defaults to local control, typically into a "safe" state. Maybe you could do this with something like the Zooz ZEN25. It's a smart plug that has an auto off setting. You could use this to your advantage...

  1. Zooz plug set with an auto off time of 10 minutes.
  2. HE rule(s) send an ON command to the plug every 5 minutes when there is extra power, and OFF when there isn't.
  3. Comm failure or hub lockup results in a timeout and the zooz plug turns itself off after 10 minutes.

This might get you closer to what you were looking for, but I wouldn't trust it in a "risk to life or property" scenario.

1 Like

Disregard....I was WAY off in my assumption here...

Reading between the lines here a bit.... is this a pool heater or similar where the relay outlet is a pump? If yes, then you are correct that it would be a disaster for the heater to run without the pump. If this is your application, I might think twice about using HE as the brains of the setup. If you do go this way, you should have at least two physical safety devices like a high temperature cut-out switch AND a T&P valve routed to a safe discharge.

Just a guess, but I'd say the "disaster" would be drawing the batteries down too far/too fast, risking damaging them, or not having power to operate the house/shed/whatever.

At the risk of being redundant and saying the same thing over....the way I read it, @javi may trying to heat a space (perhaps where the battery is stored to keep it above the low temp cutoff), but ONLY when the Sun is providing enough current to do so -- and the risk reduction is to prevent damaging the battery.

Or -- I'm totally off base!


1 Like

Thanks for the reply. The "disaster" is that my off-grid batteries will be worn down so low, that I won't have power to run refrigerator and other important loads until the sun shines again. I do have a BMS (battery management system) on each battery, so if that works the batteries themselves shouldn't be damaged. Even though I have a rather large battery system for my needs (14.2Kwh), it would get drained very fast with no solar input and resistance heater...

I realize I should have given more details. The batteries and "relay outlet" are in my solar shed, which is about 60 feet away from my cabin. The cabin is a small one and I look at the heater as a way to get supplemental heat to our cabin during the cold months when we aren't there to keep the woodburning stove going or when we are away from the cabin completely (travelling) and want it to stay as warm as possible.

I really like the "industrial solution" of two smart devices. I will look into the Zooz ZEN25.

Thanks for the ideas! This is my first look at home automation and I can tell its going to be pretty fun to get some other automations going that are just helpful and interesting and don't have a "disaster" component to them...

Good guess, Scottgu3! Yes, the "disaster" involves the battery getting run down too low and I am trying to heat my living space (batteries already have separate heating system since they are Lithium batteries) with the extra energy available when the sun is shining and my batteries are mostly full...

I just ordered the Zooz Zen25 plug from Amazon. I think it is great for my heater outlet and will provide some "fail-safe protection" to my batteries being run down.

As for which smart plug to use for the Outlet relay, right now I have the FIBARO Wall Plug with USB Charger Z-Wave Plus Intelligent Socket, FGWPB-121. This seems good for that because it monitors voltage and can send a signal to HE whenever voltage is over 110V. BUT Sebastien said unpowering Z-wave devices is generally a bad idea, so I am wondering if anyone has any better ideas for the Outlet relay?

I can imagine a workaround being something like having a light plugged into the Outlet relay and have a lux sensor plugged into a different "always on" outlet (which could signal to HE whenever light is on and tell the Heater outlet to stay on). This seems like it could work, but maybe one of the smart people here has a better idea that isn't so convoluted...

I'm glad my post was helpful!

What is connected to this plug and how do you want to automate it?

I think I would personally take a more semi-automatic approach to this. The auxiliary heat is obviously less important than keeping food from perishing.

Consider that you likely only be need a resistive heater to be active when you are present (since they are so inefficient to use for unoccupied rooms). Therefore I personally would just use a motion sensor to control an outlet for the heater. When you leave the room, have a rule either turn off the outlet immediately or you could have it wait for a timeout period after the room is vacant, and then shut off.

I would not trust automations to never fail, so instead I would suggest you monitor the power level of the batteries manually and decide whether to turn the heater on, allowing the motion sensor to turn it off in case you forget to manually turn it off yourself.

Nothing is connected to the Fibaro plug. I was thinking of using it just to sense when there is live voltage available on the Relay outlet which would trigger the Heater outlet to provide power. But it will be cycled on and off a bunch and sounds like it isn't good for Z-wave. Would Zigbee work better with this power cycling?

Basically looking for a way to signal to HE to activate Heater outlet smartplug whenever there is 120vAC available on the Relay outlet.

Zooz's direct store... they have a power outage kit that is exactly what you are looking for. It uses a battery powered sensor, so no mesh issues with power cycling like a standard repeater will cause.

Just don't browse around the site too much or you're likely to spend more than you intended... :wink:

Awesome! I just ordered it and I think that will work great for my application. Its always hard when you get into something new to know all the things you don't know lol. Thanks for all your help in figuring out good solutions - I am excited to get this going!

1 Like

Thanks! I just saw this and appreciate the feedback. I have been doing just as you suggest so far and its a bit tedious - that is why I was looking for automation.

Its a little complicated to describe the whole system, but it will be okay if it works 98% of the time - if I am at the cabin when it fails, I can always start a generator to get batteries charged. If I am not there and it fails, it will likely be during winter and the cabin will be cold, so fridge contents won't immediately spoiled...

Honestly, I am enjoying the process of exploring automation and will try to make it work as is...most of the parts I am buying will have other applications to enjoy if this whole experiment doesn't work...

1 Like

I would still use something like device watchdog and test it thoroughly. It's still possible that the sensor battery could fail, it could lose communication, or some other problem could cause it not to report as expected.

So that is to say you have researched the optimal ambient conditions for those batteries to yield optimal storage and cycles.

Could you give a quick brief on how you are providing that environment? I ask because I have a winter application where the best low cost solution I could see doing in this regard, without USING power, was to place the battery in an in-ground irrigation box with the lid getting warmed by the sun through the day. Seems "good enough" but maybe I could do better.

Yes, I will test a bunch while I can watch it. Since the heater plug (Zen25) will be programmed to turn off after certain time, I hope that I will avoid two failures at same time...I will test test test

Sure - well, my batteries consist of (2) 24v 7.1Kwh LifePo4 battery packs in parallel. They can take a charge above 32F and discharge down to 15F. Each battery is a little different, so always good to contact manufacturer for these specs. I believe ideal ambient for my batteries is right around 70F.

I have both packs in an insulated box and on each side of the box, I have attached these - ABN Silicone Heating Pad 120V - 2 x 5 Inch Universal Engine Heater Pad, 50W. They are plugged into a Johnson Control A421 temp controller set to give power to the heating pads whenever the temp inside the box gets below 55 degrees. Between the heating pad and the batteries, I have a 1/2" thick aluminum plate that is about 6"x12" which moderates the direct heat the batteries receive from the heating pad.

Even though my batteries work in lower temps - best temp for longevity is around 70F. I compromised with 55-60F.

This is my first winter using this system, but it has worked well so far. I am in wisconsin and we had a cold week in November where it was highs in low 30's and lows in teens. During this week, my box heater used about 400Wh/day to keep batteries between 55-6F. My BMS's and Charge Controller have low temp cutoff set to 35F in case this heater set-up fails. If it takes too much energy to keep them warm when really cold comes, I will lower the set point so the heater turns on at cooler temps.

I thought about burying a box, but I wanted more access to them and worries about humidity. In Wisconsin, I would have to bury it a bunch to keep from freezing - maybe not where you live...

Here is a set up similiar to mine - LiFePO4 Battery Warmer Install | DIY Solar Power Forum. That forum has lots more ideas for heating batteries.

1 Like

Wow, you have thought it out.
Not in your part of the country anymore...while colder than hell in the winter, it's beautiful.

Your case is more cold severe than mine. It may be more work than it's worth (and certainly not helpful during those overcast stretches in January) but I wonder if some solar tube or even glycol solar panel system could heat that box with less power consumption.