<?php 
    #######################################################
	#	CREATED FOR Meteobridge AURORA MKII TEMPLATE 		     
	# 		Humidity
	# 	Release:January 2024	
	# 	       Davis Airlink                    
	#   weather34 	    
	######################################################
include('livedata.php');



//ICON COLOR


if (anyToC($weather["temp_indoor"])<=5 ){$indoorcolor= " hsl(201, 79%, 47%)";}
else if (anyToC($weather["temp_indoor"])<=10 ){$indoorcolor= "hsl(74, 60%, 46%)";}
else if (anyToC($weather["temp_indoor"])<=18){$indoorcolor= "hsl(35, 77%, 58%)";}
else if (anyToC($weather["temp_indoor"])<=20 ){$indoorcolor= "hsl(34, 98%, 49%)";}
else if (anyToC($weather["temp_indoor"])<=27 ){$indoorcolor= "hsl(19, 66%, 55%)";}
else if (anyToC($weather["temp_indoor"])<=35 ){$indoorcolor= "hsl(12, 80%, 52%)";}
else if (anyToC($weather["temp_indoor"])<=50 ){$indoorcolor= "hsl(2, 56%, 55%)";}


//feels color
if (anyToC($weather["temp_indoor_feel"])<=5 ){$feelindoorcolor= " hsl(201, 79%, 47%)";}
else if (anyToC($weather["temp_indoor_feel"])<=10 ){$feelindoorcolor= "hsl(74, 60%, 46%)";}
else if (anyToC($weather["temp_indoor_feel"])<=18){$feelindoorcolor= "hsl(35, 77%, 58%)";}
else if (anyToC($weather["temp_indoor_feel"])<=20 ){$feelindoorcolor= "hsl(34, 98%, 49%)";}
else if (anyToC($weather["temp_indoor_feel"])<=27 ){$feelindoorcolor= "hsl(19, 66%, 55%)";}
else if (anyToC($weather["temp_indoor_feel"])<=35 ){$feelindoorcolor= "hsl(12, 80%, 52%)";}
else if (anyToC($weather["temp_indoor_feel"])<=50 ){$feelindoorcolor= "hsl(2, 56%, 55%)";}





;

//AQ ICON
$indoorenviroicon="
<svg width='40pt' height='40pt' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' fill='none' >
  <path fill-rule='evenodd'  fill='none' stroke='$indoorcolor' d='m8 3.293 6 6V13.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 13.5V9.293l6-6zm5-.793V6l-2-2V2.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5z'/>
  <path fill-rule='evenodd'  fill='#717F8C' d='M7.293 1.5a1 1 0 0 1 1.414 0l6.647 6.646a.5.5 0 0 1-.708.708L8 2.207 1.354 8.854a.5.5 0 1 1-.708-.708L7.293 1.5z'/>
</svg>";
?>



<style>

.hardwareimage{position:relative;display:flex;margin:0 auto;margin-top:-30px;margin-left:120px;opacity:1}
.hardwareimagenano{position:relative;display:flex;margin:0 auto;margin-top:0px;margin-left:155px;opacity:1}
.hardwareimagenano2{position:relative;display:flex;margin:0 auto;margin-top:0px;margin-left:155px;width:65px;opacity:1}
.hardwareimagenano3{position:relative;display:flex;margin:0 auto;margin-top:0px;margin-left:155px;width:65px;opacity:1}
.hardwareimagerpi{position:relative;display:flex;margin:0 auto;margin-top:0px;margin-left:155px;width:75px;opacity:1}
.hardwareimageenvoy{position:relative;display:flex;margin:0 auto;margin-top:0px;margin-left:190px;width:55px;opacity:1}
.ups{position:relative;display:flex;margin:0 auto;margin-top:5px;margin-left:0}
.stationhardware{position:absolute;display:flex;margin-left:127px;margin-top:0px}
.stationhardware2{position:absolute;display:flex;margin-left:145px;margin-top:-30px}

.module {display: grid; 
position: absolute;
font-size:14px;
font-family:verb;
color: var(--body-text-dark);
}

.indoorenvirocaution{position:absolute;
font-size:10px;
font-family:verb;
color: var(--body-text-dark);
display: inline;
margin-left:-110px;
margin-top:-40px;
background:var(--hilomodule);
width: max-content;
max-width:150px; 
padding:4px;
border-radius: 5px;opacity:.8


}


.indoorenvirovalue{
    position: absolute;
    font-size:38px;
    font-family:verb;
    background:var(--hilomodule);
    width:max-content;
    height:max-content;
 margin-left:-100px;
border-radius: 5px;
 margin-top:-80px;
 display: block;
 padding-right:3px;
 padding-left:5px;
 padding-bottom:5px;
 color:var(--body-text-dark);opacity:.8

}


