Agricultural Environment Monitoring — Deployment Guide

AI Assistance

Need help choosing hardware, or ready to deploy?

Prefer not to manually configure devices or enter commands? Let AI Assistant size hardware based on your site setup, or run one-click script deployment once ready.

Self-service Consult & Deploy
Preset

SenseCAP Cloud

SenseCAP S21xx nodes already report to the SenseCAP cloud through a SenseCAP M2 gateway; nothing on the radio side changes. A bridge container pulls history and live data from the cloud and publishes them as local Home Assistant entities.

  • Host: A Linux host with Docker for Home Assistant, the MQTT broker and the bridge.
  • Account: A SenseCAP Portal account and an API key pair.
  • Known limits: Two cloud MQTT hostnames are in circulation and the deployment offers both; after the first deployment, check the bridge log to confirm it connected.
1

Deploy Home Assistant and the Broker

Starts Home Assistant and a Mosquitto broker on one host. Skip this if you already run both and the bridge can reach your existing broker.

Prerequisites
  1. At least 8 GB free disk on the host.
  2. Ports 8123 and 1883 free, or different ports set in this step's inputs.
  3. A broker password, written down; the bridge step asks for the same value.
Troubleshooting
SymptomFix
Port 8123 or 1883 already in useStop the existing Home Assistant or Mosquitto, or set different ports in this step's inputs
Mosquitto restarts with Unable to open pwfileMake the password file owned by the mosquitto user
Home Assistant never answers on 8123First start takes a few minutes; run docker logs agri-env-homeassistant
Deploy cannot connectConfirm SSH is reachable and the username is right (pi on Raspberry Pi OS, recomputer on reComputer)
Deployment method

Deploy over SSH to a Linux host with Docker; amd64 and arm64 both work.

What you will be asked for(filled in the SenseCraft Solution app)
  • Host Address*

    The machine that will run Home Assistant and the broker

  • SSH Username*default pi

    Common defaults: pi (Raspberry Pi OS), recomputer (Seeed reComputer), ubuntu.

  • SSH Password*
  • Time Zone*default Asia/Shanghai

    IANA name — it decides how timestamps read on the dashboard

  • Home Assistant Port*default 8123

    Change this if 8123 is already taken on this host

  • MQTT Port*default 1883
  • MQTT Username*default agrienv

    Used by Home Assistant's MQTT integration and by the bridge; the broker refuses anonymous clients

  • MQTT Password*

    Write it down — the next step asks for the same value

2

Deploy the Cloud Bridge

Deploys the bridge that reads the SenseCAP cloud. It lists the devices on your account, backfills their history, then subscribes to live data.

Prerequisites
  1. A SenseCAP API key pair (Access ID and Access Key) from the SenseCAP Portal under Security → Access API Keys.
  2. The broker address, port, username and password from step 1. If the bridge runs on a different machine, use the LAN IP rather than 127.0.0.1.
  3. A backfill window: up to three months; a longer window means more requests.
Troubleshooting
SymptomFix
Bridge log shows a DNS failure for the cloud hostRedeploy with the other option in the MQTT host selector
Bridge log shows an authentication failureCheck the Access ID and Access Key pair, and that the key has not been revoked in the Portal
Devices appear but no valuesBackfill writes only the latest value per entity; with hourly reporting, the first live update can take up to an hour
no such image on deployWith a self-built BRIDGE_IMAGE, build it locally first and re-run
Nothing reaches the brokerWhen the bridge is not on the Home Assistant host, set the broker address to the LAN IP
Deployment method

Deploy the bridge over SSH to a host with Docker.

What you will be asked for(filled in the SenseCraft Solution app)
  • Bridge Host Address*

    Where the bridge container runs — usually the same machine as Home Assistant

  • SSH Username*default pi
  • SSH Password*
  • Time Zone*default Asia/Shanghai
  • MQTT Broker Address*default 127.0.0.1

    The broker deployed with Home Assistant. Use the host's LAN address, not 127.0.0.1, when the bridge runs on a different machine.

  • MQTT Port*default 1883
  • MQTT Username*default agrienv
  • MQTT Password*

    The same value you set on the Home Assistant step

  • SenseCAP Access ID*

    From the SenseCAP Portal, Security → Access API Keys

  • SenseCAP Access Key*

    The secret half of the API key pair. It is written only to a mode-600 .env file on the target host.

  • SenseCAP Cloud MQTT Host*default sensecap-openstream.seeed.cc
    2 options
    • · sensecap-openstream.seeed.cc — used by a shipping Seeed solution
    • · openstream.api.sensecap.seeed.cc — appears in documentation

    Two hostnames are in circulation and neither is confirmed. Try the default first; if the bridge log shows a DNS or authentication failure, redeploy with the other.

  • Backfill Window*default 1
    3 options
    • · None — live data only
    • · 1 month
    • · 3 months — the API maximum

    How far back to pull history on first start. The OpenAPI reaches back three months at most and serves one month per request, so a longer window means more requests.

  • Offline Threshold (seconds)*default 7200

    No uplink for this long marks the node offline in Home Assistant. Default is two S210x reporting cycles plus margin — raise it if your nodes report less often than hourly.

3

Check the Data in Home Assistant

Open Home Assistant and confirm the nodes arrived as devices with entities.

Troubleshooting
SymptomFix
MQTT integration connects but no devices appearRun docker logs agri-env-bridge-cloud and confirm the cloud connection line is there
Entities appear as unavailable right awayConfirm the nodes are reporting and the offline threshold is not shorter than their interval
An entity has no unitAdd its measurementId to assets/config/measurements.yaml
Old entity ids keep coming backClear the broker's retained messages and Home Assistant's entity registry together

After Deployment

Every node on the account is a Home Assistant device named SenseCAP <DevEUI>, with one entity per measurement.

Quick verification

  1. Sign in to Home Assistant and complete the onboarding wizard on a fresh install.
  2. Settings → Devices & Services → Add integration → MQTT, with the host running the stack, port 1883, and the username and password from step 1. Skip if MQTT is already configured.
  3. Open the MQTT integration, open a device, and check its entities carry units (°C, %, dS/m).
  4. Import the dashboard: Overview → three-dot menu → Edit dashboard → three-dot menu → Raw configuration editor, paste assets/homeassistant/agri_env_dashboard.yaml, and replace the example DevEUIs with your own.
  5. Import the threshold alerts: merge assets/homeassistant/automations.yaml into Home Assistant's automations.yaml and reload automations. The shipped for: durations are zero; adjust thresholds and durations before field use so a single noisy reading does not trigger an alert.

Next steps

  • Set the offline threshold to match the nodes' reporting interval. The default assumes hourly reporting; nodes reporting every six hours are marked offline between uplinks.
  • Put the entities you act on in a separate view.