Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add solar PV app for people who divert excess generation #17

Merged
merged 33 commits into from
Sep 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c8c0de0
Add solar PV app for immersion divert users
mattjgalloway Aug 26, 2016
36c6e56
Fix ordering of apps
mattjgalloway Aug 26, 2016
8efe5b7
Fix broken array
mattjgalloway Aug 26, 2016
82618f7
Import % should be based on house use, not total use
mattjgalloway Aug 26, 2016
3afda56
Update colours
mattjgalloway Aug 26, 2016
b0805c6
More colour tweaking
mattjgalloway Aug 26, 2016
fd681d9
Rename from immersion to divert
mattjgalloway Aug 27, 2016
53085ea
Fix up the history bar graph, and show tooltips on hover
mattjgalloway Aug 27, 2016
12b216a
Remove some debug logging
mattjgalloway Aug 27, 2016
fd5f9eb
Make history view a bit simpler
mattjgalloway Aug 27, 2016
730d90f
Tweak tooltip to be smaller, and show the time in the power view
mattjgalloway Aug 27, 2016
df3f8e3
Move house used solar to the bottom of the stack
mattjgalloway Aug 28, 2016
54948f1
Fix labels on the history bar graph page
mattjgalloway Aug 28, 2016
9625502
The bars don't need to be slightly transparent now, and they look bet…
mattjgalloway Aug 28, 2016
7e001b4
Make the tooltip easier to read by being a table
mattjgalloway Aug 28, 2016
9f30146
Fix labels on the history page
mattjgalloway Aug 28, 2016
fda89a5
Powers are in W, not kWh!!
mattjgalloway Aug 28, 2016
568304a
Don't count divert when it's less than 10W, like we do for solar gene…
mattjgalloway Aug 28, 2016
7e46b3c
Change the order of the items underneath the graph to make things eas…
mattjgalloway Aug 28, 2016
44b84ca
Show "-- %" when the values make no sense, when solar generation is zero
mattjgalloway Aug 28, 2016
1749c62
Remove the format so that we get the default
mattjgalloway Aug 28, 2016
5221ac7
Set the first data time for the view
mattjgalloway Aug 29, 2016
71e069a
Add missing divert kwh data to the latest and earliest start time cal…
mattjgalloway Aug 29, 2016
f7412e7
Update readme to add mysolarpvdivert
mattjgalloway Sep 6, 2016
4253ce2
Allow an optional 'wind' and 'wind_kwh' feed and if they're set, use …
mattjgalloway Sep 7, 2016
85a9c0f
Improve documentation
mattjgalloway Sep 7, 2016
751911a
Update the bottom stats area to a new design
mattjgalloway Sep 8, 2016
d54b53e
Make the padding change when resizing to make it look better
mattjgalloway Sep 9, 2016
d07ef51
More layout tweaks when resizing
mattjgalloway Sep 9, 2016
60dec08
Fix %s when generated is 0
mattjgalloway Sep 10, 2016
f8c20cb
Move the %s into the boxes
mattjgalloway Sep 10, 2016
e9858a2
Don't show tooltip on the history view - there's no point
mattjgalloway Sep 10, 2016
dd5fd6c
Switch to under the graph showing house usage, which makes more sense
mattjgalloway Sep 10, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Power + Kwh/D
* **-MySolar**
Solar power generated Vs. consumed

* **MySolar (with divert)**
Solar power generated Vs. consumed, with special handling for excess generation that's been diverted to an immersion/electric car/etc.

* **MyHeatpump**
Heatpump statistics

Expand All @@ -22,4 +25,4 @@ Same as MySolar plus live grid carbon intensity and wind turbine output
cd /var/www/emoncms/Modules
git clone https://github.com/emoncms/app

Check for database updates in Emoncms > Admin
Check for database updates in Emoncms > Admin
3 changes: 2 additions & 1 deletion app_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

array('name' => 'My Electric', 'icon' => '', 'path' => "app$apikey#myelectric", 'session' => 'read', 'order' => 1),
array('name' => 'My Solar', 'icon' => '', 'path' => "app$apikey#mysolarpv", 'session' => 'read', 'order' => 2),
array('name' => 'My Solar&Wind', 'icon' => '','path' => "app$apikey#myenergy", 'session' => 'read', 'order' => 3)
array('name' => 'My Solar&Wind', 'icon' => '','path' => "app$apikey#myenergy", 'session' => 'read', 'order' => 3),
array('name' => 'My Solar (with divert)', 'icon' => '', 'path' => "app$apikey#mysolarpvdivert", 'session' => 'read', 'order' => 4),

)
);
Expand Down
274 changes: 274 additions & 0 deletions mysolarpvdivert/mysolarpvdivert.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
<div class="container">

