refresh generic mqtt import

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
edstobi
Normal user
Posts: 14
Joined: 28 May 2020, 20:33

refresh generic mqtt import

#1 Post by edstobi » 16 Sep 2021, 16:37

hello
can i trigger some kind of refresh in the rules for generic mqtt import?
After the daily reboot of the espeasy (esp32 / 20114 - Mega32) the data for the rule ( on mqttimport#value} will only be active when the value changes the first time.
can i somehow say in the rules that it fetches a complete new refresh from the mqtt server?
THX

TD-er
Core team member
Posts: 5513
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: refresh generic mqtt import

#2 Post by TD-er » 16 Sep 2021, 16:51

Not sure I fully understand your question.

As the MQTT import is used in a task, the last values should be restored on a (warm) reboot.
So what you can do, is trigger the same event on which you trigger for new values.

Code: Select all

on System#Boot do
  event,mqttimport#value
endon

edstobi
Normal user
Posts: 14
Joined: 28 May 2020, 20:33

Re: refresh generic mqtt import

#3 Post by edstobi » 16 Sep 2021, 17:21

HMMM
ok I understand, but since I do not know the value that mqtt had transmitted (which is still on the mqtt server) , since I translate via mqtt the error message in text for an OLED, I am now somewhat at a loss how to proceed for 20 possible error messages.

Code: Select all

// ALARM MELDUNG
on LOGO3#cmdMQTT=0 do
  oledframedcmd,1, "   " 
  oledframedcmd,2, "[LOGO3#TempTeich]{D}C Wasser"
  oledframedcmd,3, "[LOGO3#TempLuft]{D}C Luft"
endon


on LOGO3#cmdMQTT=99 do
  oledframedcmd,1, "ALARM"   
  oledframedcmd,2, "Pumpenalarm"   
  oledframedcmd,3, "Pumpen prüfen"   
endon

on LOGO3#cmdMQTT=98 do
 oledframedcmd,1, "ALARM"
 oledframedcmd,2, "Wasserstop 60 min"  
 oledframedcmd,3, "Reset Wasserstop" 
endon

on LOGO3#cmdMQTT=97 do
 oledframedcmd,1, "Aktion"
 oledframedcmd,2, "TF Spuehlt" 
 oledframedcmd,3, "   " 
endon

on LOGO3#cmdMQTT=82 do
oledframedcmd,1, "ALARM"
 oledframedcmd,2, "LOGO Verbindung down"  
 oledframedcmd,3, "   " 
 endon
 


Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests