parent
caffafdfbc
commit
3779547a95
@ -1,6 +1,6 @@
|
||||
PGUSER="udi"
|
||||
PGUSER="uditest"
|
||||
PGHOST=`kubectl get services traefik -n system -o jsonpath="{.status.loadBalancer.ingress[0].ip}"`
|
||||
PGPASSWORD=`kubectl get secrets udi-db-cred -n udi -o jsonpath="{.data.PGPASSWORD}" | base64 --decode`
|
||||
PGPASSWORD=`kubectl get secrets uditest-db-cred -n udi-test -o jsonpath="{.data.PGPASSWORD}" | base64 --decode`
|
||||
PGSSLMODE=require
|
||||
PGDATABASE="uditest"
|
||||
export PGUSER PGHOST PGPASSWORD PGSSLMODE PGDATABASE
|
||||
|
@ -1,105 +0,0 @@
|
||||
{
|
||||
"mqtt": {
|
||||
"broker": "mqtt://172.23.1.102:1883",
|
||||
"tlsEnable": "false"
|
||||
},
|
||||
"topicMappings": [
|
||||
{
|
||||
"topics": [ "IoT/PV/Values" ],
|
||||
"handler": "PV",
|
||||
"id": "PV",
|
||||
"config": {
|
||||
"databaseConnStr": "",
|
||||
"attributes": {
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"topics": [ "IoT/MBGW3/Measurement" ],
|
||||
"handler": "MBGW3",
|
||||
"id": "MBGW3",
|
||||
"config": {
|
||||
"databaseConnStr": "",
|
||||
"attributes": {
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"topics": [ "IoT/OneWireGW/Bus 1/#" ],
|
||||
"handler": "SVER",
|
||||
"id": "SVER0",
|
||||
"config": {
|
||||
"databaseConnStr": "",
|
||||
"attributes": {
|
||||
"application": "Temperature Heating",
|
||||
"payloadRegex": "(\\d+(\\.\\d+)?)\\s*([^0-9\\s]\\S*)",
|
||||
"deviceFrom": "topic",
|
||||
"devicePart": "3",
|
||||
"valueFrom": "payload",
|
||||
"valuePart": "1",
|
||||
"unitFrom": "payload",
|
||||
"unitPart": "3"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"topics": [ "NR/Multisensor/+/Temperatur" ],
|
||||
"handler": "SVEJ",
|
||||
"id": "SVEJ0",
|
||||
"config": {
|
||||
"databaseConnStr": "",
|
||||
"attributes": {
|
||||
"application": "Temperature Multisensor",
|
||||
"deviceSelector": "T:2",
|
||||
"valueSelector": "J:$.CurrentTemperature",
|
||||
"unitSelector": "C:°C"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"topics": [ "NR/Multisensor/+/Feuchte" ],
|
||||
"handler": "SVEJ",
|
||||
"id": "SVEJ1",
|
||||
"config": {
|
||||
"databaseConnStr": "",
|
||||
"attributes": {
|
||||
"application": "Humidity Multisensor",
|
||||
"deviceSelector": "T:2",
|
||||
"valueSelector": "J:$.CurrentRelativeHumidity",
|
||||
"unitSelector": "C:%"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"topics": [ "shellyplusht/+/status/temperature:0" ],
|
||||
"handler": "SVEJ",
|
||||
"id": "SVEJ2",
|
||||
"config": {
|
||||
"databaseConnStr": "",
|
||||
"attributes": {
|
||||
"application": "Temperature Shelly Plus HT",
|
||||
"deviceSelector": "T:1",
|
||||
"valueSelector": "J:$.tC",
|
||||
"unitSelector": "C:°C"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"topics": [ "shellyplusht/+/status/humidity:0" ],
|
||||
"handler": "SVEJ",
|
||||
"id": "SVE4",
|
||||
"config": {
|
||||
"databaseConnStr": "",
|
||||
"attributes": {
|
||||
"application": "Humidity Shelly Plus HT",
|
||||
"deviceSelector": "T:1",
|
||||
"valueSelector": "J:$.rh",
|
||||
"unitSelector": "C:%"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"archiver": {
|
||||
"dir": "./tmp/udi"
|
||||
}
|
||||
}
|
@ -14,6 +14,7 @@ import "udi/handlers/pv"
|
||||
import "udi/handlers/mbgw3"
|
||||
import "udi/handlers/sver"
|
||||
import "udi/handlers/svej"
|
||||
import "udi/handlers/dt1t"
|
||||
|
||||
|
||||
var handlerMap map[string]handler.Handler = make(map[string]handler.Handler)
|
||||
@ -40,6 +41,8 @@ func InitDispatcher() {
|
||||
factory = sver.NewSverHandler
|
||||
case "SVEJ":
|
||||
factory = svej.NewSvejHandler
|
||||
case "DT1T":
|
||||
factory = dt1t.NewDt1tHandler
|
||||
default:
|
||||
factory = nil
|
||||
log.Printf("No handler %s found, ignore mapping", mapping.Handler)
|
||||
|
Loading…
x
Reference in New Issue
Block a user