Home Assistant on RPi in a boat, connecting it to my home?

Sounds great! OpenCPN is really nice. It could easily be used as a primary chartplotter and radar display. I would love to go that path, but for the cost of a daylight-readable, weather-resistant touch-screen display and all the associated hardware, I could almost buy a dedicated off-the-shelf unit.

Anyway, never mind the HA stuff, we want pictures of that boat!

OT This is the registration of my ship
More info on my website (just google my name without space)

More on topic. It is not only cost what drives me. It is the flexibility of diy. I’m a very old UNIX man from the start in 1976 in The Netherlands. Using open source, programming in C and Python.

On board of the Bollejan I have a RP4 running Openplotter and OpenCPN and a few RP Zero W gathering data. The LAN runs on a Huawei ES885Ls-93a Mobile WiFi Pro2, which connects to my provider
with a dataplan of 100 GB and eventually more.
On a RP3B+ I have installed Home Assistant and OpenVPN.

That is the situation now. I hope to integrate HA and the K-protocol of Openplotter.
Read the docs.

Maybe there is someone out there to point me in the right direction.

Cheers

She’s beautiful! It is great to see someone taking such great care of an older boat.

It sounds like you are already going in the right direction. There’s been a lot of talk about Signal-K, and I like the idea of an open-source protocol. I think if you’re starting from OpenCPN and OpenPlotter, that’s probably the way to go. For off-the-shelf hardware, however, NMEA is going to be needed.

There was a good discussion about this some time ago:

Thanks Tom. NMEA is easily handled by Signal-K: my GPS data, temperature and depth, AIS data
all NMEA is multiplexed in Signal-K.
I’ll look at the discussion you pointed to

Cheers

My plan is not working. My ISP is blocking all ports on my mobile access point, even port 80 and 443. So vpn is useless. But the Home Assistant Cloud is working.
For a $5 a month subscription I can get to my HA on board from everywhere. That is working great!

Now up to connecting HA with Signal-K and sensors and switches on board of the Bollejan.

Cheers

1 Like

This topic got me some motivation to try out a few more things myself. So I installed a Signal-K server on the Pi (over OpenPlotter) and connected my AIS to it over NMEA0183. Right now I used a simple RS232 to USB converter because I had one lying around, but eventually that will go over the Pi’s UART directly. I managed to create an AP and to retransmit the NMEA phrases over the Wifi. Pretty cool suddenly seeing the other boats around me popping up on Navionics on my tablet :grinning:

Did you manage to connect HA to the Signal-K server ? And do you have any plans on what you would actually use HA for when connected with the NMEA network ?

I mean aside from the obvious technical fun factor, I wonder if there is any real use behind this. Signal-K can be automated directly with scripts or with Node Red. There’s a ton of plugins and webapps for Signal-K (I was seriously surprised by the amount !). Logging works with influxdb and Grafana. So maybe HAs primary use here would indeed be remote surveillance ? Hmm.

1 Like

Watching. I setup an HA instance and have been messing around - my only reason when I return back to liveaboard boat live in the next couple of years (we cruised the caribbean for 3 years on a catamaran). There is so much home assistant can do its mind boggling. I am interested in pulling canbus data in grafana - a useful took for engine monitoring and looking for potential engine issues through data trends. Then there is basic security system and monitoring system for tank levels. I am watching the level of monitoring aboard seawolf on the vendee round the world solo race. They have all rigging and hydrofoil load monitored and pushed up in realtime - display thanks to grafana. Link will only be alive for maybe another month or so but check it out
https://exocet.cloud/grafana/d/bsbc_5MGz/malizia-public-dashboard?orgId=15&from=now-96h&to=now&theme=dark&kiosk&fbclid=IwAR34Yb8buf8yIoWK5aZBRr1V0caOsbFIlPEi9vfnMaU5nL7UZfBtoJC04hM
Also interested in energy monitoring and light control. This guy was pulling data out of his victron into HA and just did a talk about it a couple of weeks ago on the HA conference.
https://broccolibus.com/
There is a signalK nodeRed integration so probably some hooks into HA via this interface. I am noob so just guessing. Was hoping DRzzz’s would start looking at the HA on his RV, this and boating is the next extension of the platform and might even be worthy of its own forum category. Waiting / looking for 12v smart plugs, switches etc for lighting control. Anchor drag alarm to HA on your phone while ashore?

