beckenc / homie-dht

ESP8266 MQTT Sensor Node (in deep sleep) based on homie-esp8266. Support DHT11, DHT22, BME280, SHT30, SHT31.
MIT License
12 stars 2 forks source link

No data published with deepSleep = false? #3

Open sandeen opened 5 years ago

sandeen commented 5 years ago

My homie-dht is behaving somewhat oddly.

With this config: "settings":{"type":"sht30","publishInterval":60,"publishForceKey":"temperature","publishForceVal":0.0,"deepSleep":false}

I seem to get no sensor data published, although I do get some heartbeat stuff from the device:

homie/homie-dht4/$stats/signal 72
homie/homie-dht4/$stats/uptime 5819

As a further twist, if I publish a config update:

mosquitto_pub -r -t 'homie/homie-dht4/$implementation/config/set' -f ./homie-dht4

I get temps published again, but if I delete the topic:

mosquitto_pub -r -t homie/homie-dht4/$implementation/config/set -n

the updates stop. (I hope the retained config message doesn't cause constant SPIFFs rewrites of the config?)

beckenc commented 4 years ago

Hi sandeen, sorry for the late response. Do you still have the problem?

I guess the problem is the naming of the HomieSetting forceValSetting, and forceKeySetting in Sensor.hpp.

Could you please change the code of Line 62 and 63 in Sensors.hpp from: , forceKeySetting("force key", "The key of the ...") , forceValSetting("force value", "The value for ...) to , forceKeySetting("publishForceKey", "The key of the ...") , forceValSetting("publishForceVal", "The value for ...)

If this fix your problem, please provide a pull request.