TTGO HiGrow with ESPHome

This is a really great solution for the T-Higrow devices! I was about to give up on them and find another option.

After provisioning with your web script is it possible to integrate these in ESPHome within HA to easily modify the yaml configs and keep them updated?

1 Like

You’ll have to copy paste the yaml files from the GitHub manually saidly enough.

Hi @nivong, I think that there is an error in the waterpump.yaml

image

it should be
sensor: ${devicename}_soil_moisture

That is not true, it is correct. You can check the sensor ID here: LILYGO-T-Higrow-Esphome/plantsensors.yaml at d9ca800a758c2b3b8fcd9dc66d7fa8369bec1a95 · bruvv/LILYGO-T-Higrow-Esphome · GitHub

I see, thank you

HI,

I followed this post to add input toggle to control deep_sleep, it works with 60s of run duration

run_duration: 60s

:battery: ESPHome: Batteries, Deep Sleep, and Over-the-Air Updates – Tatham Oddie

esphome:
  on_boot:
    priority: 240
    then:
      - wait_until:
          condition:
            wifi.connected:
          timeout: 10s
      - script.execute: consider_deep_sleep
  on_shutdown:
    then:
      - switch.turn_off: spower

ota:
  safe_mode: true
  reboot_timeout: 10min
  num_attempts: 5
  # On OTA end toggle off HA boolean
  on_end:
    then:
      - logger.log: 'OTA successful - flipping switch'
      - homeassistant.service: 
          service: input_boolean.turn_off
          data:
            entity_id: input_boolean.prevent_deep_sleep

# Check status of Home Assistant input boolean to prevent Deep Sleep
# Used for OTA - has BIG impact on battery life
binary_sensor:
  - platform: homeassistant
    id: prevent_deep_sleep
    name: 'Prevent Deep Sleep'
    entity_id: input_boolean.prevent_deep_sleep

# Deep sleep script if/then/else
script:
  - id: consider_deep_sleep
    mode: queued
    then:
      - delay: ${awake_duration}
      - if:
          condition:
            binary_sensor.is_on: prevent_deep_sleep
          then:
            - logger.log: 'Skipping sleep, per prevent_deep_sleep'
            - deep_sleep.prevent: deep_sleep_control
          else:
            - deep_sleep.enter: deep_sleep_control
      - script.execute: consider_deep_sleep

any suggestion or advice?

sadly very distracted :slight_smile: The new T-DisplayS3 from LilyGO/TTGO is fantastic, 16mb flash, 8mb RAM and board-sized display (with or without touch). That and the SCD41 for CO2 and the SEN55 for NOx/VOC/PPM. I figured lilygo would release an updated one at somepoint. In the last year I’ve been more tempted to do a flex-pcb version with i2c/Qwiic connectors, so I can flex them under the root-ball etc. Do a couple of lengths, stick the design online (free), plus send them to lilygo and claim 10% reward of sale profit (used to be listed somewhere). The adafruit seesaw design (use atmel m0 to convert i2c) made me think that’s sensible, maybe the new rp2040(raspberry pi pico) could be the brain chip if it was low power (its not) or able to be slept regularly by an LDO. Having the whole esp32 on each soil sensor seemed overkill, and the i2c qwiic /StemmaQT connectors make daisy-chaining easy (have address selectable or done by flex-sensor length).

I originally bought cheap capacitive soil sensors (v2) which are basically the same without the esp32 and additional circuitry. You need your own Analog to Digital Converter, I used the ADS1015 and ADS1115’s, i2c and 12 or 16bit respectively. It was good but the boards corroded, I used nail varnish on some and they did better. There was cracking after winter, thermal cycling I guess, so a better conformal coating would have meant years of use. They were 25pence each from china and I got maybe 50 so no real loss. The flex-pcb seemed like a no-brainer, genius even, but I’d imagine the glues and coatings could be tested for long-term use, and the likes of JLCPBC and PCBWAY have brought that to reality at a realistic pricepoint (they’d probably even sponsor it if anyone made a video/etc).
Still, I’m a lazy / efficient stoner who doesn’t like the last 5% of a project so rarely finish anything :smile:

