Close

Replacing OSPi (OpenSprinkler)

A project log for Experiences with ESPhome

Setting up some ESPhome-devices

mabe42MaBe42 10/08/2024 at 20:520 Comments

I did not have any luck with OpenSprinkler running on a Raspberry Pi. I had bought the OSPi board and set up everything in my workshop. It worked as intended. After putting it up in its final place in the garage, not any more. Something on the board had given up the ghost. So I set up a kind of replacement with a 74HC595 shift register as on the OSPi board but using a 4x relay board instead of the triacs. That worked.


However, While I was on summer holiday, for no discernible reason it stopped working. The pi could not be pinged any more. Neither the pi nor the wifi router had been moved. Resetting did not help. this was during the hottest weeks this summer and some of our plants didn't like it that they were not watered for more than a week.

Putting it back into the workshop everything was fine again but I had lost confidence in this solution.

Therefore, I decided to replace the pi with an ESP8266 which has enough GPIOs for 4 relays (of which I anyway only used 2). As I have home assistant running (in docker), I gave ESPhome (command line version on my laptop) a try. It was pretty easy to set it up. Now I have to provide the programming of the watering by myself. But with my soil moisture sensors and measurement of the outside temperature this is no big deal. I should have done this right from the beginning. It would have saved me a lot of trouble and some money, too.

esphome:
  name: eh-irrigator

esp8266:
  board: d1_mini_pro

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ""

ota:
  - platform: esphome
    password: ""

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Eh-Irrigator Fallback Hotspot"
    password: "u6FGqdp5vY7G"

captive_portal:

switch:
  - platform: gpio
    name: "Wasser Garten"
    pin: GPIO14 #D5

  - platform: gpio
    name: "Wasser Balkon"
    pin: GPIO12 #D6

sensor:
  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    update_interval: 2min

The above file was mostly generated using the esphome wizard. Only the switches and the sensor had to be added manually.

I don't find the documentation very clear with respect to the !secret. But it is as simple as generating the file secrets.yaml in the same directory as the above yaml file and making there the definitions for ssid and password.

The OTA update of ESPhome works like a charm!

Discussions