Ford Transit USA Forum banner

Home Assistant for Van Automation

149K views 988 replies 44 participants last post by  larry barello  
#1 · (Edited)
Have you been thinking about how to control all those electrical bits in your van? I started off just thinking of how to control the lights. I could use hard wired switches. But, I didn’t want a bunch of switches all over the van to turn lights on/off. I then started looking at units like the sPOD similar to what I have on my Jeep. It has a nice LCD display too. But, I didn’t want a display for the sPOD and a display for my Victron equipment. I had previously read the thread WIRING: If I had it to do over again..... and while ESP32 looked interesting it seemed like just too much trouble.

Then I found the thread Van automation (Technical Discussion ONLY) where sYfte went into the details of the system he is building which checked a lot of the boxes I wanted to see in a control system. It was in that thread that brío made a comment about Home Assistant which sparked my interest.

Home Assistant is an open source home automation system that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. After a few days of playing around with it I’m convinced it will handle my needs.

Initial Goals
Control lights, water pump and water heater
Monitor fresh/gray tank levels
Monitor and display my Victron system (solar, inverter, batteries)
Access and control the system from a dedicated display as well as a smart phone

Possible Automation
Alarm when batteries reach a low SOC
Alarm when fresh water tank is low
Alarm when gray water tank is full
When connected to AC turn on water heater
When engine is running turn on water heater
When battery is at a 95% and solar panels are at high output turn on water heater
Enable Third party high power mode
Turn all non critical equipment off

As I’m waiting on my 22MY van to be built I’m planning to start putting a Home Assistant system together to see just how much of the above I can accomplish.

There are a few thread on this forum about automating a van but I didn’t see anything specifically for Home Assistant. Perhaps this thread can become a source of information for everyone.

Any input from those using Home Assistant or those thinking of automating their van with Home Assistant is welcome.
 
#606 ·
#3 · (Edited)
#4 ·
It would be nice to run all sensors and devices from a single cable that supplies power and data. I guess this could be some sort of four-strand cable running a protocol like USB, I2C, SPI, Can, etc.

In micro-electronics there is the qwiic standard with a healthy ecosystem of software, off-the-shelf devices and interconnects. Is there a comparable standard that is popular with automotive DIY hackers?
 
#5 ·
We're also planning to go down the Home Assistant route too, we're pretty happy with it for our stationary home automation efforts - but that is months away... I purchased a Waveshare touchscreen IPS display, with the intention of mounting this over the sliding door. Will be interesting to follow along :cool:

Any input from those using Home Assistant or those thinking of automating their van with Home Assistant is welcome.
 
#8 ·
I purchased a Waveshare touchscreen IPS display, with the intention of mounting this over the sliding door.
That is a very cool display.
How do you plan to deploy it? I.e., are you going to plug it into an HDMI port of the same RPI that will be running HA?

One minor annoyance of HA is that they do not officially support running dashboards on the same RPI as the HA server. They really bend everything in the direction of server and clients on different hosts. I ran into the same issue, because early on I decided it would be good for maintainability to run my van's HA instance on a RPI with the official 7" screen. I am still planning to do that, but it has created a lot of extra work. To wit:

The easiest way to install HA on an RPI is to use "HassIO", which is a turnkey install and turns your Pi into an "HA Appliance". This is nice, because it it is fully-supported and HA has features to monitor and manage the underlying OS. Pretty slick, but no ability to use a local browser. If you want to do that, you need to install Debain 11 with your bare hands, and preferably install Docker (a virtualization package) to run HA. In this mode, you can run Debain's window manager, and thus an RPI client. I got this to work, but it was a PITA (given my limited Linux skills). All of this works fine, and the only real downsides are (a) a lot more complexity, and (b) an innocuous warning from HA that you are running on an "unsupported" platform.

Just a head's up.
 
#6 ·
I came across this video a while back, and this thread reminded me of it. The video is for a full RV but might have some good info for you.
 
