Home Assistant Plant Monitoring

TL;DR - Are you monitoring house and garden plants in HA? If so, what are you using?

I asked a question related to this about two months ago and received one response. It was a helpful response but I haven’t made any progress so I thought I’d ask again.

I’ve been a long time HA user and I used to have a single MiFlora connected by BlueTooth to my old Raspberry Pi setup. It worked so well that I got some more MiFloras (and clones) but I soon exceeded the BlueTooth range. So I looked for alternatives. And that really is the point of this question - I’m running out of alternatives to try.

I currently have an ESPHome setup. I have (checks notes) 11 ESP32s from 7 different manufacturers and I have the same problem with all of them.

If I want to update any of them I have to go and get them and plug them in to my computer. The particular device I’ve taken the screenshot from is reporting a signal strength of -54 dBm which should be fine to upload a small payload but this happens with all of them, every time. According to my router I have 54 devices connected wirelessly. Only these ESP32s exhibit connectivity problems. My Ring Doorbell, for example, is reporting a signal of -57dBm even though it’s outside.

I found that Room Assistant has a Xiaomi Mi integration so I set up a few Pis and tried that. But what appears to happen is it sends one value and then never updates. I’ve not dug in to exactly what happens but I end up with things like this

I also found docker-miflora-mqtt which hasn’t been updated for over four year. It works but it crashes so often I gave up on it.

While I’d be happiest if someone could help me fix the ESPHome wifi problems I am now at the point where I’d be happy to rip everything out and replace it with something else but as far as I can tell there’s only two options - the Xiaomi route or building something myself with capacitive moisture sensors and DHT modules which ultimately leads back to ESP32s or having Raspberry Pis everywhere.

I’m grateful for any advice!

Steve

1 Like

Curious if you are using zigbee devices, cause these devices can run on the 2.4GHz band see below:

I too have devices that were out of Bluetooth range, so I created an ESPHome Bluetooth hub, and this helped solve my problem, cause I could take that device and place it closer to the devices that were out of Bluetooth range:

So, first I would look into seeing if you have any 2.4GHz interference from something, and then work on building a Bluetooth hub.

My only ZigBee devices are Hue lights.

All the ESP32s around my house are doing what you’ve linked to. They’re positioned so the furthest MiFlora is no more than 3m away. Bluetooth to ESP32 isn’t the problem - it’s the ESP32 to Wifi that just won’t stay connected. As I mentioned, I can never update them OTA and I can’t get a consistent flow of data from them. I regularly get

‘xxxx Illuminance’: Sending state 194.00000 lx with 0 decimals of accuracy

Followed by a timeout error and that’s only if I can stay connected long enough to see it in the logs. But I never see an error connecting to a BlueTooth device.

Make sure that your Hue Hub channel is on the opposite end of your WiFi channel is on. Use the link above to see what is what, cause if they are close that could be causing your issue.

I use these: April soil moisture sensor – April Brother CO.,LTD
It is an ESP32 chip and although it is capacitive sensoring and comes with a case and battery, it is not perfect.
You can recharge the battery through the USB-C connector, but there is no hole in the casing for that, so you have to make it yourself.
I made a hole myself and then bought USB-C protective covers to cover the holes.
I have also bought a USB charging hub that can charge 7 devices with 2.4A on each port, but I think they only support 1A. Still better than ½A that many multiport USB hubs can deliver.

I am currently tinkering with upgrading them to ESP-Now, but I have no succeeded yet, due to issues with making an ESP-Now gateway with only one ESP device and a wired connection.

These are excellent in terms of range. Awesome! LoRa Soil sensor

But I am not sure about your esp upload woes, and wonder why you need to keep updating. Set, forget.

But I am not sure about your esp upload woes, and wonder why you need to keep updating. Set, forget.

Great advice! I’ll never buy another house plant or move any of the existing ones around and then I can just ignore the problem altogether.

These are excellent in terms of range. Awesome! LoRa Soil sensor

We’re talking 2 to 3 metres, not 25 miles. My house plants aren’t in someone else’s house.

1 Like

I think your missed the point @nickrout was just wondering why you are constantly updating, which I get, cause I created my Bluetooth hub and I have not Updated it for quite sometime. If there is not a new feature that you want or a breaking change there is really no reason to upgrade. Don’t break what is already working, is the logic some in this forum follow. And he was also just trying to supply you with other options. Have you looked into the channel thing I discussed earlier, because I had the same issue you are referring to cause I also have Hue Lights as well. And it turned out to be the channels were too close together. I changed the channels to the opposite ends of the spectrum, and this cleared up my issue, and I was able to wireless update my ESPHome devices. We are all here to help, and we will all have different suggestions. Some will have the exact answer, and others will point you in the right direction. I hope the channel thing works for you as well. I should also throw this in there, you should do a WiFi scan to see what other channels are in the air and close to you. These other channels from your neighbors could be interfering with your network.

Sorry for pointing out that there are more options, obviously you were under a misapprehension about your options, sorry again for pointing out your mistake.

If you have connectivity problems with wifi over 2-3 m your wifi is broken. You have been given solid advice about investigating that. Good luck.

I use Mi Flora with ESPHome as BLE scanner nodes, which I suspect is the (or one of the) most common set-ups.

This set up is solid for me and I think for many others too.

Can’t help much with debugging your set-up myself.

1 Like