.indoorenvirodescription{
position: absolute;
font-size:10px;
font-family:verb;
background:var(--hilomodule);
width:180px;
margin-left:-110px;
border-radius: 5px;
margin-top:-10px;
display: block;
padding:3px;
color:var(--body-text-dark);opacity:.9

}


.indoorenvirodescription span{
    color:<?php echo $feelindoorcolor;?>;}

.indoorenvirovalue span2{
font-size:10px;
display: block;


}

.indoorenviroicon{position: absolute;
margin-left:-120px;
margin-top:-80px;
opacity:0.4}

.indoorenviroicon2{position: absolute;
margin-left:180px;
margin-top:-0px;
}


.charticonindoor { position: absolute;
font-size:11px;
font-family:verb;
background:none;
width:auto;
margin-left:90px;
border-radius: 5px;
margin-top:20px;
display: block;
padding-right:3px;
color:var(--body-text-dark);
z-index:10;}

.sensorINDcaption2{position: absolute;
 margin-left:-30px;
 margin-top:-92px;
 font-size:9px;
 color:var(--body-text-dark);
 opacity: 1;
 width:max-content;
 font-family:verb;
 position: absolute;
 }


</style>

<div class=module>
<div class=sensorINDcaption2>

<?php //added meteobridge pro option title November 2025
 echo "Hardware Temperature";
    ?>      



</div>
<div class="indoorenvirovalue"><?php 
//forecast indoor temperature
echo " ".mynumberformat($weather["temp_indoor"] ,1)."&deg;";
?>


<span2>
<?php //trend
if($weather["temp_indoor_trend"] >0){echo " Rising ".$risingtabletsmall;}
else if($weather["temp_indoor_trend"]<0){echo "Falling ".$fallingtabletsmall;}
//steady
else echo "Steady ".$steadytabletsmall;?>


</span2>
</div>


<div class=indoorenviroicon>
<?php //added meteobridge pro option icon November 2025


if($mbplatform=='NanoSD' && $model=='Vantage Pro2' ){echo '<img src="images/davis1.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Pro2" title="Vantage Pro2">';}


//Davis vue
else if($mbplatform=='NanoSD' && $model=='Vantage Vue' ){echo '<img src="images/davis2.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Vue" title="Vantage Vue">';}

