Page 1 of 1
Rules, clear line display not working
Posted: 26 Nov 2024, 17:19
by marktn
Hello!
I have an espeasy with a Display - ST7789 TFT and RFID - PN532 .
Tft works fine with http rules from domoticz.
Only sometimes it has a delay when it reads a tag, sends it to domoticz, and domoticz send a http rule that the tag is read.
So i thaugt lets do that in the espeasy rules. Never used it. It works, but it is not clearing the line after 2 seconds. What is wrong i my rule?
Code: Select all
on RFID#Tag do
st7789,txl,10, ****Tag-detected****:
timerSet,1,2
endon
on Rules#Timer=1 do
st7789,txl,10,
endon
Re: Rules, clear line display not working
Posted: 26 Nov 2024, 18:15
by chromo23
marktn wrote: ↑26 Nov 2024, 17:19
It works, but it is not clearing the line after 2 seconds. What is wrong i my rule?
I never used the plugin but try:
Edit: Probably it's a good idea to wrap your text always in quotation marks.
Re: Rules, clear line display not working
Posted: 26 Nov 2024, 18:24
by marktn
chromo23 wrote: ↑26 Nov 2024, 18:15
marktn wrote: ↑26 Nov 2024, 17:19
It works, but it is not clearing the line after 2 seconds. What is wrong i my rule?
I never used the plugin but try:
Edit: Probably it's a good idea to wrap your text always in quotation marks.
I did that, but then I also have the " " on ,my tft screen.
The timer should be okay?
Re: Rules, clear line display not working
Posted: 26 Nov 2024, 18:32
by chromo23
marktn wrote: ↑26 Nov 2024, 18:24
The timer should be okay?
The timer looks fine.
marktn wrote: ↑26 Nov 2024, 18:24
I did that, but then I also have the " " on ,my tft screen.
I guess Ath knows more about this...
Re: Rules, clear line display not working
Posted: 26 Nov 2024, 21:45
by Ath
marktn wrote: ↑26 Nov 2024, 18:24
I did that, but then I also have the " " on ,my tft screen.
Not sure what kind of quotes you used, but text containing commas or spaces should be wrapped in a pair of (the same) quotes, either double quotes, single quotes or backticks.
To erase your initial message, just put the same amount of spaces (wrapped in quotes) as the original text message at the same line:
Code: Select all
on Rules#Timer=1 do
st7789,txl,10," " // Erase message
endon
NB: Rules script is trimmed of spaces and comments removed before being processed, that's why your line containing only spaces doesn't work.
Re: Rules, clear line display not working
Posted: 26 Nov 2024, 22:10
by marktn
Thanks! It works.