EEA Automation | Solar Quote Calculator
Pakistan Solar Quote Calculator
Solar Load & Savings Calculator
Estimate the right solar solution for your energy needs with our easy-to-use Solar Calculator. Get an idea of your required solar system size, number of solar panels, inverter capacity, battery backup, and potential monthly savings based on your electricity consumption. Enter your energy usage details and discover the ideal solar system for your home or business.
0 kW Recommended solar system
0 Estimated solar panels
5.0 kWh Battery plan selected
PKR 0 Estimated monthly saving
Customer Solar Requirement Add customer details, appliances and assumptions to generate a professional quote.
Load sample home
Add Appliances
Watts or Amps accepted 220V assumed for amp conversion Essential appliances can be selected for battery backup
Appliance Watts Qty Hours Daily kWh Battery Priority
Clear All
Solar & Battery Assumptions
Battery formula: Required Ah = (Backup kWh × 1000) ÷ Battery Voltage ÷ DoD ÷ Efficiency. Basic hybrid mode keeps a default 5kWh battery because K-Electric / WAPDA remains available as secondary source. 100% mode calculates battery for the complete appliance load.
Recommended System
Recommended Solar System
0.00 kW
Download Quote Print / Save PDF Copy Summary WhatsApp
';
}
function generateQuote(show=true){
const body=quoteHtmlBody();
$('quoteArea').innerHTML=body;
$('quoteArea').classList.add('isc-show');
$('printArea').innerHTML='
'+body.replace(/id="downloadInside"/g,'').replace(/id="printInside"/g,'')+'
';
const di=$('downloadInside'), pi=$('printInside');
if(di) di.onclick=downloadQuote;
if(pi) pi.onclick=printQuote;
if(show) $('quoteArea').scrollIntoView({behavior:'smooth',block:'start'});
}
function downloadQuote(){
generateQuote(false);
const customer=($('customerName').value.trim()||'website-visitor').toLowerCase().replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'') || 'website-visitor';
const fileName='eea-automation-quote-'+customer+'.html';
const html=fullQuoteHtml();
if(downloadUrl) URL.revokeObjectURL(downloadUrl);
const blob=new Blob([html],{type:'text/html;charset=utf-8'});
downloadUrl=URL.createObjectURL(blob);
const a=document.createElement('a');
a.href=downloadUrl; a.download=fileName; a.style.display='none'; document.body.appendChild(a); a.click(); a.remove();
$('manualDownload').href=downloadUrl; $('manualDownload').download=fileName; $('manualBox').classList.add('isc-show');
toast('Quote generated. If download did not start, use the manual download link.');
}
function printQuote(){
generateQuote(false);
toast('Opening print window. Choose Save as PDF to download PDF.');
setTimeout(()=>window.print(),100);
}
async function copySummary(){
const text=summaryText();
try{ await navigator.clipboard.writeText(text); toast('Summary copied'); }
catch(e){ const t=document.createElement('textarea'); t.value=text; document.body.appendChild(t); t.select(); document.execCommand('copy'); t.remove(); toast('Summary copied'); }
}
function loadSample(){
appliances=[
{id:'s1',name:'LED Bulbs',watts:12,qty:8,hours:6,priority:'essential'},
{id:'s2',name:'Ceiling Fans',watts:80,qty:5,hours:10,priority:'essential'},
{id:'s3',name:'Refrigerator',watts:200,qty:1,hours:24,priority:'essential'},
{id:'s4',name:'LED TV',watts:120,qty:1,hours:5,priority:'normal'},
{id:'s5',name:'Wi-Fi Router',watts:15,qty:1,hours:24,priority:'essential'},
{id:'s6',name:'1.5 Ton Inverter AC',watts:1400,qty:1,hours:8,priority:'heavy'},
{id:'s7',name:'Water Pump 1 HP',watts:750,qty:1,hours:1,priority:'heavy'}
];
save(); render(); toast('Sample home loaded');
}
function save(){
const data={appliances}; ['customerName','phone','city','propertyType','phase','roof','bill','unitRate','sunHours','panelWatt','performance','backupMode','basicBatteryKwh','batteryVoltage','dod','efficiency','notes'].forEach(id=>data[id]=$(id).value);
try{ localStorage.setItem('eeaAutomationCalculatorV4', JSON.stringify(data)); }catch(e){}
}
function restore(){
try{ const data=JSON.parse(localStorage.getItem('eeaAutomationCalculatorV4')||'{}'); if(Array.isArray(data.appliances)) appliances=data.appliances; Object.keys(data).forEach(k=>{ if($(k) && k!=='appliances') $(k).value=data[k]; }); }catch(e){}
}
function wire(){
$('addBtn').onclick=addAppliance; $('updateBtn').onclick=updateAppliance; $('cancelBtn').onclick=resetForm; $('clearBtn').onclick=clearAll; $('sampleBtn').onclick=loadSample;
$('downloadBtn').onclick=downloadQuote; $('downloadTop').onclick=downloadQuote; $('printBtn').onclick=printQuote; $('printTop').onclick=printQuote; $('copyBtn').onclick=copySummary;
['customerName','phone','city','propertyType','phase','roof','bill','unitRate','sunHours','panelWatt','performance','backupMode','basicBatteryKwh','batteryVoltage','dod','efficiency','notes'].forEach(id=>$(id).addEventListener('input',()=>{save();renderResults();}));
['propertyType','phase','roof','backupMode','batteryVoltage'].forEach(id=>$(id).addEventListener('change',()=>{save();renderResults();}));
['applianceName','watts','amps','qty','hours'].forEach(id=>$(id).addEventListener('keydown',e=>{ if(e.key==='Enter'){e.preventDefault(); (editId?$('updateBtn'):$('addBtn')).click(); }}));
}
wire(); restore(); render();
})();