@nivong and @bremby could we pack the snippets into ONE practicable and informative (commendations/documentations) yaml file with the yaml codes for the host-side??

Would really nice, so there is no more confusing which way of deep sleep prevent we better use or to have a clean flow

thy all GaRoN

Not sure what you mean, everything is in here: GitHub - bruvv/LILYGO-T-Higrow-Esphome what are you missing?

I mean the deep sleep prevent at ota update… anyway I make it on my own

Hi @GaRoN,

what I did is there https://community.home-assistant.io/t/ttgo-higrow-with-esphome/144053/48?u=bremby, I’m still wondering if anyone has suggestions regarding the parameters to balance battery life

  # Uncomment run_duration and sleep_duration if you want to use deepsleep
  # set how long to stay awake - NOT less then 10sec
  run_duration: 60s
  # set how long to sleep in minutes
  sleep_duration: 60min
  awake_duration: 30s

how you managed it?

  # Uncomment run_duration and sleep_duration if you want to use deepsleep
  # set how long to stay awake - NOT less then 10sec
  run_duration: 60s      # <--- way too long... I've set mine to 6s for 2 scans at update_interval: 5s
  # set how long to sleep in minutes
  sleep_duration: 60min
  awake_duration: 30s    #  <--- what is this???

The sensor data is updated in ms after wifi connected, thats why I have the 2 “AND” so its clear the higrow is connected and after than it can back to deep sleep…

the packed 200mAh battery lived about 2-3 weeks at this yaml… now I use a solar system to power my higrows so I have no more that problem

One thing to comment on your guide, @nivong - I’ve calibrated my sensor based on the glass of water, like you suggested … except then I get readings of soil moisture at 150-170%!! I found in other guides that it really should be calibrated in the soil that you plan to use; the ‘nutritional content’ of the dirt affects the readings, it seems. Maybe it’s the plant itself too - mine is for a Meyer lemon tree which requires a high pH, fwiw.

Hello

I have a problem and could not solve sine a few weeks. I have stated to prepare Higrowplant sensor with ESP32 in Hassio. Installed the start firmware prepared by hassio esp32. Then i have adapted to my sensor. Lilygo Higrow with BME sensor. But now i have an update available and couldn update the esp32.

My error messge is:
INFO ESPHome 2023.7.0
INFO Reading configuration /config/esphome/lilygohigrowplantsensor-7fcb75.yaml…
ERROR Error while reading config: Invalid YAML syntax:

while parsing a block mapping
in “/config/esphome/lilygohigrowplantsensor-7fcb75.yaml”, line 86, column 4:
- platform: gpio
^
expected , but found ‘’
in “/config/esphome/lilygohigrowplantsensor-7fcb75.yaml”, line 88, column 5:
name: lilygohigrowplantsensor-7fcb75
^


Have someone an idea what i do wrong?

Thank you in advance.

regards


YAML:

substitutions:

name: lilygohigrowplantsensor-7fcb75

Dashes are not supported in devicename

#devicename: ‘esphomebalcone1’

device_description: ‘Keep my plants safe and lively’

project_version: ‘1.0’

update_interval: 30min

loglevel: DEBUG

moisture_min: ‘2.82’

moisture_max: ‘1.39’

conductivity_min: ‘0.075’

conductivity_max: ‘0.25’

Uncomment run_duration and sleep_duration if you want to use deepsleep

set how long to stay awake - NOT less then 10sec

run_duration: 11s

set how long to sleep in minutes

sleep_duration: 60min

packages:

esphome.project-template: github://bruvv/LILYGO-T-Higrow-Esphome/LILYGO-T-Higrow-ESP32.yaml@main

text_sensors: !include text_sensors.yaml

#dht: !include common/dht.yaml

plantsensors: !include plantsensors.yaml

#waterpump: !include waterpump.yaml

bluetooth: !include bluetooth.yaml

Battery only works for 12 hours with deepsleep!

bme280: !include bme280.yaml

deepsleep: !include deepsleep.yaml

battery: !include common/battery.yaml

esphome:

name: ${name}

name_add_mac_suffix: false

api:

encryption:

key: FZ9I2OoSxXgPQRbedbWoinxIiFctCUiS6QEiEITPaHs=