<div id="mysolarpvdivert-block" style="display:none" class="block">

<div style="height:20px; border-bottom:1px solid #333; padding:8px;">
<div style="float:right;">
<!--<span style="color:#fff; margin-right:10px" >Settings</span>-->
<i class="openconfig icon-wrench icon-white" style="cursor:pointer"></i>
</div>
</div>

<table style="width:100%">
<tr>
<td style="text-align:center; border:0; width:33%">
<div class="electric-title">HOUSE</div>
<div class="power-value" style="color:#82cbfc"><span class="housenow">0</span>W</div>
</td>
<td style="text-align:center; border:0; width:33%">
<div class="electric-title">DIVERT</div>
<div class="power-value" style="color:#fb7b50"><span class="divertnow">0</span>W</div>
</td>
<td style="text-align:center; border:0; width:33%">
<div class="electric-title">TOTAL USE</div>
<div class="power-value" style="color:#0598fa"><span class="usenow">0</span>W</div>
</td>
</tr>
<tr>
<td style="text-align:center; border:0; width:33%">
<div class="electric-title"><span class="balance-label"></span></div>
<div class="power-value"><span class="balance"></span></div>
</td>
<td style="border:0; width:33%">
</td>
<td style="text-align:center; border:0; width:33%">
<div class="electric-title"><span class="generationtitle">SOLAR</span></div>
<div class="power-value" style="color:#dccc1f"><span class="generationnow">0</span>W</div>
</td>
</tr>
</table>

<br>

<div class="visnavblock" style="height:28px; padding-bottom:5px;">
<div class="powergraph-navigation">
<span class="visnav time" time='1'>1h</span>
<span class="visnav time" time='8'>8h</span>
<span class="visnav time" time='24'>D</span>
<span class="vistimeW visnav time" time='168'>W</span>
<span class="vistimeM visnav time" time='720'>M</span>
<span class="vistimeY visnav time" time='8760'>Y</span>
<span id='mysolarpvdivert_zoomin' class='visnav' >+</span>
<span id='mysolarpvdivert_zoomout' class='visnav' >-</span>
<span id='mysolarpvdivert_left' class='visnav' ><</span>
<span id='mysolarpvdivert_right' class='visnav' >></span>
</div>

<div class="bargraph-navigation" style="display:none">
<span class="bargraph-viewall visnav" style="font-size:14px">VIEW ALL</span>
<!--
<span class="bargraph-viewdaily visnav" style="font-size:14px">DAILY</span>
<span class="bargraph-viewmonthly visnav" style="font-size:14px">MONTHLY</span>
<span class="bargraph-viewannually visnav" style="font-size:14px">ANNUALLY</span>
-->
</div>

<span class="visnav viewhistory" style="float:right; font-size:14px">VIEW HISTORY</span>
<span class="visnav balanceline" style="float:right; font-size:14px">SHOW BALANCE</span>
</div>

<div id="mysolarpvdivert_placeholder_bound" style="width:100%; height:500px;">
<div id="mysolarpvdivert_placeholder" style="height:500px"></div>
</div>

<br>

<style type="text/css">
.statstable {
width: 100%;
border-spacing: 10px;
border-collapse: separate;
}

.statsbox {
width: 25%;
text-align: center;
vertical-align: middle;
}

.statsbox-inner-unit {
color: #333;
}

.statsbox-padded {
padding: 10px;
}

.statsbox-inner-arrow {
color: #999;
}

.statsbox-title {
font-weight: bold;
font-size: 20px;
padding-bottom: 15px;
}

.statsbox-value {
font-weight: bold;
font-size: 36px;
}

.statsbox-units {
font-weight: bold;
font-size: 16px;
}

.statsbox-prc {
font-weight: normal;
font-size: 16px;
}

.statsbox-arrow-down {
position: relative;
margin-bottom: 16px;
}

.statsbox-arrow-down:after {
top: 100%;
left: 50%;
border: solid transparent;
content: " ";
width: 0;
height: 0;
position: absolute;
pointer-events: none;
border-top-color: #999;
border-width: 16px;
margin-left: -16px;
}

.statsbox-arrow-right {
position: relative;
margin-right: 16px;
}

.statsbox-arrow-right:after {
left: 100%;
top: 50%;
border: solid transparent;
content: " ";
width: 0;
height: 0;
position: absolute;
pointer-events: none;
border-left-color: #999;
border-width: 16px;
margin-top: -16px;
}
</style>

<table class="statstable">

<tr>
<td class="statsbox" colspan="2">
<div class="statsbox-inner-unit" style="background: #dccc1f">
<div class="statsbox-padded" style="position: relative;">
<div class="statsbox-title"><span class="generationtitle">SOLAR</span></div>
<div><span class="statsbox-value total_generated_kwh">0</span> <span class="statsbox-units">kWh</span></div>
<div style="position: absolute; width: 50%; left: 0%; bottom: 0%">
<span class="statsbox-prc divert_total_generated_prc">0</span>
</div>
<div style="position: absolute; width: 50%; left: 50%; bottom: 0%">
<span class="statsbox-prc house_generated_total_generated_prc">0</span>
</div>
<div style="position: absolute; height: 100%; right: 0%; top: 0%">
<div style="display: table; height: 100%; border-spacing: 0px;">
<div style="display: table-cell; vertical-align: middle;">
<span class="statsbox-prc total_export_prc">0</span>
</div>
</div>
</div>
</div>
</div>
</td>

<td class="statsbox">
<div class="statsbox-inner-arrow">
<div class="statsbox-padded statsbox-arrow-right"><span class="statsbox-value total_export_kwh">0</span> <span class="statsbox-units">kWh</span></div>
</div>
</td>

<td class="statsbox">
<div class="statsbox-padded statsbox-inner-unit" style="background: #d52e2e">
<div class="statsbox-title">GRID</div>
<div><span class="statsbox-value total_grid_balance_kwh">0</span> <span class="statsbox-units">kWh</span></div>
</div>
</td>
</tr>

<tr>
<td class="statsbox">
<div class="statsbox-inner-arrow">
<div class="statsbox-padded statsbox-arrow-down"><span class="statsbox-value total_divert_kwh">0</span> <span class="statsbox-units">kWh</span></div>
</div>
</td>

<td class="statsbox">
<div class="statsbox-inner-arrow">
<div class="statsbox-padded statsbox-arrow-down"><span class="statsbox-value total_house_generated_kwh">0</span> <span class="statsbox-units">kWh</span></div>
</div>
</td>

<td class="statsbox">
</td>

<td class="statsbox">
<div class="statsbox-inner-arrow">
<div class="statsbox-padded statsbox-arrow-down"><span class="statsbox-value total_import_kwh">0</span> <span class="statsbox-units">kWh</span></div>
</div>
</td>
</tr>

<tr>
<td class="statsbox">
<div class="statsbox-padded statsbox-inner-unit" style="background: #fb7b50">
<div class="statsbox-title">DIVERT</div>
<div><span class="statsbox-value total_divert_kwh">0</span> <span class="statsbox-units">kWh</span></div>
</div>
</td>

<td class="statsbox" colspan="3">
<div class="statsbox-inner-unit" style="background: #82cbfc">
<div class="statsbox-padded" style="position: relative;">
<div class="statsbox-title">HOUSE</div>
<div><span class="statsbox-value total_house_kwh">0</span> <span class="statsbox-units">kWh</span></div>
<div style="position: absolute; width: 33.33333%; left: 0%; top: 0%">
<div><span class="statsbox-prc house_generated_house_use_prc">0</span></div>
</div>
<div style="position: absolute; width: 33.33333%; left: 66.66667%; top: 0%">
<div><span class="statsbox-prc total_import_prc">0</span></div>
</div>
</div>
</div>
</td>
</tr>

</table>

</div>


<div id="mysolarpvdivert-setup" style="display:none; padding-top:50px" class="block">

<h2 style="color:#dccc1f">My Solar</h2>

<div class="row">
<div class="span9">
<p class="a2">The My Solar with Divert app can be used to explore onsite solar (and optionally wind) generation, self consumption, export and building consumption. It is designed for users who divert some or all of their excess generated power to something. For example an immersion heater or electric car. It shows all of this both in realtime with a moving power graph view and historically with a daily and monthly bargraph.</p>

<p class="a2"><b>Auto configure:</b> This app can auto-configure connecting to emoncms feeds with the names shown on the right, alternatively feeds can be selected by clicking on the edit button.</p>

<p class="a2"><b>Cumulative kWh</b> feeds can be generated from power feeds with the power_to_kwh input processor.</p>

<!--<p class="a2"><b>Setup guide:</b> See setting up feeds for mysolar</p>-->

<br><br>
<img src="Modules/app/images/mysolar_app.png" style="width:600px" class="img-rounded">
</div>
<div class="span3"><div class="app-config"></div></div>
</div>

</div>

</div>
Loading