What is your software setup? I was looking to have the info processed by hacs
GitHub - r-renato/hass-xiaomi-mi-flora-and-flower-care: The Home Assistant custom component uses Flower Care™ Smart Monitor to retrieve flower information (http://www.huahuacaocao.com/product)..
Only to discover this component is not updated anymore.
I know you can manually look up all the info for each plant. But it would be nice to have a bit more automated setup. Maybe I overlooked the thread with this info

regards Willem-Jan

Various responses to different posters on this thread below. I’ve abandoned this project completely but a post today reminded me about it so I thought I’d close of the open quesitons.

I think your missed the point @nickrout was just wondering why you are constantly updating

I mentioned updates because an update involves a large payload, not because I am “constantly updating”. To be absolutely clear I wasn’t updating at all unless I plugged the device in to a USB cable. But I was also talking about - and I gave an example - the data from the devices to HAss. In my post on Aug 10 I gave the example

‘xxxx Illuminance’: Sending state 194.00000 lx with 0 decimals of accuracy

Failing with a timeout. Repeatedly. To be clear - even if I never update the ESP32 after the initial install, the whole point of this project was for the ESP32s to send data to Home Assistant. About 75% of the data was lost because of timeouts.

If you have connectivity problems with wifi over 2-3 m your wifi is broken. You have been given solid advice about investigating that.

I have investigated it. I know I wasn’t super clear about it but that’s what I referred to here:

I asked a question related to this about two months ago and received one response. It was a helpful response but I haven’t made any progress so I thought I’d ask again.

As I said, I realise that wasn’t clear. But I did say that I am only experiencing this problem with the ESP32s on a wireless network of >60 devices with all of the ESP32s reporting signal strengths of better than -50 dBm. On a network that has been tweaked to death I fail to see how the network is still the problem when I have computers, fridges, heating control, gaming devices, watches, phones, Raspberry Pi robots, weather stations, TVs and so on and the only things that can’t stay connected are ESP32s running ESPHome. I have a weather station that is 12m from the nearest AP through a brick wall and it works fine. Never had a problem with dropouts.

LORA relies on two things that I have no control over - an external network being present and a service like TTN. A LORA Soil moisture sensor costs about 3 times the cost of a device like a MiFlora and doesn’t report things like temperature and light exposure. It’s an ideal solution for monitoring plants in an allotment as an example but it’s just not a practical solution for monitoring a houseplant. Too much cost and too many moving parts.

This can be from a bad combination of AP and ESP modules, if the AP is setup with a single SSID for both 2.4Ghz and 5GHZ and have kick-over activated.
Some APs can then see ESP modules and think they can run 5Ghz and then try to kick them over, which will fail.
On a few APs you can deactivate the kick-over feature, but on most you have to split your WiFi into a 2.4Ghz and a 5Ghz SSID to prevent the kick-over.

You are referring to lorawan. I was referring to lora. Pay attention.

2.4Ghz and a 5Ghz SSID to prevent the kick-over.

Already done. But thanks for the suggestion

How do I use LoRa?

I suggest you read the thread I pointed you to.

What happens if you set up a continuous ping to the esp32 while you’re attempting to perform the wireless upload? ping -t 192.168.0.xxx Curious if it drops the pings at the same time as the upload times out. If you could post your esphome code for it someone may spot something there that might be an issue.

I have an esp32 set up as a BLE monitor for a radon monitor, and it took me many hours of troubleshooting to figure out why it would stop working. It wasn’t a wi-fi issue, as I could always connect to it and upload new code, but it would fail to pick up the BLE signal from the radon monitor. It turned out that it is very touchy about the power source. If I plugged it into the USB port of a power surge protector it woud fail. If I plug it into the USB port on a CyberPower UPS it fails. If I plug it into an iPhone USB charger it fails. I have one out of many USB chargers (unknown brand) that it always works in. Try out different power supplies and cables to see if they have make any difference.

I always make sure to use 2.1A USB chargers.
It is a current outside the standards, but it provides enough headroom to always stay stable inside the work ranges of the ESP devices.

1 Like

It behaved as described. I no longer have it set up but it was a series of replies with decent response times and then a batch of “Destination Host Unreachable” and then back to reasonable response times.

As mentioned, I’m not using it anymore. But it wasn’t anything complicated. This is an example from an old repo

  name: backgardenesp
  platform: ESP32
  board: heltec_wifi_kit_32
  
time:
  - platform: sntp
    id: esptime
    servers: 192.168.1.91
    
font:
  - file: 'slkscr.ttf'
    id: font1
    size: 8

  - file: 'BebasNeue-Regular.ttf'
    id: font2
    size: 48

i2c:
  sda: GPIO4
  scl: GPIO15

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    reset_pin: GPIO16
    lambda: |-
      // Print time in HH:MM format
      it.strftime(0, 60, id(font2), TextAlign::BASELINE_LEFT, "%H:%M", id(esptime).now());

wifi:
  ssid: "Things"
  password: "xxxxxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Backgarden1 Fallback Hotspot"
    password: "xxxxxx"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

esp32_ble_tracker:

sensor:
  - platform: xiaomi_hhccjcy01
    mac_address: 'C4:7C:8D:66:0D:A1'
    temperature:
      name: "Fence Box Temperature"
    moisture:
      name: "Fence Box Moisture"
    illuminance:
      name: "Fence Box Illuminance"
    conductivity:
      name: "Fence Box Soil Conductivity"
  - platform: xiaomi_hhccjcy01
    mac_address: 'C4:7C:8D:6B:59:9E'
    temperature:
      name: "Herb Garden Temperature"
    moisture:
      name: "Herb Garden Moisture"
    illuminance:
      name: "Herb Garden Illuminance"
    conductivity:
      name: "Herb Garden Soil Conductivity"
  - platform: xiaomi_hhccjcy01
    mac_address: 'C4:7C:8D:6B:6C:47'
    temperature:
      name: "Trug Temperature"
    moisture:
      name: "Trug Moisture"
    illuminance:
      name: "Trug Illuminance"
    conductivity:
      name: "Trug Soil Conductivity"