Closed NorthernMan54 closed 3 years ago
Tested by putting the light sensor in a dark room (reading 2 LUX), then turned on the lights (~60 LUX). It then took about 3 minutes to populate thru HomeKit, the Tasmota UI updated almost instantly.
Frequency of data updates is controlled by the Tasmota device itself and not the plugin itself. The plugin does not poll the device for status, but processes telemetry updates as they are received. The plugin watches for telemetry updates on the tele/SENSOR topic ie 'tasmota-5042/tele/SENSOR'.
During initialization of the plugin, it sets the teleperiod option to 300 seconds ( 5 minutes ). This is done to force the device to refresh status immediately after plugin startup. And then further updates are published every 5 minutes by the accessory.
To drive realtime updates of sensor value changes a rule would need to be created on the device to publish the new data on the appropriate tele/SENSOR topic for the device whenever a sensor changes value, something like this from the Tasmota rule cookbook.
https://tasmota.github.io/docs/Rules/#transmit-sensor-value-only-when-a-delta-is-reached
Rule1
ON SI7021#temperature>%var1% DO Backlog var1 %value%; publish stat/mqttTopic/temp %value%; var2 %value%; add1 2; sub2 2 ENDON
ON SI7021#temperature<%var2% DO Backlog var2 %value%; publish stat/mqttTopic/temp %value%; var1 %value%; add1 2; sub2 2 ENDON
This is discussed in detail in this Tasmota issue https://github.com/arendst/Tasmota/issues/2567
Welp... That answers that. Might as well close this, as operator error... Due to the operator not knowing how to use his toys very well.
PS This is not a issue for Lights, Switches etc due to this option
@StumbleNOLA I had exactly the same thought last night when doing testing, so I figured a lot of other people are going to ask the same question, hence my detailed answer. If you do come up with a rule, adding it here would help others.
I will try to get something working, and assuming I can post it.
Also since I have zero coding background, I am writing up everything that I am doing as a users guide. Something of an idiots guide to the plugin/Tasmota environment for people who's eye's glaze over when they look at a json file. If it gets to a reasonable level I may share that as well.
This may work for you
Rule1 ON BH1750#Illuminance!=%var1% DO Backlog var1 %value%; teleperiod 300; ENDON
Rule1 1
To disable, rule1 0
Post these lines into the Tasmota console for the device
I didn't get your rule suggestion to work... I am not sure I entered it correctly though, I just copied and pasted it it into the terminal on one line.
However what is working reasonably well is to lower to teleperiod to 10 seconds (the lowest it will go) by enter ing "Telepresence 10". It likely ends up costing a lot of wifi traffic, but the response time is now reasonably snappy.
Try pasting this
Rule1 ON BH1750#Illuminance!=%var1% DO Backlog var1 %value%; teleperiod 300; ENDON
then
rule1 1
I changed the telepresence back to 300, then input your rule.
Everything seems to be working as expected. The refresh rate seems to be about 3 seconds at the fastest, which is perfectly reasonable.
Awesome
Closing this
From @StumbleNOLA