question

techie4hire avatar image
techie4hire asked

Controlling a 120V outlet based on temperature using Venus OS on RPi

What's the easiest way to control a 120V outlet, based on outdoor temperature, using the Venus OS running on a Raspberry Pi 3B+?. I've updated the OS to version 2.92, and have ordered several Ruuvi sensors. I also have the Victron Smart Battery Sense module installed.

I store my off-road camping trailer high in the Colorado mountains, where we have many nights with temperatures below the 25F threshold for my LiFePO4 battery. It's plugged-in though when stored, and I have a battery warming wrap -- I just don't want to leave the wrap plugged in all the time.

I'd love to be able to use something like a TP-Link smart outlet (WiFi), or anything Zwave or Zigbee would be fine too. I'd also consider using DuPont wires off of the GPIO pins on the Pi, though that would be my last choice as the length of these control cables seems pretty limited.

For those that have something like this setup -- what are you using, and has it been reliable?

Venus OSNode-REDRaspberry Pi
1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

techie4hire avatar image techie4hire commented ·

My understanding is that the more recent versions of the Venus OS have the ability to trigger an event based on temperature, so I'd like to utilize that. The question is, what's the most straightforward way to have that trigger control a 120V outlet?

As I said, the trailer is plugged into shore power when stored, and this is when the need arises to keep the battery warm -- so no reason to deplete the battery with a 12V warmer.

Looks like I can do it using a relay-controlled 120V power strip off the GPIO pins on the Pi, but the control wires would need to be shorter than practical for my installation -- hence the desire to do something wireless.

0 Likes 0 ·
4 Answers
techie4hire avatar image
techie4hire answered ·

Turned out to be not too difficult of a project using Node-RED, a RuuviTag, and one of these smart outlets:

https://www.amazon.com/dp/B09D68P39F

re-flashed with Tasmota using the in-built Kauf Web UI:

http://ota.tasmota.com/tasmota/release/tasmota.bin.gz

The Node-RED flow looks like this:

screenshot-2022-11-23-192124.png

The latest Venus OS Large on the Raspberry Pi includes Node-RED, and you need to grab the following nodes to build your flow:

Victron temperature sensor node -

screenshot-2022-11-23-190750.png

A couple of switch nodes -screenshot-2022-11-23-190821.png


and an http request node -

screenshot-2022-11-23-193536.png


The second switch node would setup the alternate < 0C switch, and the second http request node would change the last part of the http string to on.

Thanks to @Drizzt321 for suggesting a device running ESPHome or Tasmota.


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

drizzt321 avatar image
drizzt321 answered ·

Well, I'm not too familiar with VenusOS under-the-hood, but you can flash one of those TP-Link (probably) to ESPHome/Tasmota and signal to turn on/off that way.

Why does it need to be a 120v power? Something like https://www.athom.tech/blank-1/1ch-inching-self-lock-relay running Tasmota or ESPHome (they have both versions) can easily run direct off the battery with a temp sensor to detect when it's too cold, and turn on. That way you also won't have inverter standby power draw.

Otherwise, something like https://smile.amazon.com/Inkbird-Temperature-Controller-Fahrenheit-Thermostat/dp/B0152LYY0I or https://smile.amazon.com/Inkbird-Temperature-Controller-Controlling-Fermentation/dp/B07PVBG8K1. Otherwise you could probably run, easily enough, control via https://smile.amazon.com/Power-Relay-Module-Control-Voltage/dp/B089QCG6GK relay, or pop a arduino with temp sensor to turn on/off the 120v.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

techie4hire avatar image
techie4hire answered ·

Hopefully someone with some experience with Node-Red will see this, and be able to offer an opinion on whether this package should be installable on an RPi running Venus OS 2.92:

https://github.com/biddster/node-red-contrib-hs100

If so, it looks like I could then control a TP-Link HS-100 WiFi Smart Plug via a Node-Red Flow.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

sharpener avatar image
sharpener answered ·

How about a 120V thermostat from your local heating supplies shop? Or from an old fridge. Much less to go wrong <g>

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.