TEHU


Currently, the firmware supports Dallas Semiconductor DS1820, DS18B20, DS18S20, DS1822, MAX31820, MAX31850 thermometers,
DHT11 (RHT01), DHT22 (RHT03, AM2302) temperature/humidity sensors. It also handles the internal thermometer of the DS3231 RTC. These sensors operate on a 3.3V power supply, and the DATA pin can be configured in the Setup/Peripherals menu. Pull-up resistors on the D3, D4 pins are not mandatory but recommended. Up to 4 Dallas thermometers can be connected in parallel to one pin, allowing a total of 16 sensors to be handled. The Vcc pin is connected to ground, operating in "parasite" mode. In this way, only two wires are needed, but I do not recommend using it, as I have found that measurements are inaccurate with this connection. A 1k pull-up resistor sometimes helps.




DS and DHT Sensors

TEHU[0]@
Sends the sensor temperature value to STDOUT.

TEHU[0]C@
Temperature in Celsius.
TEHU[0]F@
Temperature in Fahrenheit.

DS Sensor

TEHU[0](0)@
TEHU[0](1)@
TEHU[0](2)@
TEHU[0](3)@
Temperatures of DS sensors connected in parallel.

DHT Sensor

TEHU[0]HUM@
Relative humidity in percentage.
TEHU[0]AHUM@
Absolute humidity in percentage.
TEHU[0]DEW@
Dew point.

TEHU[0]H@
Relative humidity in percentage.
TEHU[0]AH@
Absolute humidity in percentage.
TEHU[0]DEWC@
Dew point in Celsius.
TEHU[0]DEWF@
Dew point in Fahrenheit.

STR / NUM

NUM[0]!=%TEHU[0]
STR[0]=%TEHU[0]HUM
NUM[0]@
STR[0]@
STR / NUM example.



Examples

Thermostat
NUM[0]=28|
NUM[1]=30|
NUM[2]VL=NUM[0]|
NUM[2]VH=NUM[1]|
NUM[2]CL:GPIO[D1]H;LED(ON)|
NUM[2]CH:GPIO[D1]L;LED(OFF)|
TIMES:NUM[2]=%TEHU[0];STR[3]@=%TEHU[0]

<html> <body> <H1 id="therm"></H1><br> <b>Min</b><input type="number" id="min"> <b>Max</b><input type="number" id="max"> <button type="button" onclick="set();">Send</button> <br><br> <script type="text/javascript" src="tools.js"></script> <script> startWS(0); function onOpen() { sendWS("NUM[2]VL@0@"); sendWS("NUM[2]VH@1@"); } function onMessage(msg) { var wsin = msg.split("@"); if (wsin[1] === "0") {document.getElementById("min").value = wsin[0]; return;} if (wsin[1] === "1") {document.getElementById("max").value = wsin[0]; return;} document.getElementById("therm").innerHTML = "Thermostat<br><br>" + wsin[0]; } function set() { sendWS("NUM[2]VL=" + document.getElementById("min").value); sendWS("NUM[2]VH=" + document.getElementById("max").value); } </script> </body> </html>