I had started a setup, but I’m now starting from scratch again.
I had Raspbian + Home Assistant manually installed on a RPi, so I could easily SSH in an install other services as well. But I found that there is more than enough to do aboard a boat, I don’t want to have to manage the RPi OS as well. So I went with the image install, which makes HA run like an appliance instead. So much easier to manage, but anything you’d want to add that’s not a feature of HA you will have to run in a Docker image.
A bit more hassle, but I guess much more stable and reliable.

I found that between the trips to the boat (I don’t live there) I kinda forgot what I was doing the last time, so I need a more “plug and play” approach for Home Assistant.

I have another thread here regarding installing GPSD and setting up a service so I can send data to MarineTraffic (I don’t have a AIS transmitter). This is mostly “just for fun” as it doesn’t really do anything else than log my trips.
Anyways - using Home Assistant as an appliance means that this has to be manually installed in Docker, which again means I have to get more acquainted with both Docker and GPSD. I’ll see if I can get this working in the near future. I kinda want to make an AIO Docker image that takes a GPS and mail setup and then automatically sends to MarineTraffic.
Or maybe a better way - GPSD in a separate docker + a mail sending service.

I made some comments on your other thread. Trying not to drift too far here.

I’m still trying to design my overall architecture for HA aboard. There’s an obvious path to running something like OpenCPN on a RPi onboard. There’s a lot of active development there, and it’s all set up to integrate navigation functions. In other words, you have chartplotter, anchor alarm, GPS location, AIS, radar, depth, engine monitoring, environment, location tracking and a bunch of other functions there already. Or you can buy an off-the-shelf, ruggedized, waterproof, sunlight-readable MFD which does all this in a single, plug-and-play appliance. Much as I love OpenCPN and tinkering, it’s really hard to justify for something as critical as a primary navigation instrument. Maybe as a backup in the skipper’s cabin for use while off watch.

Then there’s the fun stuff like controlling lighting, cameras, temperature and door sensors, etc. And quasi-critical stuff like monitoring bilge pumps, burglar alarms or remote monitoring. I think this is where a dedicated RPi for HA would be great.

Using a site like MarineTraffic for tracking, by sending simulated AIS data to it, is in the “fun” category, IMHO. It’s useless for navigation because of the latency and the fact that it’s only as good as your WiFi connection to the back-end server. Given that the cost of real AIS transceivers has become reasonable (relative to other boat gear) I really don’t see that as worth the effort. If you’re getting underway near any busy port, AIS is moving into the realm of essential safety equipment nowadays.

I do have an AIS receiver on my VHF, which again will be connected to my Raymarine MFD.

I am separating the two systems, the NMEA network and Raymarine system will be the essential nav system, mostly because of reliability.

But my HA setup will always be active. An anchor alarm would be nice on the HA system though!
I’m also thinking of Y-wiring switches to a relay, so that I can control them by wifi. But I always want the switch panel to override - if it is switched on, wifi can’t switch off etc.

Bilge pump monitoring and remote monitoring/alarm is what I’m aiming for with the RPi/HA setup.

So MarineTraffic - yes’s just a “fun” setup for making it possible to track the boat through 4G/5G, even though it won’t appear for others with an AIS receiver.
AIS transceivers with dedicated antenna here are approx $800, and an autopilot is $1200, so I won’t be prioritizing transmitting AIS just yet.

Agreed, I have a RP3 B+ running HA on board as “Boat Assistant”. Using a Nabu Casa subscription as an inbetween. So I can put on/off my heating system, run my webcam from my bedroom, switch on/off the cabin lights, etc. This i only a start!! IMG_20201018_225638|666x500
Is this fun or so?

The coming season I will have a RPi 4 8G with a Pican-M Hat running the navigational part with OpenPlotter, OpenCPN. In the center the Signal-K server. Jigsawing
The AIS transponder data, GPS data and other will all be handled by the NMEA 2000-Signal K connection. The RPi 4 and the housing comes from Freva: See the shop

The same Raspberry Pi will be the center of Internet. I have a Pepwave BR1 MK2 router with dual sim (KPN unlimited data and T-mobile idem), a MicroTik Groove A 52 ac for wifi connections in harbours and as a backup my good old Huawei ES885SLs-93a with a Vodafone sim card. Redundancy!

I’m still learning. I hope to get the Pepwave doing port forwarding to OpenVPN on the RPi.

2 Likes

Sorry. Wrong picture. Please ignore!

I like the philosophy here. I left some old, but still working, gear alone on its own NMEA 0183 network when I added newer NMEA 2000 stuff. But I also took the opportunity to cross-connect some where it would be helpful. You can never have too much information, or too many ways to access it, at the helm. As long as you remember that looking out the window is more important than all of it.

I think some folks forget this with their home HA setups. Manual control should always be available. As for letting HA override, I might want to be able to shut off some things remotely, but I like the idea of having others that can’t be.

I’m starting to feel that an AIS transceiver is not really a luxury any more if you’re doing any kind of cruising on coastal waters or rivers. They aren’t cheap, but that’s true of so many much less critical boating-related products.

An autopilot is a huge benefit in some waters, not so much in others. But again, the effort to hobble together a DIY autopilot, along with the reliability hit you take, leaves very little justification for the cost differential. Even if you can save a bit with open-source software, you still have a lot of hardware to install.

The HA setup will be on power at all times, but I’m also installing Axon AX-520 for each battery. These are each operated by a dual throw momentary switch, which means that I can easily attach relays to each side, meaning that as long as I can make Home Assistant only momentarily activate the relay, I will be able to turn on/off battery banks remotely, or even automate it based on other conditions (turning on battery or lights when I’m near the boat f.ex.)

I don’t want to mess too much with it though. Lets say the GPS stops working and Home Assistant thinks my phone and the boat are at two different locations, and then automatically switch off the battery banks while being underway…
Weighing convenience and reliability suddenly matters a lot when you’re moving 5 tons at 30 knots.

Very good point. Most boating gear, including chartplotters and AIS, appear grossly overpriced. But when you look at it from a life safety perspective, sometimes you can justify buying reliable, purpose-built hardware.

I’m not familiar with the dual throw momentary switch setup you mention. I understand what a double-throw switch is, and what a momentary switch is, but I don’t get how that would help you swap battery banks remotely. You mention a relay, but of course that would be another power drain, one way or the other. I’ve run boats with battery isolators which separate the banks when the voltage drops below charging voltage, but that doesn’t sound like what you’re after.

These days, solar panels are cheap enough that you should never worry about batteries going flat because of a few electronics left on to monitor the boat. You didn’t mention solar, so I figured I’d throw that in.

To me, the approach should be KISS. Proven, simple, reliable, mechanical components for key functions like bilge pumps and electrical systems. Off-the-shelf components for safety and navigation systems. And have a ball playing with DIY solutions for monitoring, remote control, etc.

AX-520 has a solid state relay/switch, it only needs a tiny amount of power to enable/disable, which is where the momentary switch comes in. It basically means that you can turn on the main breakers from the dash in your boat (or anywhere else you place the buttons).

The relays would be controlled by Home Assistant, only on/off 1-2 seconds, using no power. In other words, they are just mimicking the momentary switches.

The AX-520 uses no power while switched on or off, only a few mA for the actual switching.

Cool! I would have called it bistable switch. But glad to know such a thing exists!

Yeah, I had no idea and found it by accident. I wouldn’t call it a perfect premium product, but considering a motorized BEP switch is $350, I paid in total $250 for 2x AX-520 + 1x AX-521 (DVSR) including shipping and taxes. And that included three switches and hardware.

Bit offtopic, but I really consider an autopilot essential equipment for any kind of serious sailing. Especially if you often sail alone or with very reduced crew. The hardware side, that is. Software integration with WP following, remote heading control and such is a bonus, but not really that useful especially with sail boats. I do have it hardwired to the anemometer though over NMEA. The important part really being able to simply hit that button and being able to leave the tiller or wheel in seconds, if needed.

For really long trips, like crossing the Atlantic or similar, I’m a big fan of low tech windvane steering. No power use, no software crashes :slightly_smiling_face: A bit finicky to set up, but once it runs you’re good, as long as the wind direction doesn’t change too much.

About AIS, definitely super important for safety. To be perfectly honest though, I often switch off TX when just doing some coastal cruising. I don’t like random (or not so random) people being able to follow my every step on Marinetraffic or Vesselfinder or similar. I always leave RX on though.

And for some ontopic stuff: I ended up removing HA from the boat. I only run Signal-K now (installed over OpenPlotter on a Pi), basically as a glorified NMEA multiplexer and onboard Wifi AP because I’m too cheap for a MiniPlex. It works nicely, although Signal-K has a learning curve too. The Pi also runs OpenCPN, but that’s mostly for toying around and as a backup.

1 Like

Hi DIYglenn.,
I have a similar setup on my boat … openplotter running on a RPi interfaced via N2K and NMEA0183 to my (Furuno) navigaqtion system.
I am keen to also get HA running on the boat … and my question is: Can I run this on the same RPi which is ruynning openplotter, or do I need a separate RPi?
I already have another RPi running the Victron VenusOS for my power management.