SDS011 and DHT22
Posted: Wednesday 19 December 2018 16:03
Anyone who can add dht22 support to this script?
#!/bin/bash
# Settings
DOMO_IP="192.168.200.15" # Domoticz IP adres
DOMO_PORT="8080" # Domoticz port
FIJNSTOFSENSOR="192.168.200.135" # Fijnstofsensor IP adres
SDS10IDX="5487" # IDX in domoticz voor PM10
SDS25IDX="5488" # IDX in domoticz voor PM2.5
# Laad alle waarden in een array
mapfile -t FIJNSTOF < <(curl -s $FIJNSTOFSENSOR/data.json | jq -r '.sensordatavalues[].value')
declare -p FIJNSTOF > /dev/null
# Stuur data naar domoticz
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=udevice&idx=$SDS10IDX&nvalue=0&svalue=${FIJNSTOF[0]}" > /dev/null 2>&1
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=udevice&idx=$SDS25IDX&nvalue=0&svalue=${FIJNSTOF[1]}" > /dev/null 2>&1
#!/bin/bash
# Settings
DOMO_IP="192.168.200.15" # Domoticz IP adres
DOMO_PORT="8080" # Domoticz port
FIJNSTOFSENSOR="192.168.200.135" # Fijnstofsensor IP adres
SDS10IDX="5487" # IDX in domoticz voor PM10
SDS25IDX="5488" # IDX in domoticz voor PM2.5
# Laad alle waarden in een array
mapfile -t FIJNSTOF < <(curl -s $FIJNSTOFSENSOR/data.json | jq -r '.sensordatavalues[].value')
declare -p FIJNSTOF > /dev/null
# Stuur data naar domoticz
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=udevice&idx=$SDS10IDX&nvalue=0&svalue=${FIJNSTOF[0]}" > /dev/null 2>&1
curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command¶m=udevice&idx=$SDS25IDX&nvalue=0&svalue=${FIJNSTOF[1]}" > /dev/null 2>&1