TinkerWorks / HomeSensorHub

GNU General Public License v3.0
3 stars 2 forks source link

Send simple values besides the json package to MQTT. #20

Closed BabyCakes13 closed 4 years ago

BabyCakes13 commented 4 years ago

Fixes #18.

Instead of sending the whole json payload (which will be usefull for database collection), also send each value as a separate publish (which is useful for haas). The result for one type of sensor is the following:

sensors-office/temperature/current { "measurement" = "celsius". "name" = "<class 'adafruit_bme280.Adafruit_BME280_I2C'>". "timestamp" = "2020-08-07 18:12:10.044375". "type" = "temperature". "value" = "27.48" } sensors-office/temperature/current/type temperature sensors-office/temperature/current/name <class 'adafruit_bme280.Adafruit_BME280_I2C'> sensors-office/temperature/current/value 27.48 sensors-office/temperature/current/timestamp 2020-08-07 18:12:10.044375 sensors-office/temperature/current/measurement celsius