else if($mbplatform=='Nano' && $model=='Vantage Vue' ){echo '<img src="images/davis2.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Vue" title="Vantage Vue">';}



 else if($mbplatform=='Pro Red' && $model=='Vantage Vue' ){echo '<img src="images/MeteobridgePRO.svg" 
width="80px" class="hardwareimagenano2" alt="Vantage Vue" title="Vantage Vue">';} 

else if($mbplatform=='Pro 2' && $model=='Vantage Vue' ){echo '<img src="images/MeteobridgePRO2.svg" 
width="80px" class="hardwareimagenano2" alt="Vantage Vue" title="Vantage Vue">';}


else if($mbplatform=='Pro Black' && $model=='Vantage Vue' ){echo '<img src="images/MeteobridgePRO2.svg" 
width="80px" class="hardwareimagenano2" alt="Vantage Vue" title="Vantage Vue">';}


else if($mbplatform=='RPI' && $model=='Vantage Vue' ){echo '<img src="images/davis2.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Vue" title="Vantage Vue">';}


else if($mbplatform=='TPlink' && $model=='Vantage Vue' ){echo '<img src="images/davis2.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Vue" title="Vantage Vue">';}



//Davis pro2 & plus

else if($mbplatform=='NanoSD' && $model=='Vantage Pro2 Plus' ){echo '<img src="images/davis1.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Pro2 Plus" title="Vantage Pro2 Plus">';}

else if($mbplatform=='Nano' && $model=='Vantage Pro2 Plus' ){echo '<img src="images/davis1.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Pro2 Plus" title="Vantage Pro2 Plus">';}


else if($mbplatform=='TPlink' && $model=='Vantage Pro2 Plus' ){echo '<img src="images/davis1.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Pro2 Plus" title="Vantage Pro2 Plus">';}

else if($mbplatform=='RPI' && $model=='Vantage Pro2 Plus' ){echo '<img src="images/davis1.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Pro2 Plus" title="Vantage Pro2 Plus">';}


else if($mbplatform=='NanoSD' && $model=='Vantage Pro2' ){echo '<img src="images/davis1.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Pro2 " title="Vantage Pro2">';}

else if($mbplatform=='Nano' && $model=='Vantage Pro2' ){echo '<img src="images/davis1.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Pro2" title="Vantage Pro2">';}

else if($mbplatform=='Pro Red' && $model=='Vantage Pro2' ){echo '<img src="images/davis1.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Pro2" title="Vantage Pro2">';}

else if($mbplatform=='Pro 2' && $model=='Vantage Pro2' ){echo '<img src="images/davis1.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Pro2" title="Vantage Pro2">';}

else if($mbplatform=='Pro Black' && $model=='Vantage Pro2' ){echo '<img src="images/davis1.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Pro2" title="Vantage Pro2">';}


else if($mbplatform=='TPlink' && $model=='Vantage Pro2' ){echo '<img src="images/davis1.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Pro2" title="Vantage Pro2">';}

else if($mbplatform=='RPI' && $model=='Vantage Pro2' ){echo '<img src="images/davis1.png" 
width="80px" class="hardwareimagenano2" alt="Vantage Pro2" title="Vantage Pro2">';}


//envoy x8

else if($mbplatform=='NanoSD' && $model=='Envoy 8X' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2 Plus" title="Vantage Pro2 Plus">';}

else if($mbplatform=='Nano' && $model=='Envoy 8X' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2 Plus" title="Vantage Pro2 Plus">';}


else if($mbplatform=='TPlink' && $model=='Envoy 8X' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2 Plus" title="Vantage Pro2 Plus">';}

else if($mbplatform=='RPI' && $model=='Envoy 8X' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2 Plus" title="Vantage Pro2 Plus">';}


else if($mbplatform=='NanoSD' && $model=='Envoy 8X' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2 " title="Vantage Pro2">';}

else if($mbplatform=='Nano' && $model=='Envoy 8X' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2" title="Vantage Pro2">';}

else if($mbplatform=='Pro Red' && $model=='Envoy 8X' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2" title="Vantage Pro2">';}

else if($mbplatform=='Pro 2' && $model=='Envoy 8X' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2" title="Vantage Pro2">';}

else if($mbplatform=='Pro Black' && $model=='Envoy 8X' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2" title="Vantage Pro2">';}


else if($mbplatform=='TPlink' && $model=='Envoy 8X' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2" title="Vantage Pro2">';}

else if($mbplatform=='RPI' && $model=='Envoy 8X' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2" title="Vantage Pro2">';}


//envoy

else if($mbplatform=='NanoSD' && $model=='Envoy' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2 Plus" title="Vantage Pro2 Plus">';}

else if($mbplatform=='Nano' && $model=='Envoy' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2 Plus" title="Vantage Pro2 Plus">';}


else if($mbplatform=='TPlink' && $model=='Envoy' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2 Plus" title="Vantage Pro2 Plus">';}

else if($mbplatform=='RPI' && $model=='Envoy' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2 Plus" title="Vantage Pro2 Plus">';}


else if($mbplatform=='NanoSD' && $model=='Envoy' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2 " title="Vantage Pro2">';}

else if($mbplatform=='Nano' && $model=='Envoy' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2" title="Vantage Pro2">';}

else if($mbplatform=='Pro Red' && $model=='Envoy' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2" title="Vantage Pro2">';}

else if($mbplatform=='Pro 2' && $model=='Envoy' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2" title="Vantage Pro2">';}

else if($mbplatform=='Pro Black' && $model=='Envoy' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2" title="Vantage Pro2">';}


else if($mbplatform=='TPlink' && $model=='Envoy' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2" title="Vantage Pro2">';}

else if($mbplatform=='RPI' && $model=='Envoy' ){echo '<img src="images/envoy.png" 
width="80px" class="hardwareimageenvoy" alt="Vantage Pro2" title="Vantage Pro2">';}







    ?>      
</div>



<div class="indoorenvirodescription"> 

<?php echo "Console: ";
echo "".$model ." <br>";



echo "Meteobridge: "; 
//humidity

echo $mbplatform ."<br>";



//hardware feels description
if (anytoC($weather["temp_indoor_feel"]) >=50){echo 'Hardware On Fire !! .';}
else if (anytoC($weather["temp_indoor_feel"]) >=40){echo 'Hardware Temperature Hot.';}


else if (anytoC($weather["temp_indoor_feel"]) >=0){echo 'Hardware Temperature OK.';}
?>
</div>

<div class=charticonindoor> 
<a href="weather34-indoor-info-ev.php" data-lity data-chartdata="Chart Data">
<?php echo $weather34chartzoomtabletfull;?></a>
</div></div>