#9 ·
I'm looking at using an Amazon Fire 7" or 8" tablet running Fully Kiosk as the main interface. I want to mount the RPI back in the electrical compartment of the van so it would be nice to have a display attached directly to the RPI that is displaying the HA views. However, it sounds like the setup is a bit more involved.
 
#11 ·
Yes, my thinking is similar. I have a 7" Fire Tablet running Fully which will be semi-permanently mounted in a cabinet handy to our sofabed area. The RPI screen is intended to be at the "control panel" with the breakers, etc, on the opposite end of the van. It is also possible to build tiny TFT touchscreens for specific purposes using ESPHome. I will probably build one to be mounted on the dash for the few functions one needs to do while driving.

One thing to keep in mind when using a tablet:
The internal battery can easily be damaged when exposed to freezing temperatures, so one may not want to store the rig with a tablet inside. For that reason, I am going to make the screen removable for winterization. Some people remove the batteries entirely, but that is often tricky, because the batteries are "smart".
 
#10 ·
Thanks for starting this thread! I have been working on something similar using a Pi and Node Red. Still trying to decide if I need to switch to Home Assistant and/or use a combination of the two. I have found a few ioT things to help though... Shelly makes an RBGW2 dimmer controller that can be controlled in a number of ways and can be used to either control a single RGB light to do multiple colors or to control 4 separate sets of white led lights. I also ran across a wireless ruuvi temp/humidity sensor that can be directly linked to the Victron Cerbo or most likely directly to Home Assistant. Look forward to what others come up with for Home Assistant.
 
  • Like
Reactions: mototreks
#12 ·
Thanks for starting this thread! I have been working on something similar using a Pi and Node Red. Still trying to decide if I need to switch to Home Assistant and/or use a combination of the two.
HA contains Node Red support, although I haven't tried it yet.
I have found a few ioT things to help though... Shelly makes an RBGW2 dimmer controller that can be controlled in a number of ways and can be used to either control a single RGB light to do multiple colors or to control 4 separate sets of white led lights.
Yes! This is an important module for van use. It works on 12 or 24 volts and has an input terminal that supports simultaneous control with a physical switch and HA. Building a system that fails gracefully is IMO a key issue in a project like this. I don't want a failed RPI to spoil a trip. I just hope they will come out with one that supports RGBWW strips.

The Shelly stuff is great. Integration with HA is excellent and very easy.
I also ran across a wireless ruuvi temp/humidity sensor that can be directly linked to the Victron Cerbo or most likely directly to Home Assistant. Look forward to what others come up with for Home Assistant.
I plan to use numerous temperature sensors. I am using Dallas 1-wire sensors, which are cheap and robust, and have good ESPhome support.
 
#23 · (Edited)
Modbus configuration for accessing Victron information

Searching around on the web I found a few example of how to configure HA to access a Victron CCGX, Cerbo GX or Venus GX. The first example I tried used a syntax supported by an earlier version of HA. After not having any success with that configuration I tried another example and it worked. Guess I should have read the manual ;)

