This Python script collects weather data from an Ecowitt weather station and sends it to Narodmon, a popular public monitoring service. The script periodically queries the Ecowitt API, extracts all available weather data, and sends it to Narodmon for visualization and tracking.
- π Collects data from an Ecowitt weather station using its API.
- π‘ Sends weather data such as temperature, humidity, pressure, wind speed, gust, direction, rainfall rate, solar radiation, and UV index to Narodmon.
- π Designed to run continuously, sending updates every 5 minutes.
- π Simple logging to console for debug purposes.
- π Python 3.7 or higher
- π¦οΈ Ecowitt weather station with API access enabled
- π‘ Narodmon account to monitor and share weather data
-
Clone this repository:
git clone https://github.com/CyberScopeToday/ecowitt-elevator-narodmon.git cd ecowitt-elevator-narodmon
-
Create a virtual environment:
python3 -m venv venv
-
Activate the virtual environment:
- On Linux/macOS:
source venv/bin/activate
- On Windows:
venv\Scripts\activate
- On Linux/macOS:
-
Install the required Python packages:
pip install -r requirements.txt
-
Update the configuration parameters in
bot.py
:-
Set your Ecowitt API credentials:
ecowitt_application_key
ecowitt_api_key
ecowitt_mac
-
Set your Narodmon device MAC address:
narodmon_device_mac
-
-
Run the script:
python bot.py
-
Optionally, run the script as a service:
Create a systemd service unit file as follows to run the script as a background service (e.g.,
/etc/systemd/system/ecowitttonarodmon.service
):[Unit] Description=Ecowitt to Narodmon Data Sender After=network.target [Service] User=root WorkingDirectory=/home/server/ecowitttonarodmon ExecStart=/home/server/ecowitttonarodmon/venv/bin/python /home/server/ecowitttonarodmon/bot.py Restart=always RestartSec=5 Environment="PYTHONPATH=/home/server/ecowitttonarodmon/venv/bin/python" StandardOutput=file:/var/log/ecowitttonarodmon.log StandardError=file:/var/log/ecowitttonarodmon.log [Install] WantedBy=multi-user.target
Then enable and start the service:
sudo systemctl daemon-reload sudo systemctl enable ecowitttonarodmon.service sudo systemctl start ecowitttonarodmon.service
ecowitt_application_key
: Your Ecowitt application key.ecowitt_api_key
: Your Ecowitt API key.ecowitt_mac
: MAC address of the Ecowitt weather station.narodmon_device_mac
: MAC address of your Narodmon device.
Logs will be stored at /var/log/ecowitttonarodmon.log
. You can check them with:
cat /var/log/ecowitttonarodmon.log
Feel free to submit pull requests, open issues, and suggest features. Contributions are always welcome! π
This project is licensed under the MIT License.
- π¦οΈ Ecowitt for providing their weather station API.
- π‘ Narodmon for enabling public data monitoring.