Goal: Monitor multi-property environmental metrics (CO2, humidity, noise, rain/wind gauges) and integrate Smart Indoor/Outdoor cameras (with face/person recognition and floodlights) under a unified developer API.
Why CLI Scripts? (Agentic AI Observability)
Before jumping into the script code, it is important to understand why command-line scripts are extremely useful for modern smart homes. Beyond convenience for terminal users, these CLI scripts act as a programmatic interface (API bridge) for agentic AI assistants like Antigravity (agy).
By exposing Home Assistant states through standard shell scripts, an AI agent running in your workspace can query, check, and verify live IoT metrics or network states autonomously. This enables the agent to check if the network is healthy, read environment levels, or verify configurations without having to scrape web-based dashboards or utilize complex browser interfaces. It bridges human developer terminal workflows with agentic automation.
Step-by-Step Configuration
1. Create a Netatmo Developer App
- Go to the Netatmo Connect Portal.
- Create a new App under My Apps.
- Retrieve your Client ID and Client Secret.
- Set the redirect URI to:
https://my.home-assistant.io/redirect/oauth - In the API scopes section, make sure to request authorizations for both weather (
read_station) and security (read_camera,access_camera,read_presence).
2. Add Netatmo to Home Assistant
- In Home Assistant UI, go to Settings -> Devices & Services -> Add Integration -> Netatmo.
- Input the App Client ID and Secret.
- Log in with your Netatmo credentials to import your multi-room indoor/outdoor sensors.
3. Monitoring Weather & Camera Statuses via CLI
Once configured, you can query environmental modules and camera states:
# Querying carbon dioxide levels in the office
$ /home/gvoina/scripts/get_ha_sensor.sh sensor.office_carbon_dioxide
Office Carbon Dioxide: 600 ppm
# Querying wind speed from the wind gauge
$ /home/gvoina/scripts/get_ha_sensor.sh sensor.office_wind_gauge_wind_speed
Office Wind Gauge Wind Speed: 12 km/h
# Querying the status of the outdoor security camera
$ /home/gvoina/scripts/get_ha_sensor.sh camera.smart_outdoor_camera
Smart Outdoor Camera: idle
