|  | @ -153,6 +153,10 @@ class PubMqtt { | 
			
		
	
		
		
			
				
					|  |  |                 publish(mSubTopic, ((iv->commEnabled) ? dict[STR_TRUE] : dict[STR_FALSE]), true); |  |  |                 publish(mSubTopic, ((iv->commEnabled) ? dict[STR_TRUE] : dict[STR_FALSE]), true); | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "comm_disabled"); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             publish(mSubTopic, (((*mUtcTimestamp > (sunset + offs)) || (*mUtcTimestamp < (sunrise - offs))) ? dict[STR_TRUE] : dict[STR_FALSE]), true); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |             return true; |  |  |             return true; | 
			
		
	
		
		
			
				
					|  |  |         } |  |  |         } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  | @ -483,22 +487,22 @@ class PubMqtt { | 
			
		
	
		
		
			
				
					|  |  |                     continue; // skip to next inverter
 |  |  |                     continue; // skip to next inverter
 | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |                 // inverter status
 |  |  |                 // inverter status
 | 
			
		
	
		
		
			
				
					
					|  |  |                 iv->isProducing(); // recalculate status
 |  |  |                 InverterStatus status = iv->getStatus(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                 if (InverterStatus::OFF < iv->status) |  |  |                 if (InverterStatus::OFF < status) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |                     anyAvail = true; |  |  |                     anyAvail = true; | 
			
		
	
		
		
			
				
					|  |  |                 else // inverter is enabled but not available
 |  |  |                 else // inverter is enabled but not available
 | 
			
		
	
		
		
			
				
					|  |  |                     allAvail = false; |  |  |                     allAvail = false; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |                 if(mLastIvState[id] != iv->status) { |  |  |                 if(mLastIvState[id] != status) { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                     // if status changed from producing to not producing send last data immediately
 |  |  |                     // if status changed from producing to not producing send last data immediately
 | 
			
		
	
		
		
			
				
					|  |  |                     if (InverterStatus::WAS_PRODUCING == mLastIvState[id]) |  |  |                     if (InverterStatus::WAS_PRODUCING == mLastIvState[id]) | 
			
		
	
		
		
			
				
					|  |  |                         sendData(iv, RealTimeRunData_Debug); |  |  |                         sendData(iv, RealTimeRunData_Debug); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |                     mLastIvState[id] = iv->status; |  |  |                     mLastIvState[id] = status; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                     changed = true; |  |  |                     changed = true; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |                     snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/available", iv->config->name); |  |  |                     snprintf(mSubTopic, 32 + MAX_NAME_LENGTH, "%s/available", iv->config->name); | 
			
		
	
		
		
			
				
					
					|  |  |                     snprintf(mVal, 40, "%d", (uint8_t)iv->status); |  |  |                     snprintf(mVal, 40, "%d", (uint8_t)status); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |                     publish(mSubTopic, mVal, true); |  |  |                     publish(mSubTopic, mVal, true); | 
			
		
	
		
		
			
				
					|  |  |                 } |  |  |                 } | 
			
		
	
		
		
			
				
					|  |  |             } |  |  |             } | 
			
		
	
	
		
		
			
				
					|  | 
 |