There is a lot on information on the internet about accessing Victron and editing HA configuration files (here's one) I'm not going to go into a bunch of details but here are the highlights of what I learned.

First, you'll want to turn on Modbus on the Victron CCGX, Cerbo GX or Venus GX. Also click on "Available services" to get the device Unit IDs
Image


After that you can modify the configuration file in HA. I chose to use a separate file for my Modbus configuration so I just included that file in the configuration.yaml file
Image


Here is the Modbus configuration. You'll need to use the IP address of your CCGX, Cerbo GX or Venus GC for the host address below. Then you can define the actual data points.
Image


some of the values make more sense if they are scaled to a more meaningful number. Like the Time To Go value which is read as seconds. Here I'm converting it to hours.
Image


Also, some of the values are system states that are better understood when convert to text. I defined these in the configuration.yaml file as they didn't seen to work if I had then the Modbus file.
Image
 
#24 · (Edited)
Modbus configuration for accessing Victron infromation
Thanks for this. Very useful. God I hate YAML.:rolleyes:

Note to beginners: Don't get too turned off by the YAML stuff. It is kind of bad, but is only necessary for certain advanced features. The devs know how bad it is and are working hard to purge it from the HA world. More and more stuff has modern config interfaces rather than requiring YAML.

The first example I tried used a syntax supported by an earlier version of HA. After not having any success with that configuration I tried another example and it worked. Guess I should have read the manual
This is a perennial problem with all large, open-source projects. The Web is full of stuff that doesn't work any more. Makes it really hard to catch up. My trick for this is to always limit my Google searches to the past year. This filters out most of the obsolete stuff.
 
#28 ·
As a person that can appreciate automation (as I have almost 100 items on my home mesh network currently), I'll throw in two cents. I've even considered adding voice control to my trolling motor on my bass boat and my dogs only get to eat when Alexa says "It's time for dinner" LOL. One thing you may want to consider is resale. Is some future owner going to be able to operate it and keep it operational? Are buyers going to look at you with glazed over eyes as you demonstrate turning on the porch light? You could be limiting yourself to a very small percentage of prospective purchasers as most people are "electronically challenged" to say it politely.

I know this first hand. I had WiFi switches all over my last house with 7 Alexa devices. Lights changed color depending on the weather. The driveway gate opened when my trucks installed ESP8266 got in range if it. Computers were centrally located with multiple monitors and keyboards. Automation was everywhere. I had to take it all out to sell the home (since it was all linked to my Alexa/Amazon account and personalized). Realtors showing the home had to be able to turn on the lights and future owners didn't need to be able to order stuff on my Amazon account.

It's all great stuff until something stops working and if you've dealt with automation, you know things need a little tweak now and again. Sometimes I have a hard time even remembering how I made things work when something fails and I have to fix it. If something craps out and you're not the designer of the system, you're really screwed. Even troubleshooting someone else's basic/standard wiring system can be a task let alone a system controlled by code. If you're going to keep the van until it gets crushed, who cares but you may be asking for trouble when the time comes to sell.

All is not lost. I see the attraction. I'd recommend using a standard wiring system (standard switches and hard wiring) and adding automation using additional relays for the automation that can control the system but are not critical to the daily operation. That way if you sell the van, it can still be operated by the new owner without them possessing a computer science degree.

One other though: Document everything you do for future reference. Keep notes on what sensor you use where (with part numbers recorded) and draw up a diagram of how everything is wired. Use multiple colors of wire (not just red and black). Time goes by and you'll forget so put it all in writing.

I really like voice control since my recliner kind of sucks me in for hours a day. You may find this interesting:

OH! Post your progress here. I'm interested and will follow the posts.
 
#29 · (Edited)
All is not lost. I see the attraction. I'd recommend using a standard wiring system (standard switches and hard wiring) and adding automation using additional relays for the automation that can control the system but are not critical to the daily operation.
Yep!
That is exactly why I like things like the Shelly controllers. You can tuck them away in a standard switch box and leave the good-old standard wall switch in place. Doesn't change a thing, but permits automation if you want it. It takes more thought to design this way, but it is almost always possible and is very important for all the reasons you mention. I skipped the whole last generation of RV automation (Silverleaf, etc) precisely because much of it involved central controllers that were in the critical path of routine operation. What happens when these controllers are no longer available?

And don't get me started about "cloud" services that send your request to turn on a light to some server in China.

The reason I have become a Home Assistant enthusiast is precisely because its designers are usually sensitive to these issues. It still takes thought and care, but as I said, it can almost always be accomplished. These systems need to ADD capabilities without asking humans to change their habits.
 
#32 ·
My house is loaded with a hodge-podge of automation. (Evolution over time.) It all sort-of integrates together ok, and works most of the time, but if I had to do it again, I probably wouldn't. My van is so small relative to my house, that my attitude has become KISS. (Keep it simple, smart.)

In my retired years, I am becoming tired of being a slave to technology and my vehicles.

Last time I lost internet for about an hour, I had to spend close to 2 hours making sure, and getting, all the systems to come back up and functional.
By the way, I am a Google home "Hey Google", Samsung "Smart Things", and "Z-wave" kind of person rather than Alexa. (I really try not to support Amazon)
 
#35 ·
I give you credit, there is a lot of good info here on HA and also tying into Victron devices.

I'm just going to say it though, I think this is pretty much waaayyy overkill...even if you live fulltime in your van. This is coming from someone who's house is full of home automation with ESPs, Pi's, Homeseer , zwave, etc. I get the desire to monitor things but I don't see the need for full out automation as I use it in my home. Just my op and 2 cents.
 
#37 ·
...
I'm just going to say it though, I think this is pretty much waaayyy overkill...even if you live fulltime in your van. This is coming from someone who's house is full of home automation with ESPs, Pi's, Homeseer , zwave, etc. I get the desire to monitor things but I don't see the need for full out automation as I use it in my home. Just my op and 2 cents.
I'm with @brío on this. Not meaning to snub you, @Tcaschy021; everything we're doing to our metal tents is overkill. Where's the limit? No limit. "You-do-you," should be the filter through which we consider all our posts. Then, "how am I helping to move the conversation forward," next. Still... I thought it was pretty funny that sYfte relabeled that thread just to try to get the conversation useful and back on-track.

Of course, if someone wants to search my history, I'm certain I've violated this intention, so... don't want to pretend I'm above it either.

The other thread was SO much more technical than I'm ready to dig into right now. And the first post - with everything sYfte is doing - isn't something I want at all - a whole WALL dedicated to a display of electronics? Oh, **** no. Servers, storage, HA, and AV gear are all hidden in closets and the attic at the house; I want them invisible. And I want the easier version of integrating stuff. So maybe this thread is more on that track.
 
#36 ·
Might I respectfully request that this thread not be allowed to degenerate into yet another debate about why one might or might not want to automate a van. There are plenty of other threads on this topic. Here is my contribution to one of them:
Yes, despite that thread's topic, it succumbed to non-technical discussions.

It would be really nice if at least one thread could be reserved for a technical discussion for those of us who are interested.
 
#38 ·
+1 there are those that have decided to add some level of automation for whatever reason. This isn't a discussion of if one should do it, it's about adding automation with Home Assistant. Though, if anyone sees me heading down a rabbit hole with some aspect of HA I do hope they point that out :unsure:

So in spirit with what @gregoryx said, "how am I helping to move the conversation forward"; I received my Amazon Fire 7 the other day. I had been doing some research on using it as a dedicated HA interface so it didn't take long to clean it up with Fire Toolbox and install Fully Kiosk

here is a video on Fully Kiosk capabilities

And here are my HA views on the Fire.
Image


and because we have been talking about Victron stuff. If you click that Victron CCGX button you get this in a new browser window.
Image


So far I like how Fully Kiosk works. The motion detection to wake the display up has been working out better than I thought too.

Does anyone know how to remove these parts of the HA display?
Image
 
#39 ·
Moving on...
While we are on the topic of Shelly devices, two points:
1) The aforementioned Shelly RGBW2 is (obviously) just a four-channel PWM controller. This means that in addition to controlling LEDs, it can also be used as a PWM motor speed controller. It is rated at 45 watts per channel, or a total of 144 watts. One channel is not quite enough to control the speed of a Maxxfan, but would be plenty for a computer fan, etc. Not sure if you can gang multiple channels.
2) Another Home Assistant-friendly Shelly product is the SHELLY-1. This is just like the RGBW2, except that instead of four PWM channels, it has a single 15A dry contact output. It can be configured to operate either at 120VAC, 12VDC, or 24-60VDC. They sell for less than $15, so they are kind of a Swiss-army-knife of binary control.
 