wifi:

ssid: !secret wifi_ssid

password: !secret wifi_password

ap:

ssid: "esphome-7Fcb75"

password: "aUH6FwlYHiQl"

#esphome:

name: esphome-web-7fcb75

friendly_name: ESPHome_balcone1

esp32:

board: esp32dev

framework:

type: arduino

Enable logging

logger:

Enable Home Assistant API

#api:

encryption:

key: “JlFoZVjLJvD+MDtKflmg5vjreEwQmu6+WGUkLYTPN2M=”

#ota:

ota:

safe_mode: true

reboot_timeout: 10min

num_attempts: 5

Enable fallback hotspot (captive portal) in case wifi connection fails

time:

  • platform: homeassistant

button:

  • platform: restart

    name: ‘Restart - ${devicename}’

i2c:

sda: 25

scl: 26

scan: true

id: bus_a

setup_priority: -200

switch:

Power Switch

  • platform: gpio

    #name: ‘${devicename} Sensor Power switch’

    name: lilygohigrowplantsensor-7fcb75

    pin:

    number: 4

    mode: INPUT_PULLUP

    id: spower

    restore_mode: ALWAYS_ON

    internal: true

    setup_priority: 1000

sensor:

Wifi sensor

  • platform: wifi_signal

    name: ‘${devicename} WiFi Signal’

    id: ‘${devicename}_wifi_signal’

    update_interval: ${update_interval}

captive_portal:

[quote="ilan, post:1, topic:144053, full:true"]
I'm trying desperately to get this Soil/moisture/temp/hum/light package running in esphome, I'm getting nowhere. Its the newer (?) 1.1 version, and the only thing I can find online is for the older version, which was of little help.

The only docs for this new version are here https://github.com/Xinyuan-LilyGO/TTGO-HiGrow which, after parsing thru the code seems to declare the pins, but esphome is not picking up on any of the sensors aside from the soil salt sensor (pin 34). DHT12 seems to be in one-wire mode as opposed to i2c, the bh1750 light sensor is not being found with an i2c scan, just a big mess.

Hoping you guys can shed some insite of something I missed?!

DHT12 when configured like the esphome docs ( https://esphome.io/components/sensor/dht12.html ) got nothing as well, I think its an i2c config issue.

esphome:
name: higrow1
platform: ESP32
board: nodemcu-32s #tried multiple board types, including lolin_d32

wifi:
ssid: “nopenope”
password: “nopenope”
manual_ip:
static_ip: n.o.p.e
gateway: n.o.p.e
subnet: n.o.p.e
fast_connect: true

Enable logging

logger:

Enable Home Assistant API

api:
i2c:
sda: 25
scl: 26
scan: True
ota:
sensor:

  • platform: dht
    model: AUTO_DETECT
    pin:
    number: 16
    mode: input
    temperature:
    name: “HiGrow1 Temperature”
    humidity:
    name: “HiGrow1 Humidity”
    update_interval: 60s
    setup_priority: -100
  • platform: adc
    pin: 32
    name: “HiGrow1 Soil”
    update_interval: 60s
  • platform: adc
    pin: 34
    name: “HiGrow1 Salt”
    update_interval: 60s
  • platform: bh1750
    name: “BH1750 Illuminance”
    address: 0x23
    update_interval: 60s
It compiles fine, uploads and connects to wifi. Cant find any of the i2c components. No idea what I'm missing here. any help will be appreciated!!
[/quote]


Processing: lilygohigrowplantsensor-7fcb75(1).yaml…

What’s the battery performance like when using the Higrow with a pump? I’m drawn between getting a bunch of Higrows with pumps vs. a bunch of Xiaomi “Flower Care” plant sensors plus something like the Droplet ESP board.

I’m planning on (semi-) automating my allotment garden, which I won’t be tending to in person on a daily basis, with its own Home Assistant install. Any other options that I’m overlooking?

You can also get mesh covered temp+humidity sensors, that can be buried in the growing medium (soil). There are metal versions and PTFE versions. Also the cheap soil sensors often have a failure related to a missing ground connection making them slow to react/unreliable. Easily fixed: https://www.youtube.com/watch?v=IGP38bz-K48