|  | @ -35,6 +35,7 @@ static bool Mqtt_Enabled = true; | 
		
	
		
			
				|  |  | static void Mqtt_ClientCallback(const char *topic, const byte *payload, uint32_t length); |  |  | static void Mqtt_ClientCallback(const char *topic, const byte *payload, uint32_t length); | 
		
	
		
			
				|  |  | static bool Mqtt_Reconnect(void); |  |  | static bool Mqtt_Reconnect(void); | 
		
	
		
			
				|  |  | static void Mqtt_PostHeartbeatViaMqtt(void); |  |  | static void Mqtt_PostHeartbeatViaMqtt(void); | 
		
	
		
			
				|  |  |  |  |  | static void Mqtt_PostWiFiRssi(void); | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | void Mqtt_Init() { |  |  | void Mqtt_Init() { | 
		
	
		
			
				|  |  |     #ifdef MQTT_ENABLE
 |  |  |     #ifdef MQTT_ENABLE
 | 
		
	
	
		
			
				|  | @ -114,6 +115,7 @@ void Mqtt_Cyclic(void) { | 
		
	
		
			
				|  |  |             Mqtt_Reconnect(); |  |  |             Mqtt_Reconnect(); | 
		
	
		
			
				|  |  |             Mqtt_PubSubClient.loop(); |  |  |             Mqtt_PubSubClient.loop(); | 
		
	
		
			
				|  |  |             Mqtt_PostHeartbeatViaMqtt(); |  |  |             Mqtt_PostHeartbeatViaMqtt(); | 
		
	
		
			
				|  |  |  |  |  |             Mqtt_PostWiFiRssi(); | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
		
			
				|  |  |     #endif
 |  |  |     #endif
 | 
		
	
		
			
				|  |  | } |  |  | } | 
		
	
	
		
			
				|  | @ -175,6 +177,16 @@ bool publishMqtt(const char *topic, uint32_t payload, bool retained) { | 
		
	
		
			
				|  |  |     #endif
 |  |  |     #endif
 | 
		
	
		
			
				|  |  | } |  |  | } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |  |  |  | // Cyclic posting of WiFi-signal-strength
 | 
		
	
		
			
				|  |  |  |  |  | void Mqtt_PostWiFiRssi(void) { | 
		
	
		
			
				|  |  |  |  |  |     static uint32_t lastMqttRssiTimestamp = 0; | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |  |     if (!lastMqttRssiTimestamp || (millis() - lastMqttRssiTimestamp >= 60000)) { | 
		
	
		
			
				|  |  |  |  |  |         lastMqttRssiTimestamp = millis(); | 
		
	
		
			
				|  |  |  |  |  |         publishMqtt((char *) FPSTR(topicWiFiRssiState), Wlan_GetRssi(), false); | 
		
	
		
			
				|  |  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |  | } | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  | /* Cyclic posting via MQTT that ESP is still alive. Use case: when ESPuino is switched off, it will post via
 |  |  | /* Cyclic posting via MQTT that ESP is still alive. Use case: when ESPuino is switched off, it will post via
 | 
		
	
		
			
				|  |  |    MQTT it's gonna be offline now. But when unplugging ESPuino e.g. openHAB doesn't know ESPuino is offline. |  |  |    MQTT it's gonna be offline now. But when unplugging ESPuino e.g. openHAB doesn't know ESPuino is offline. | 
		
	
		
			
				|  |  |    One way to recognize this is to determine, when a topic has been updated for the last time. So by |  |  |    One way to recognize this is to determine, when a topic has been updated for the last time. So by | 
		
	
	
		
			
				|  | 
 |