Phase 1 Complete: Preparation & Cleanup
Directory structure: - Created src/sensorpajen/ for new Python package - Created config/ for configuration templates - Created legacy/ for old scripts - Created systemd/ and debian/ for future phases Package setup: - Added pyproject.toml with modern Python packaging - Created package __init__.py - Defined dependencies: bluepy, paho-mqtt Configuration: - Created config/sensors.json.example (converted from INI) - Created config/sensorpajen.env.example for environment variables - All 8 Xiaomi sensors migrated to JSON format Cleanup: - Removed temperatur_koksfonstret.py (DHT11 functionality) - Moved all legacy scripts to legacy/ folder: - LYWSD03MMC.py - bluetooth_utils.py - sendToMQTT.sh - sensorer.sh - startup.sh - sensorer.ini Updated ROADMAP.md to mark Phase 1 as complete. Next: Phase 2 - Python Package Structure
This commit is contained in:
20
legacy/sendToMQTT.sh
Executable file
20
legacy/sendToMQTT.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
#This script is provided by Chiunownow https://github.com/Chiunownow
|
||||
#Thank you very much for providing this script
|
||||
#This script is
|
||||
|
||||
#use e.g with that script: MySensor.sh
|
||||
#!/bin/bash
|
||||
#DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
#$DIR/LYWSD03MMC.py -d <device> -b 1000 -r --debounce --skipidentical 50 --name MySensor --callback sendToMQTT
|
||||
|
||||
#mosquitto_pub -h mqtt.host -t "MiTemperature2/$2/temp" -u mqtt.username -P mqtt.passwd -i "mibridge" -m "$3"
|
||||
#mosquitto_pub -h mqtt.host -t "MiTemperature2/$2/humidity" -u mqtt.username -P mqtt.passwd -i "mibridge" -m "$4"
|
||||
#mosquitto_pub -h mqtt.host -t "MiTemperature2/$2/batteryvoltage" -u mqtt.username -P mqtt.passwd -i "mibridge" -m "$5"
|
||||
#mosquitto_pub -h mqtt.host -t "MiTemperature2/$2/batterylevel" -u mqtt.username -P mqtt.passwd -i "mibridge" -m "$6"
|
||||
|
||||
mosquitto_pub -h 192.168.0.114 -t "MiTemperature2/$2/temp" -u hasse -P casablanca -i "mibridge" -m "$3"
|
||||
mosquitto_pub -h 192.168.0.114 -t "MiTemperature2/$2/humidity" -u hasse -P casablanca -i "mibridge" -m "$4"
|
||||
mosquitto_pub -h 192.168.0.114 -t "MiTemperature2/$2/batteryvoltage" -u hasse -P casablanca -i "mibridge" -m "$5"
|
||||
mosquitto_pub -h 192.168.0.114 -t "MiTemperature2/$2/batterylevel" -u hasse -P casablanca -i "mibridge" -m "$6"
|
||||
Reference in New Issue
Block a user