#121 ·
2) Another Home Assistant-friendly Shelly product is the SHELLY-1. This is just like the RGBW2, except that instead of four PWM channels, it has a single 15A dry contact output. It can be configured to operate either at 120VAC, 12VDC, or 24-60VDC. They sell for less than $15, so they are kind of a Swiss-army-knife of binary control.
I'm thinking about using a few Shelly Plus 1 for remote on/off switching in the van. Shelly says power can be "110 - 240 VAC / 24 - 48 VDC / 12 VDC ±10%" , which would mean max 13.2V for a 12V system, which I have. That is a little low when SOC is on the upper end. Any real life experience as to whether these devices can handle up to 14.2V?
 
#43 ·
Modbus output to control solar charger

I wanted to make sure I could output values to the Victron hardware so I added some buttons on the front-end to turn the solar controller charger on/off

Image


To configure the button you need to set the tap action to "Call Service" and the service to "Modbus: Write Register"
Image


Then configure address to write to, the slave id of the solar controller, the value to turn the charger off (a value of 1 turns the charger on) and the Victron hub
Image
 
#49 ·
Shelly RGBW2 Relay

Since @brío had been talking about this Shelly device so much I order one. Fired it up this morning and after using the smartphone app to configuring the WIFI router password it downloaded a new firmware and was listed on my router. HA picked it up as a new device and there it was. I could control the RGBW strip (If I had one).

