Energy flow custom template widget

Hi, here is my updated entrance panel. I upgraded from 7" SIBO to the new 10" SIBO. With 3d printed adapter I reused 7" mounting for flush design. The new is an energy flow widget that shows relations for Grid , Solar, Battery, and I made also a custom template for 3 knob based gauges with some added info (A switch for a electric heater for the Domestic Hot Water , Battery stats and i3 charging state)

The code is very messy with some hand optimized single pixel margins here and there for a perfect fit on this 1280x800 screen. If anyone has to reuse it will need some work for setting it up for your target device. I do not have time to make it universal and I guess it would take ages, but still maybe someone will have a use of it.

<link rel="stylesheet" type="text/css" href="http://172.16.10.4:8080/static/css/myslider.css" />
<div style="background: rgba(0,0,0,0.5);
        margin-top: 0px;
        margin-left: 0px;
        border-radius: 10px;
        border: 1px;
        border-style: solid;
        border-color: rgb(100,100,100) ;
        width:494px; height: 472px;
        ">
	<div class="row" style="margin-top: -10px; margin-left:-2px; margin-right: -2px">
<div class="col-xs-5" style="text-align: left; border:0px; border-style: solid; border-color: rgb(100,100,100) ;" >
  
  <br>
    <span  style="font-size: 2.8em" >
   <img src="assets/icons/smarthome-set/plug.svg" style="width: 40px;  filter: invert(.7); margin-top: -10px;  "></img>
    {{'%.0f' | sprintf: itemValue('B_Power_AC_Load')}}</span>
    <span  style="font-size: 1.8em" >W</span>
  </br>
  
  </div>

  <div class="col-xs-2" style="text-align: center; border:0px; border-style: solid; border-color: rgb(100,100,100) ;" >    
   
    
</div>    
			<div class="col-xs-5" style="text-align: right; border:0px; border-style: solid; border-color: rgb(100,100,100) ;" >
    <br><span  style="font-size: 2.8em" >
      <img src="assets/icons/smarthome-set/sun.svg" style="width: 40px;  filter: invert(.7); margin-top: -5px; "></img>
      {{'%.0f ' | sprintf: itemValue('B_Power_PV_Sum')}}</span><span  style="font-size: 1.8em; margin-left: -6px" >W</span></br>
   R: {{'%.0f W' | sprintf: itemValue('B_Power_PV_String2')}} G: {{'%.0f W' | sprintf: itemValue('B_Power_PV_String1')}}
    <br>{{'%.2f kWh' | sprintf: itemValue('B_Power_energy_today_float')}}</br>
  </div>
  
  
  
  </div>
  
	<div class="row" style="
  				  font-size: 8.5em;
  				  font-family: Roboto, Helvetica, sans-serif;
              text-align: center;
              border: 0px;      
  				  border-style: solid;
              border-color: green;            
  				  margin-bottom: -10px;
              margin-left: 0px;
              margin-right: 0px         
                    ">
<div ng-if="itemValue('Power_source')=='Grid'">
  <span style="color: red">{{'%.0f ' | sprintf: itemValue('B_Power_Netto')}}</span><span style="color: red; font-size: 0.6em;">W</span>
</div>    
<div ng-if="itemValue('Power_source')=='Battery'">
  <span style="color: #00FF00">{{'%.0f ' | sprintf: itemValue('B_Power_Netto')}}</span>
  <span style="color: #00FF00; font-size: 0.6em;">W</span>
</div>
<div ng-if="itemValue('Power_source')=='Battery+Solar'">
  <span style="color: #00FF00">{{'%.0f ' | sprintf: itemValue('B_Power_Netto')}}</span>
  <span style="color: #00FF00; font-size: 0.6em;">W</span>
</div>
<div ng-if="itemValue('Power_source')=='Solar!'">
  <span style="color: #00FF00">+{{'%.0f ' | sprintf: itemValue('B_Power_Netto')}}</span>
  <span style="color: #00FF00; font-size: 0.6em; margin-left: -24px">W</span>
</div>    
<div ng-if="itemValue('Power_source')=='Grid+Solar'">
  <span style="color: orange">{{'%.0f ' | sprintf: itemValue('B_Power_Netto')}}</span>
  <span style="color: orange; font-size: 0.6em;">W</span>
</div>   

  </div>
  	<div class="row"  style="text-align: center;">  
<div ng-if="itemValue('Power_source')=='Grid'">
  <span style="color: red; font-size: 80px">Power Grid</span>
</div>
<div ng-if="itemValue('Power_source')=='Battery'">
  <span style="color: #00FF00; font-size: 80px">Battery</span>
</div>
<div ng-if="itemValue('Power_source')=='Battery+Solar'">
  <span style="color: #00FF00; font-size: 80px">Battery+Solar</span>
</div>
<div ng-if="itemValue('Power_source')=='Grid+Solar'">
  <span style="color: orange; font-size: 80px">Grid+Solar</span>
