README

Description

I am documenting how I created my own Single Board Computer (SBC) sprinkler controller to be used for my home.

This setup will outline each step I took to make this setup work using Home Assistant, Docker, MQTT, Portainer.

Product I bought

Software Used

  • Ubuntu Jammy
  • Docker
  • Portainer
  • Home Assistant
  • MQTT

Setup

Installation

Ubuntu: https://releases.ubuntu.com/jammy/

Once setup is done and you have created your user account and password, install either libgpiod or lgpio, I did libgpiod found below:

sudo apt update 
sudo apt install gpiod
sudo apt update 
sudo apt install libgpiod-dev
sudo apt install python3-libgpiod
sudo apt install python3-dev 
pip install gpiod

Then verify from the below:

gpiodetect

Docker: https://docs.docker.com/engine/install/ubuntu/

Portainer: https://docs.portainer.io/start/install-ce/server/docker/linux

After install prep

Use Portainer to download and start Home Assistant from docker hub here: https://hub.docker.com/r/homeassistant/home-assistant

Also use Portainer to download and start MQTT Broker from docker hub here: https://hub.docker.com/_/eclipse-mosquitto

Setting up MQTT Config file

You will want to create a config yaml file that you will be volume mounting into the container via portainer.

Mine looks something like this:

mqtt:
  host: localhost
  user: [your user]
  password: [your password]
  topic_prefix: /home/irrigation
  ha_discovery:
    enabled: yes

# GPIO
gpio_modules:
  # Use the libgpio built-in GPIO
  - name: gpio
    module: gpiod
    chip: /dev/gpiochip2

digital_outputs:
  # Find the pins you would like to use from a schamtic of your board so you can map pins here
  - name: Zone 1
    module: gpio
    pin: 23
    on_payload: "1"
    off_payload: "0"
  - name: Zone 2
    module: gpio
    pin: 16
    on_payload: "1"
    off_payload: "0"
  - name: Zone 3
    module: gpio
    pin: 18
    on_payload: "1"
    off_payload: "0"
  - name: Zone 4
    module: gpio
    pin: 15
    on_payload: "1"
    off_payload: "0"

Home Assistant Setup

After creating your account and logging in.

Configure MQTT by the below:

  • Click on the hamburger button
  • Click Devices and Services
  • Add Integration
  • Select MQTT
  • Configure with your settings

Hardware connection

  • Assemble the heatsink to the SBC
  • Assemble the SBC to the Junction Box peg board
  • Assemble Channel Bay near by
  • Add Jumper Cables from GPIO pin to Channel Bay
  • Add Male to Male Jumper from Channel Bay to Terminal Block
  • Add wire from Terminal Block to Power Supply Adapter Transformer

How everything runs

Explain how the project or application operates.

S
Description
No description provided
Readme 25 KiB