Weather Sensors: Rain, Wind, Temperature, Soil Moisture, and Sunlight

Module 21 · Lesson 11

Weather Sensors: Rain, Wind, Temperature, Soil Moisture, and Sunlight

An internet weather forecast tells you what's happening a few miles away. Your own sensors tell you what's happening exactly on your property. This lesson is the foundation for the weather-driven automations in Lesson 13: irrigation, the awning, and the blinds.

Budget around 80 minutes. Example entities: binary_sensor.rain_detected, sensor.wind_speed, sensor.outdoor_temperature, sensor.beds_soil_moisture, sensor.sunlight_lux.

A Problem from Real Life: The Forecast Says Dry, and It's Pouring at Your House

Local convective storms can differ by several degrees and half an inch of rain within a few miles. The weather provider's own station could sit ten miles from your house: fine for planning your general day, not fine enough for an irrigation or awning automation, which needs data from your own property.

A Weather Station: What to Buy

Ecowitt kits are a popular choice in the community: a base station with a tipping-bucket rain gauge, an anemometer (wind), temperature/humidity, and optional soil moisture probes, integrated with HA locally through the station's own API, or through the manufacturer's cloud as a backup source. A simpler, cheaper starting point is a single rain sensor (tipping-bucket or resistive) plus an outdoor temperature sensor, expanded later with wind and soil sensors.

SensorUse in automation
Rain (tipping-bucket)pausing irrigation, a reminder about open windows
Wind (anemometer)safely retracting the awning during gusts
Soil moisturecorrecting the irrigation schedule from Lesson 8
Sunlight (lux)extending the awning, adjusting lighting from Module 20

A Combined Sensor with Source Redundancy

template:
  - binary_sensor:
      - name: "Rain detected"
        unique_id: rain_detected_combined
        device_class: moisture
        state: >
          {{ is_state('binary_sensor.rain_own_station', 'on')
             or (states('sensor.rain_forecast_1h') | float(0)) > 0.02 }}
        availability: >
          {{ states('binary_sensor.rain_own_station') not in ['unknown','unavailable']
             or states('sensor.rain_forecast_1h') not in ['unknown','unavailable'] }}

This pattern combines your own station (priority) with an online forecast as a backup source: if your own station loses signal (a dead battery, a Wi-Fi outage), binary_sensor.rain_detected keeps reacting based on the forecast instead of freezing at its last state. It's the same entity used by the irrigation automations from Lesson 8 and the alerts from Lesson 1.

Soil Moisture: Where and How to Mount a Probe

A single probe for the whole yard doesn't make sense: soil in the sun dries differently than soil in shade, sandy soil differently than clay. Mount a separate probe in each irrigation zone from Lesson 8, at root depth (usually 4-6 in for lawn, deeper for shrubs), well away from the edge of a bed, where moisture readings aren't representative.

Calibrating a capacitive probe
Cheap capacitive probes sometimes need their "dry" and "wet" thresholds calibrated for a specific soil type: the factory 0-100% reading can be non-linear. Stick the probe in dry soil and note the reading, then in wet soil, and only then set input_number.soil_moisture_threshold_pct from Lesson 8.

Wind: An Alert for Strong Gusts

automation:
  - alias: "Wind: alert on strong gusts"
    id: wind_alert_strong_gusts
    mode: single
    triggers:
      - trigger: numeric_state
        entity_id: sensor.wind_speed
        above: 31
    conditions:
      - condition: state
        entity_id: input_boolean.outdoor_alerts_enabled
        state: "on"
    actions:
      - action: notify.mobile_app_your_phone
        data:
          title: "Strong wind"
          message: "Wind speed has exceeded 31 mph. Check the awning and any loose items in the yard."
          data:
            importance: high
            tag: "wind-alert"

This alert stands alone for now, but in Lesson 13 we'll extend it into automatically retracting the awning instead of just notifying: the awning is one of the few outdoor elements where a fully automatic response to wind is justified, because not reacting risks real damage to the hardware.

The Ecowitt Integration: One Practical Catch That's Easy to Forget

