Mqtt discovery for ha (#323)

* MQTT discovery factoring

* add DHT discovery

* BME topic macro change

* add sensors to ha discovery

* correct a comment typo #327

* let the possibility at buildtime to don't publish service data

* reduce string usage

* change MQTT ONOFF actuator to ON OFF commands instead of true false

* add ZactuatorONOFF discovery

* add simple publishing for GPIO input

* Add RF switch and gateway discovery
This commit is contained in:
Florian authored and GitHub committed 2018-12-16 17:05:30 +01:00
1 parent ed44418a7f
commit 133e9cd33a
21 files changed
+442 -201

No files matched your search

+5 -5
View File
@@ -64,7 +64,7 @@ void MeasureLightIntensity()
static float persistedlf;
static float persistedlw;
unsigned int Lux;
float FtCd;
float ftcd;
float Wattsm2;
// Check if reads failed and exit early (to try again).
@@ -78,7 +78,7 @@ void MeasureLightIntensity()
// Calculate the Values
Lux = i/1.2; // Convert to Lux
FtCd = Lux/10.764;
ftcd = Lux/10.764;
Wattsm2 = Lux/683.0;
/*
@@ -104,8 +104,8 @@ void MeasureLightIntensity()
}
// Generate FtCd
if(FtCd != persistedlf || bh1750_always){
BH1750data.set("ftCd", (unsigned int)FtCd);
if(ftcd != persistedlf || bh1750_always){
BH1750data.set("ftcd", (unsigned int)ftcd);
}else{
trc(F("Same ftcd don't send it"));
}
@@ -119,7 +119,7 @@ void MeasureLightIntensity()
if(BH1750data.size()>0) pub(subjectBH1750toMQTT,BH1750data);
}
persistedll = Lux;
persistedlf = FtCd;
persistedlf = ftcd;
persistedlw = Wattsm2;
}
}