Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tam
setChannel 10 0
addChannel 10 $CH11
publishFloat myAverageResult $CH10/5
setChannel 10 0
startDriver SHT3X
SHT_Calibrate 0 0
addEventHandler OnHold 20 SafeMode 3
waitFor WiFiState 4
waitFor MQTTState 1
SHT_Measure
delay_s 1
addChannel 10 $CH2
publishFloat "temperature" $CH10/10
delay_s 1
publishInt "humidity" $CH3
delay_s 1
SendGET http://192.168.0.222:80/sensorTemp?id=10178502&t=$CH2&h=$CH3&p=1000&v=1
delay_s 5
DeepSleep 120p.kaczmarek2 wrote:SHT30, not STH30. In addition, remember that this sensor has a selectable address, so you need to use the same as on the PCB.... I think so.
// addRepeatingEvent [IntervalSeconds][RepeatsOr-1][CommandToRun]
addRepeatingEvent 10 1 setChannel 1 0
addRepeatingEvent 30 1 DeepSleep 900erdeidominik1999 wrote:@p.kaczmarek2 I think it is the same as retain with another payload, if the retain flag is set you should add the retain to the publish.]
erdeidominik1999 wrote:
So if the repeating event is clear to me, if I add this before the wait for mqtt state 1 for example, if it fails to connect in 30 seconds it will go to sleep for 15 mins?addRepeatingEvent 30 1 DeepSleep 900
TL;DR: Stock firmware can empty two AAA cells in just 6 h at a 10-min refresh rate [Elektroda, dheenhasty, post #20385425] “SHT30 seems very simple to support” [Elektroda, p.kaczmarek2, post #20362193] Use DeepSleep + PowerSave to cut current by >90 %.
Why it matters: Proper scripting turns a one-week gadget into a months-long sensor.
• MCU: Beken BK7231N CBU module, 3.3 V core, Wi-Fi b/g/n [Elektroda, p.kaczmarek2, post #20362193] • Temp/Humidity chips: SHT30 or CHT8310/8315, I²C @ 100 kHz [Sensirion, 2023] • Battery range: 2.0 – 3.0 V (two AAA) [Elektroda, user_param_key dump] • DeepSleep current: ≈ 6 µA; active Wi-Fi current: ≈ 70 mA [Elektroda, dheenhasty, post #20393117] • Typical script wake-time: 8–12 s, 15-min cycle ⇒ ~1 % duty-cycle power use.
addRepeatingEventID 30 1 999 DeepSleep 900 before waitFor MQTTState 1; if MQTT is still down after 30 s the sensor sleeps for 15 min [Elektroda, erdeidominik1999, post #20792052]PowerSave. 2 ) measure once, publish, sleep:startDriver SHT3X → waitFor MQTTState 1 → SHT_Measure → publishChannels → DeepSleep 900. 3 ) Use flag 37 for quick Wi-Fi connect. Users report >30 days on AAA with a 15-min cycle [Elektroda, dheenhasty, post #20456982]mqtt_broadcastInterval left at 1 s sends five retained topics, stretching awake time. Set it to 60 s or disable extra broadcasts to avoid triple publishes [Elektroda, Xinayder, post #20882846]SHT_Calibrate <TempOffset> <RHOffset> once in autoexec, e.g. SHT_Calibrate -2.4 3 lowers reported temperature by 2.4 °C and raises humidity by 3 % RH [Elektroda, dheenhasty, post #20458926]PowerSave active and no WebLog, idle current falls from ~70 mA to 6 - 8 mA, a 90 % reduction [Elektroda, dheenhasty, post #20393117]OBK_XXXX AP.temperature_div10 for 0.1 °C granularity or divide in publish: publishFloat temp $CH2/10. OBK trims trailing zeros from JSON [Elektroda, p.kaczmarek2, post #20458933]autoexec.bat, letting you reconfigure via AP without UART [Elektroda, p.kaczmarek2, post #21014538]