</div>
<div ng-if="itemValue('Power_source')=='Solar!'">
  <span style="color: #00FF00; font-size: 80px">Solar!</span>
</div>
   
 
	  </div>
  <div class="row" style="margin-top: -10px; margin-left:-2px; margin-right: -2px">
   <div class="col-xs-5" style="text-align: left; border:0px; border-style: solid; border-color: rgb(100,100,100) ;" >    
   	<br>
 <img src="http://172.16.10.4:8080/static/power_grid2.svg" style="width: 40px; height: 40px; filter: invert(.7); margin-top: -20px;  "></img>
 <span  style="font-size: 2.8em" >0</span><span  style="font-size: 1.8em" >W</span>
 </br>
 <span  style="margin-left: 4px" >{{'%.0f V' | sprintf: itemValue('B_Power_Grid_P1_Voltage_raw')/10  }}</span>

</div>
   <div class="col-xs-2" style="text-align: center; border:0px; border-style: solid; border-color: rgb(100,100,100) ;" >    
</div>
   <div class="col-xs-5" style="text-align: right; border:0px; border-style: solid; border-color: rgb(100,100,100) ;" >    
<span style="font-size: 1em">
  <div ng-init='SELFC={"name": "SELFC",
            "sizeX": 3,
            "sizeY": 3,
            "item": "Bmw_chargingLevelHv",
            "type": "knob",
            "row": 0,
            "col": 10,
            "floor": 0,
            "ceil": 100,
            "step": 1,
            "unit": "%",
            "startAngle": -130,
            "endAngle": 130,
            "readOnly": true,
            "subTextEnabled": False,
            "scaleEnabled": false,
            "scaleType": "lines",
            "skinType": "tron",
            "trackColor": "#333333",
            "skinWidth": null,
          	"trackWidth": 14,
            "barWidth": 14,
          	"barCap": 4,
          	"trackCap":4,
            "skinSpaceWidth": null,
            "rangesEnabled": true,
            "rangesTextColorMatching": true,
            "ranges": [
                
                {
                    "min": 0,
                    "max": 40,
                    "barColor": "#FFFFFF",
                    
                },
                {
                    "min": 40,
                    "max": 100,
                    "barColor": "#FFFFFF",
                    
                }
            ],
            
        }'>
   <div style="width:100px; height:80px; margin-left:94px">
  <div>
     <div><widget-knob ng-model="SELFC" /></div>
  </div>
  </div>
</div>
Self Today
 </span>
</div>
  </div>
  
  
  
</div>
5 Likes

Hello @xsherlock,

That looks really very good. Your code helped me to create a widget with a knob. Special thanks!

Would you also make the code of your other widgets (three knobs bottom right, pool and trash) public?

How did you manage to change the roof line of Habpanel?

Many thanks for your help

The top line is accually a separate custom template widget. I use experimental feature of habpanel dividing the screen into 60 parts not 12 to make it slimmer.
Pool widget is already on that forum.

and the 3 knobs i attach here:
A domestic hot water gauge is having small swith for manual heater that using the same base css definition of the switch.

<link rel="stylesheet" type="text/css" href="http://172.16.10.4:8080/static/css/myslider.css" />
<div style="background: rgba(0,0,0,0.5);
            margin-top: 0px;
            margin-left: 0px;
            border-radius: 10px;
            border: 1px;
            border-style: solid;
            border-color: rgb(100,100,100) ;
            width:744px; height: 214px;
            ">



<div class="row" style="margin-top: -4px; margin-left:-8px; margin-right: 0px">
 <div class="col-xs-4" style="text-align: left;  margin-right: -8px ;border:0px; border-style: solid; border-color: rgb(100,100,100) ;" >
 <div ng-init='DHW={"name": "DHW",
                "sizeX": 3,
                "sizeY": 3,
                "item": "B_Temperature_wmY",
                "type": "knob",
                "row": 0,
                "col": 10,
                "floor": 25,
                "ceil": 60,
                "step": 1,
                "unit": "°C",
                "startAngle": -130,
                "endAngle": 130,
                "readOnly": true,
                "subTextEnabled": true,
                "scaleEnabled": false,
                "scaleType": "lines",
                "skinType": "tron",
                "trackColor": "#333333",
                "skinWidth": null,
              	"trackWidth": 40,
                "barWidth": 40,
              	"barCap": 20,
              	"trackCap": 20,
                "skinSpaceWidth": null,
                "rangesEnabled": true,
                "rangesTextColorMatching": true,
                "ranges": [
                    {
                        "min": 35,
                        "max": 39,
                        "barColor": "#FF9900",
                        
                    },
                    {
                        "min": 0,
                        "max": 35,
                        "barColor": "#FF0000",
                        
                    },
                    {
                        "min": 40,
                        "max": 60,
                        "barColor": "#33CC33",
                        
                    }
                ],
                
            }'>
   <div style="width:244px">
      <div>
         <div><widget-knob ng-model="DHW" /></div>
      </div>
  </div>
