Page 1 of 1

refresh generic mqtt import

Posted: 16 Sep 2021, 16:37
by edstobi
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

Re: refresh generic mqtt import

Posted: 16 Sep 2021, 16:51
by TD-er
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

Re: refresh generic mqtt import

Posted: 16 Sep 2021, 17:21
by edstobi
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