家庭助理浇我的植物。
Home Assistant waters my plants

原始链接: https://finnian.io/blog/home-assistant-waters-my-plants/

## 智能家居与花园:Home Assistant 出于对烹饪的热爱和对自动化的“极客”兴趣,作者开始了一个智能家居项目,从花园灌溉系统入手。目标是寻找一个简单、安全、廉价且可扩展的解决方案,避免云依赖。 他们选择了一台运行Proxmox的Beelink迷你电脑来托管Home Assistant,这是一个用于控制设备和自动化任务的平台。选择了一个Link-Tap Q1单元来控制灌溉区域,并通过本地MQTT服务器集成。这使得能够根据天气预报进行自动化调度,并为区域活动提供推送通知。 在灌溉之外,增加了一个SONOFF Zigbee dongle,从而在整个房产中建立了一个温度、土壤湿度和湿度传感器网络。使用Cloudflare Tunnels和WARP VPN确保了远程访问的安全性。 虽然项目总体上是成功的,但也遇到了一些小问题,例如偶尔的传感器数据丢失和启动失败(可能可以通过更改内核参数解决)。未来的计划包括添加媒体服务器、能源监控,以及扩展花园,增加更多自动化灌溉,甚至可能建造温室。

## 家庭助理用于植物浇水:讨论 这个Hacker News帖子讨论了设置家庭助理(HA)以自动化诸如植物浇水之类的任务的复杂性。虽然HA提供了强大的家庭自动化功能,但许多评论者发现初始设置出乎意料地复杂,即使对于有经验的开发者来说也是如此。 讨论强调了在Docker容器中运行HA与使用家庭助理操作系统(HAOS)之间的争论,通常建议使用HAOS以方便使用和完全访问所有功能。有人提出了对Raspberry Pi上SD卡磨损的担忧,建议使用SSD或其他硬件,如Intel NUC。 许多用户强调了功能蔓延的可能性以及HA惊人的高资源需求,特别是使用ESPHome等插件时。一些人提倡为特定任务使用更简单、专门的解决方案,而另一些人则赞扬了HA的多功能性和集成能力。最终,这个帖子展示了强大、可定制系统与更简单、更精简的家庭自动化方法之间的权衡。 几位用户分享了使用各种硬件和软件组合的成功设置,展示了实现智能家居的多种途径。
相关文章

原文

Some readers will know, but most will not, that I am a bit of a self-confessed foodie. I enjoy cooking, but especially so when others get enjoyment from it. Be it friends, family, or neighbours, and sometimes all three, I’m always up for putting something together.

Food isn’t what this post is about, but it’s the underlying motivation for much of the things I talk about, mingled with a healthy dose of nerdism.

At work, some of my colleagues enjoy tinkering with Home Assistant. For anyone unfamiliar, HA is a platform for collecting data from devices, controlling them, and running automations. It’s pretty cool. I was unfamiliar with it, but it sounded pretty cool. OK, so we have a solution. Now to find a problem.

My property has a basic irrigation system for the lawns. 6 zones, you attach the right hose to the tap and let it run until you remember to turn it off. All well and good, but I figured it could be smarter and safer. So, that became the first thing I decided to solve with Home Assistant.

Here are the requirements for the system:

  1. Simple. No crazy electronics.
  2. Safe. Pissing water out for 24h would be bad.
  3. Cheap. Let’s not break the bank.
  4. Build in an extendible way to pave the path for future ideas.
  5. Observable. I want proof it’s all working properly.
  6. Run unsupervised.
  7. Avoid cloud dependency where possible (a common desire for Home Assistant users)

The hardest part was choosing some hardware for this new platform. I didn’t want to mess around building a server, something off the shelf would suffice. I ended up going with a Beelink EQ14 Intel Twin Lake N150 which seemed like a good fit. It has a 500GB SSD, gigabit ethernet, 16GB RAM and a decent CPU. I paid $259 USD shipped to NZ. It’s definitely overkill for running Home Assistant and a couple of containers, but I wanted some headroom for future projects like a media server and it uses very little power.