</div>
  </div>
  <div class="col-xs-4" style="text-align: left ;margin-right: -8px ; border:0px; border-style: solid; border-color: rgb(100,100,100) ;" >
 <div ng-init='HSOC={"name": "House SOC",
                "sizeX": 3,
                "sizeY": 3,
                "item": "B_Power_Battery_SOC",
                "type": "knob",
                "row": 0,
                "col": 10,
                "floor": 0,
                "ceil": 100,
                "step": 1,
                "unit": "%",
                "startAngle": -130,
                "endAngle": 130,
                "readOnly": true,
                "subTextEnabled": true,
                "scaleEnabled": false,
                "scaleType": "lines",
                "skinType": "tron",
                "skinWidth": null,
              	"trackWidth": 40,
               "trackColor": "#333333",
                "barWidth": 40,
              	"barCap": 20,
              	"trackCap": 20,
                "skinSpaceWidth": null,
                "rangesEnabled": true,
                "rangesTextColorMatching": true,
                "ranges": [
                    {
                        "min": 21,
                        "max": 50,
                        "barColor": "#FF9900",
                        
                    },
                    {
                        "min": 0,
                        "max": 20,
                        "barColor": "#FF0000",
                        
                    },
                    {
                        "min": 50,
                        "max": 100,
                        "barColor": "#33CC33",
                        
                    }
                ],
                
            }'>
   <div style="width:244px">
      <div>
         <div><widget-knob ng-model="HSOC" /></div>     
      </div>
  </div>
</div>
  
  </div>
  <div class="col-xs-4" style="text-align: left; border:0px; border-style: solid; border-color: rgb(100,100,100) ;" >
  <div ng-init='BSOC={"name": "BMW SOC",
                "sizeX": 3,
                "sizeY": 3,
                "item": "Bmw_chargingLevelHv",
                "type": "knob",
                "row": 0,
                "col": 10,
                "floor": 0,
                "ceil": 100,
                "step": 1,
                "unit": "%",
                "startAngle": -130,
                "endAngle": 130,
                "readOnly": true,
                "subTextEnabled": true,
                "scaleEnabled": false,
                "scaleType": "lines",
                "skinType": "tron",
                "skinWidth": null,
              	"trackWidth": 40,
                "trackColor": "#333333",
                "barWidth": 40,
              	"barCap": 20,
              	"trackCap": 20,
                "skinSpaceWidth": null,
                "rangesEnabled": true,
                "rangesTextColorMatching": true,
                "ranges": [
                    {
                        "min": 20,
                        "max": 50,
                        "barColor": "#FF9900",
                        
                    },
                    {
                        "min": 0,
                        "max": 19,
                        "barColor": "#FF0000",
                        
                    },
                    {
                        "min": 50,
                        "max": 100,
                        "barColor": "#33CC33",
                        
                    }
                ],
                
            }'>
   <div style="width:244px">
      <div>
         <div><widget-knob ng-model="BSOC" /></div>
      </div>
  </div>
  </div>
</div>
  </div>
<div class="row" style="margin-top: -80px; margin-left:8px; margin-right: 8px; border:0px; border-style: solid; border-color: rgb(0,100,100) ;">
 <div class="col-xs-4" style="margin-top: -80px; text-align: center; border:0px; border-style: solid; border-color: rgb(100,100,100) ;" >
    <label class="myswitch">
     <input type="checkbox" ng-checked="(itemValue('boiler_outb6_heater_top')=='ON')" ng-click="sendCmd('boiler_outb6_heater_top', (itemValue('boiler_outb6_heater_top')=='OFF') ? 'ON':'OFF')">  
     <div class="myslider round"></div>
  	</label>
  
  </div>
 <div class="col-xs-4" style="margin-top: -72px;margin-left: 242px; text-align: center; border:0px; border-style: solid; border-color: rgb(100,100,100) ;" >
 {{'%.1f A' | sprintf: itemValue('B_Power_Battery_Current_Sum')}}
    {{'%.1f V' | sprintf: itemValue('B_Power_Battery_Voltage_fixed')}}
  </div>
  <div class="col-xs-4" style="margin-top: -72px;margin-left: 483px; text-align: center; border:0px; border-style: solid; border-color: rgb(100,100,100) ;" >
 {{'%s' | sprintf: itemValue('Bmw_chargingSystemStatus')}}
  </div>
  </div>

Thank you!

How did you create the ‘trash info’?

It is just a series of png’s served from the server on appropriate days.
If you look into my posts I discussed it already here :

Hi. Even it is some time ago, I would like to create something similar. I like your widget. Could you share some more data like the images, (rules, itmes etc…)

Thanks in advance