Standardize MQTTDiscovery Temp Keys [deprecate tem key] (#703)

* Detect when sensor isn't available or read fails

* Add temperature conversion macros

* Add 'tempc' & 'tempf' keys to published values

* Unique Values for HA Discovery

* Remove degree symbol from temp sensors

Co-authored-by: Jonathan Michael Wells <jonathan-wells@oist.jp>
This commit is contained in:
JonandJonathan Michael Wells authored and GitHub committed 2020-07-24 10:10:44 -05:00
1 parent b7a4591518
commit 4f1b49d135
10 files changed
+97 -52

No files matched your search

+7 -1
View File
@@ -5,11 +5,14 @@ Subscribe to all the messages with mosquitto or open your MQTT client software:
### ADC
The value is between 0 and 1024 and is tranmitted via Mqtt when it changes.
`home/OpenMQTTGateway/DHTtoMQTT {"value":543}`
`home/OpenMQTTGateway/ADCtoMQTT {"value":543}`
### DHT
You will receive every TimeBetweenReadingDHT (set into config_DHT.h) the DHT measurement (30s per default).
`home/OpenMQTTGateway/DHTtoMQTT {"tempc":21,"tempf":69.8,"hum":51}`
Legacy (removed after release 0.9.5)
`home/OpenMQTTGateway/DHTtoMQTT {"temp":21,"hum":51}`
If you want to don't resend value when it is the same you can set dht_always = false in config_DHT.h
@@ -32,6 +35,9 @@ If you don't want to resend values that haven't changed you can set AHTx0_always
You will receive the DS18x20 sensor readings every DS1820_INTERVAL_SEC (set into config_DS1820.h) (60s by default).
Each sensor will be published under the following topic using each sensors' address.
`home/OpenMQTTGateway/CLIMAtoMQTT/ds1820/0x0000000000000000 {"tempc":27.8, "tempf":82.04, "type":"DS18B20","res":"12bit\n","addr":"0x28616411907650bc"}`
Legacy (removed after release 0.9.5)
`home/OpenMQTTGateway/CLIMAtoMQTT/ds1820/0x0000000000000000 {"temp":27.8,"unit":"C","type":"DS18B20","res":"12bit\n","addr":"0x28616411907650bc"}`
The units for temperature readings are sent in Celcius by default can be changed to ferenheight by setting DS1820_FAHRENHEIT = true in in config_DS1820.h