Going back to my first use-case for Home Assistant (irrigation), I needed something to control water flow. Various solutions exist, from off the shelf to DIY, but I didn’t want to muck around with custom electronics in close proximity to water, where the failure state is a flood. I also wanted something that operated locally to the property and didn’t require cloud connection. I stumbled across Link-Tap which can either run as a cloud client or it can use a local MQTT server, which I figured would be easy to integrate with Home Assistant, so I took the plunge and got their Q1 4-zone unit.

Once it all showed up, I started by testing out the Link-Tap with their app and cloud integration. It all worked flawlessly and I was really pleased with it. I ran the irrigation schedule for a few days to prove it was working as expected.

Link-Tap installed with transceiver placed up high.

Link-Tap installed with transceiver placed up high.

Next step was to get Home Assistant installed and configured. I decided to go full nerd homelab setup and install Proxmox on the Beelink. This was pretty straightforward, I just made a bootable USB stick and ran the Proxmox installer.

I found it confusing as to whether I should run HA in a Linux container, or as a VM. As most guides suggested the latter would be easier if I wanted to pass-through USB (e.g. for a Zigbee transceiver, more on that later), I opted to do that. With that, Home Assistant was up and running!

The next step was to setup an MQTT broker, which was also really easy. I ran it as a container in Proxmox and then connected the Link-Tap gateway to it so communications could happen over MQTT. The sensors (water flow, etc) and switches immediately showed up in Home Assistant which was cool.

Irrigation dashboard in Home Assistant

Irrigation dashboard in Home Assistant

I was able to easily configure an automation to run the irrigation every morning, taking into account the forecast for the day (e.g. don’t run if it’s going to rain!). I also added automations to send me push notifications when any zone turns on.

I mentioned Zigbee earlier. I liked the idea of various sensors around the house and outside the property for measuring things. I picked up a SONOFF ZBDongle-P for $32 USD as it had good support for Home Assistant. It was easy to get working with zigbee2mqtt running in another container.

I started with climate sensors in various rooms but I’ve also added soil moisture and humidity sensors to the mix. These were all cheap battery devices from Aliexpress. The climate sensors are great but the soil sensors report data sporadically. I think I need more Zigbee repeaters to get a reliable mesh network, but to date I haven’t found any consumer-grade devices certified for use in NZ.

Climate dashboard in Home Assistant showing data from various rooms.

Climate dashboard in Home Assistant showing data from various rooms.

To take things a step further, I wanted to be able to remote into Home Assistant to check on things. I only wanted to expose Home Assistant though, not any of the other services to keep the surface area minimal. I decided to use Cloudflare tunnels for this, in combination with WARP VPN for security. It’s configured to only allow connections from within my Zero Trust account for safety. It mostly works, there’s a bit of friction when the session expires but it works OK most of the time. The Home Assistant CarPlay app even offers up my irrigation controls when I’m driving. Lol.

I’ve setup automatic backup of VMs and containers in Proxmox (I need to add an external disk for redundancy). Having never used Proxmox, I thought this might be hard, but I was pleased with how easy it was to setup a backup schedule.

I ran into a weird problem every few months where the mini PC wouldn’t recognise it’s NVME drive and would die, then fail to boot. It did this once when I was away for 3 weeks which was irritating. I have hopefully resolved this by disabling NVME deep sleep with nvme_core.default_ps_max_latency_us=0, see this ChatGPT conversation. If that doesn’t fix it, it’s probably a low-quality SSD causing the issue and I may need to replace it or send it back to Beelink which would be annoying.

Further things I’d like to do:

  • Install a media server and somehow make it accessible on the TV.
  • Add energy usage sensors - I am going to get solar panels installed so this may happen as part of that.
  • Resolve my Zigbee mesh network problems
  • Add more irrigation lines for my planter boxes, or build a greenhouse!

I’ll leave you with some photos of the greenery!

Flat-leaf and curly parsley
Pak choy, spring onions, lettuces, beets
Tomatoes, capsicums, courgettes
Taragon, coriander, chives, thyme, sage, rosemary
Courgettes
Flower raised bed
Strawberry!

联系我们 contact @ memedata.com