Homepage

55 views
Skip to first unread message

Benjamin Reim

unread,
Jul 6, 2020, 6:27:46 AM7/6/20
to TasmotaUsers
I have a WEMOS Mini plus SR-04 distance sensor to monitor a cistern. I made a rule to calculate the fill level in % and publish that via MQQT. Everything works fine.
Is there any way to display the variable "var1" which holds the value for the fill level on the home page? This would come handy since it's the only device in the network and I simply could check in the browser what fill level I have.

Norbert R.

unread,
Jul 6, 2020, 6:47:32 AM7/6/20
to TasmotaUsers


On Monday, 6 July 2020 12:27:46 UTC+2, Benjamin Reim wrote:
Is there any way to display the variable "var1" which holds the value for the fill level on the home page?

unfortunately not

if a wrong description doesn't misleading you, use e.g a counter and set their value:

Configure an unsued GPIO as Counter1 (e.g. GPIO12 42) and set the counter accordingly with Counter1% var1%

rg
Norbert

Benjamin Reim

unread,
Jul 6, 2020, 7:06:38 AM7/6/20
to TasmotaUsers
Hi Norbert !
Thanks that helps. Although the correct syntax is counter1 %var1%. Didn't mislead me either :-)

Laurentp

unread,
Jul 6, 2020, 9:14:00 AM7/6/20
to TasmotaUsers

I have a WEMOS Mini plus SR-04 distance sensor to monitor a cistern. I made a rule to calculate the fill level in % and publish that via MQQT. Everything works fine.

Coud You publish how did You made it? (setup, rules, etc). For me and others :).

Laurent

Benjamin Reim

unread,
Jul 6, 2020, 9:49:58 AM7/6/20
to TasmotaUsers
I am using tasmota_sensors on WEMOS D1 mini pro

GPIO4 = SR04 Tri/TX
GPIO5 = SR04 Ech/RX

Rule1
on tele-SR04#distance do backlog var1 %value%; event checklimit=%value%; event senddistance endon
on event#checklimit>138 do var1 138 endon
on event#checklimit<28 do var1 28 endon
on event#senddistance do backlog Calcres 1; SCALE1 %var1%, 138, 28, 0, 100; event pubdata endon
on event#pubdata do counter1 %var1% endon

138 cm is the low lvel; 28 cm is the maximum level. Has to be adjusted according to the situation.
With the counter trick the counter value is automatically published with tele/xxx/SENSORS

Slavko

unread,
Jul 6, 2020, 9:57:33 AM7/6/20
to TasmotaUsers

Benjamin Reim

unread,
Jul 6, 2020, 10:06:44 AM7/6/20
to TasmotaUsers
Sorry, I forgot: GPIO2 = Counter1

Laurentp

unread,
Jul 6, 2020, 12:21:42 PM7/6/20
to TasmotaUsers

GPIO4 = SR04 Tri/TX
GPIO5 = SR04 Ech/RX

Great, is it possible to have more than 1 such sensor on ESP module? How?
(or how to modify code :P )

Laurent

Je FaSch

unread,
Oct 26, 2020, 2:38:18 PM10/26/20
to TasmotaUsers
Hi,
I read this discussion today. I have a working NodeMCU with SR04 attached and running with MQTT.
I used this code to see the counter and get it published. This all worked for me. But in addition I want
to see the original SENSORS/SR04_Distance value. This value vanished, after applying the rules.
What has to be done, to get both values?

Thanks
Jens

Je FaSch

unread,
Oct 26, 2020, 2:48:17 PM10/26/20
to TasmotaUsers
Sorry, found the typo.
Reply all
Reply to author
Forward
0 new messages