I switched it over to "White" mode so that I had 4 separate replays I could play with.
Image


Image


When I talked to the tech people at sPOD and RedARC about controlling their relays via a hardwired switch and their system both said it could be done but that either the switch would have final control or their system would override the switch (But then the switch would be in the wrong state).

Turns out Shelly implements their interface to a switch multiple ways with a toggle on/off switch being the default. But, they also have a Momentary option too.
Image


With the RGBW2 set to Momentary, push a momentary switch and all lights are switched to "on" in HA and the smartphone app. Turn it off on either of those and the other displays the switch as "off". Response time is pretty quick too. Unfortunately, it turns all the relays on. That won't be a big problem in how I envision using this as I could see having a monetary switch at the entrance to the van that turned on a set of lights - like the galley lights with a single RGBW2 device. Other lights could share a RGBW2 device or have a dedicated one.

I noticed a Power On Default setting
Image


But, while this setting could be defined for each of the relays, I could only get it to work if all of the relays had the same setting. I've asked Shelly tech support about this so I'll see what they say.

All in all I'd say this is a nice little device for $14 - thanks @brio
 

Attachments

#51 ·
All in all I'd say this is a nice little device for $14 - thanks @brio
My pleasure. Aren't you glad I'm not an "I told you so" kind of guy? :)

Between the RGBW for PWM applications (like LEDs and motor control), and the Shelly-1 for dry contact relays (tank heaters, water pump...), Shelly can handle just about all simple control applications.
 
#52 ·
I had to give that a try. If you use a short push of the momentary switch the relays turn on to a preset (or maybe the previous) level. Once on, if you press and hold the switch the brightness level is adjusted up to 100% and then starts to go down. It also looked like the the same thing happened if, when off, you just pressed the switch and held it.
 
#53 ·
Can I safely assume that the Victron stuff provides some way for HA to tell that I am currently connected to shore power? I ask because my current rig has an AC relay used to drive an alarm when I try to drive off while plugged in. I'm assuming that this hardware would be redundant in my new van. True?
 
#54 ·
Yes - But.....

There is a register you can read, "Active Input Source (address 826)", which values are documented as 0=Unknown;1=Grid;2=Generator;3=Shore power;240=Not connected

So, when I'm connected to shore power I see a value of 3
Image


and if not connected 240
Image


But, if I turn the AC Current limit value to 0 (on my Victron multi control) The Power source reads 240 and the AC Current limit via Modbus reads 7.5

So, you could still be physically plugged into shore power and have a Source Power reading of 240 (Not Connected) when:

1) The shore power circuit breaker is off
2) The Input Limit value is "7.5"

I would think there is away to tell that 7.5 = off but I've not looked into how to adjust the AC Limit Value yet. I was going to read the code for GUI Mods that @gregoryx provided before I give that a try.
 
#62 ·
It's a bit of a hack, but this should get you going: Add service integration.reload

The rest of the thread can provide you a bit of context.
I’ll have to digest that thread a bit but at first glance it looks like it could work.
I would have thought an integration that’s location dependent would refresh the location based on a defined “zone”. Oh well, I’ve got to stop thinking 🤔