Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot setup DHT22 Room Humidity Sensor, but setup as Chamber Humidity Sensor works #423

Open
denisfrench opened this issue Mar 10, 2024 · 7 comments

Comments

@denisfrench
Copy link

Hi; I've noticed on the device setup page (http://brewpiless.local/setup.htm) that I cannot setup a DHT22 as a Room Humidity Sensor in the first instance. The device stays when I hit "apply", but the sensor value shows 255 continiously, and the temperature sensor does not show up when devices are refreshed.

I am able to work around this by setting the DHT22 as a Chamber Humidity Sensor first, and then change it to a Room Humidity Sensor. This then works okay, but the sensor continues to be reported in MQTT as fridgeHumidity not roomHumidity.

I'm compiling version 4.4 ce14288 using the esp32-oled default build environment and config.

Thanks for your work on this!

@vitotai
Copy link
Owner

vitotai commented Mar 17, 2024

I missed a few lines of code for Room humidity sensor which I never tested. Sorry for that.

@denisfrench
Copy link
Author

Confirmed fixed at my end; thanks! 🙏

@denisfrench
Copy link
Author

denisfrench commented Mar 21, 2024

I was too quick!

Adding DHT22 as room sensor now works, except it is still being reported within MQTT as fridgeHumidity.

Before this fix using the workaround it was reporting a value via MQTT, even through the topic was incorrect. Now it is reporting random single keyboard symbols (eg ,*-.).

Nearly there!

@denisfrench denisfrench reopened this Mar 21, 2024
@vitotai
Copy link
Owner

vitotai commented Mar 29, 2024

Yeah, the tag was wrong. However, I don't get it how the value was wrong.

@denisfrench
Copy link
Author

Hi; is the latest commit (b05b25a) ready for testing?

I'm getting an error when compiling esp32-oled as follows:

src/MqttRemoteControl.cpp: In member function 'void MqttRemoteControl::_reportData()':
src/MqttRemoteControl.cpp:165:59: error: expected primary-expression before ',' token
             if(rh <= 100) lastID=_publish(KeyRoomHumidity,,rh);
                                                           ^
*** [.pio\build\esp32-oled\src\MqttRemoteControl.cpp.o] Error 1
================================================================================================== [FAILED] Took 20.17 seconds ==================================================================================================
Environment    Status    Duration
-------------  --------  ------------
esp32-oled     FAILED    00:00:20.166

@koekie
Copy link

koekie commented Apr 8, 2024

I fixed it in the following way:
if(rh <= 100) lastID=_publish(KeyRoomHumidity, rh, 0);
(When you leave out the 0 the _publish method assumes the value is a char, which it not really is).

I have fixed some of the issues already in my forked version of this repo (for which I might prepare a PR for in the future if @vitotai is up for that, but I will reach out when I have the time to do so), check the following:

https://github.com/koekie/BrewPiLess/blob/master/src/MqttRemoteControl.cpp#L162-L171

@denisfrench
Copy link
Author

@vitotai release version 4.4 (a37150f) fixes the roomHumidity topic, but the MQTT data now randomly sends either " or ! for some reason.

@koekie your latest commit (198ab13) fixes this issue in toto, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants