mirror of
https://github.com/kkazakov/osm-temp-humidity-hacs.git
synced 2026-01-26 05:09:55 +01:00
OpenSenseMap sensors in HACS for Home Assistant
- Python 100%
| custom_components/opensensemap_sensors | ||
| .gitignore | ||
| hacs.json | ||
| info.md | ||
| LICENSE | ||
| README.md | ||
OpenSenseMap Integration for Home Assistant
A custom Home Assistant integration to display sensor data from OpenSenseMap sensors.
Features
- Support for temperature, humidity, pressure, PM2.5, PM10, and other sensors
- Support for multiple sensor boxes - add as many senseboxes as you want
- Automatic updates every 5 minutes
- Configuration via UI
- Proper device classes and units of measurement
- Additional sensor attributes (sensor ID, last measurement time)
Installation
HACS (Recommended)
- Open HACS in your Home Assistant instance
- Click on "Integrations"
- Click the three dots in the top right corner
- Select "Custom repositories"
- Add this repository URL:
https://github.com/kkazakov/osm-temp-humidity-hacs - Select category: "Integration"
- Click "Add"
- Find "OpenSenseMap Sensors" in the list and click "Download"
- Restart Home Assistant
Manual Installation
- Copy the
custom_components/opensensemapdirectory to your Home Assistant'scustom_componentsdirectory - Restart Home Assistant
Local Testing
For local development and testing without GitHub:
- Locate your Home Assistant configuration directory (where
configuration.yamlis located) - Create a
custom_componentsdirectory if it doesn't exist - Copy the entire
custom_components/opensensemapdirectory from this project into your Home Assistant'scustom_componentsdirectory - The structure should look like:
config/ ├── configuration.yaml └── custom_components/ └── opensensemap/ ├── __init__.py ├── sensor.py ├── config_flow.py ├── manifest.json ├── strings.json └── translations/ └── en.json - Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration
- Search for "OpenSenseMap Sensors" and configure it
For development with auto-reload:
- Enable debug logging in
configuration.yaml:logger: default: info logs: custom_components.opensensemap: debug - Check logs in Settings → System → Logs
Configuration
- Go to Settings → Devices & Services
- Click "Add Integration"
- Search for "OpenSenseMap"
- Enter your Sensor Box ID (found in the URL at https://opensensemap.org/explore/YOUR_BOX_ID)
- Click "Submit"
Adding Multiple Sensor Boxes
You can add multiple OpenSenseMap sensor boxes to your Home Assistant instance:
- Repeat the configuration steps above for each sensor box
- Each sensor box will be added as a separate integration entry
- All sensors from each box will appear as separate entities
- Each box will have its own device in Home Assistant
Example: If you have 3 sensor boxes, simply add the integration 3 times with different Box IDs.
Finding Your Sensor Box ID
- Visit OpenSenseMap
- Browse or search for your sensor
- Click on the sensor to open its details
- Copy the Box ID from the URL (e.g.,
https://opensensemap.org/explore/5a1b2c3d4e5f6a7b8c9d0e1f) - The Box ID is:
5a1b2c3d4e5f6a7b8c9d0e1f
Supported Sensor Types
The integration automatically detects and configures sensor types including:
- Temperature (°C)
- Humidity (%)
- Pressure (hPa)
- PM2.5 (µg/m³)
- PM10 (µg/m³)
All other sensor types from your OpenSenseMap box are also imported with their respective units.
Usage Example
Once configured, sensors will appear as entities in Home Assistant. You can:
- Add them to your dashboard
- Use them in automations
- View historical data
- Create alerts based on sensor values
Example automation:
automation:
- alias: "High Temperature Alert"
trigger:
- platform: numeric_state
entity_id: sensor.opensensemap_temperature
above: 30
action:
- service: notify.mobile_app
data:
message: "Temperature is above 30°C!"
Troubleshooting
Sensor Not Found
- Verify the Box ID is correct
- Ensure the sensor is public and active on OpenSenseMap
- Check your internet connection
No Data
- Some sensors may not have recent measurements
- Check the OpenSenseMap website to verify the sensor is reporting data
API Errors
- The integration polls the OpenSenseMap API every 5 minutes
- If you experience rate limiting, this is normal and the integration will retry
Contributing
Contributions are welcome. Submit a Pull Request for review.
License
MIT License
Support
For issues, open a ticket on GitHub.