The built-in Ecowitt integration in Home Assistant works with any gateway in the GW series that supports so-called DIY upload, and automatically surfaces every connected sensor, including soil moisture probes, as ready-made entities. There's one practical catch that's easy to forget: Ecowitt devices don't support encrypted TLS/SSL (HTTPS) connections. If your Home Assistant setup enforces HTTPS only, the Ecowitt integration simply won't receive data: you need to allow plain HTTP access for this specific device on your local network.

Calibrating Weather Sensors and Common Measurement Errors

A temperature sensor in direct sun: inflates the reading by several degrees, needs a radiation shield

A poorly calibrated soil moisture sensor: different soil types (sandy, clay) give different readings at the same real moisture level, needs manual threshold calibration

An anemometer mounted too low: buildings and trees distort the real wind reading, understating it relative to open ground

A rain gauge clogged with leaves: needs regular cleaning of the collection funnel, otherwise it understates actual rainfall

Weather Stations: Ecowitt vs. Netatmo vs. DIY on an ESP32

OptionCharacteristics
Ecowittwide range of sensors, local integration over HTTP, good price-to-capability ratio
Netatmoattractive design, mostly cloud-based integration, fewer optional sensors than Ecowitt
DIY on ESP32/ESPHomefull control and locality, needs your own work mounting and calibrating sensors

UV Index and Its Practical Use in Garden Automation

Some weather integrations, including certain Ecowitt stations, expose a UV index reading, useful not only as information but as an automation input: at a very high UV index, an automation can remind you to extend the awning (tying back to Lesson 13) even before temperature rises enough to trigger a heat-based automation, effectively giving you earlier protection against the most intense sun.

Outdoor Air Quality: Pollen and Smog in Home Automation

An outdoor air quality sensor (PM2.5, PM10) or an integration with public monitoring stations (AirNow in the US, for example) enables automations that factor in outdoor air quality: with high smog or pollen levels, an automation can remind you to close windows instead of airing the house out, or pause a scheduled mechanical ventilation cycle from an HRV, if the house has one, tying this lesson's weather data into indoor comfort.

Budget vs. Professional Sensors: Accuracy Differences

CategoryTypical temperature accuracyRough price
Budget (Zigbee, general purpose)+/- 2-4°F$15-25
Mid-range weather stations (Ecowitt)+/- 1-2°Fa couple hundred dollars for the kit
Professional weather stations+/- 0.4-1°Fthousands of dollars

For most of the home automations in this module, budget-sensor accuracy is entirely sufficient: half a degree of difference doesn't change the decision to start irrigation or retract the awning. Spending more on hardware mainly pays off for enthusiasts interested in precise microclimate monitoring, not for basic automation.

Mounting a Soil Moisture Sensor: Probe Depth and Location

A soil moisture sensor placed too shallow dries out far faster than the actual root zone of your plants, leading to over-frequent watering. The recommended mounting depth is usually 4-6 in for lawn, and deeper, up to 8-12 in, for shrubs and trees with a deeper root system, and the location should represent a typical spot in the zone, not one that's unusually shaded or sunny compared to the rest of the lawn.

How to Test This Lesson

1. Compare your own station's reading against the online forecast for a week: check how often they disagree.

2. Calibrate the soil moisture probe in a dry and a wet soil sample.

3. Turn off the weather station's Wi-Fi and confirm the combined sensor falls back to the online forecast.

Common Mistakes

One soil probe for the whole yard: misleading readings for zones with different sun exposure.

No backup source for rain: a dead station battery freezes state at "dry."

No probe calibration: the percentage reading doesn't match actual soil moisture.

Practical Task

☐ Install a rain sensor, a temperature sensor, and at least one soil probe.

☐ Set up the combined sensor with online forecast redundancy.

☐ Add a wind alert at the 31 mph threshold.

Key Takeaways

Your own station beats an online forecast on local accuracy, but needs a backup source.

One probe per zone, not one for the whole yard.

Calibration of the soil probe is the foundation of trustworthy thresholds.

What's Next

Next lesson: Weather-Driven Automations: Irrigation, the Awning, Blinds, and Alerts. We'll put this lesson's data to work in concrete, ready-to-use automations.

Finished this lesson?