Script for switching ON/OFF water heaters if there is spare electicity being generated from Solar PV
I am using a HAH with an Envi Current Cost meter and 2 clamps to measure the amount of electricity being generated, and the amount being used. If there is spare capacity I switch on one or two 500W heaters wirelessly using the HAH.
If I switch the kettle on or the dishwasher heater kicks in, the water heaters immediately turn off and will come on again a minute or so after the load has dropped back to a background level.
The system works brilliantly and I anticipate being able to heat most of my hot water over the next 6 months for free!
If anyone is interested in any other details of this system I am more than happy to share,
Wow that lua script is circa Plugboard V1. I'd almost forgotten how that code looks. Are you running a really OLD version of the firmware ?
Your must be on a version < 279 and we are now up to 306.
Check in /etc/build and tell me what you have. Note if you upgrade this script WILL break.
For killer reasons you'd have to decide that yourself - the release notes for each release since your build are in the News and Announcements topic. Way too many changes to list here.
Then again sometimes if it working and it does what you want its better to just leave it alone.
Had a quick look through your script and I'm interested in doing something similar. My problem has always been that I can't figure out how to determine if my system is feeding the grid or drawing from the grid because my CC clamp only shows the total figure but not whether it is feeding or drawing from the grid. Could you explain how your script determines whether power is being used or generated?
I have done a specialist script for Dean which I gather works pretty well but requires additional hardware to detect the state of the power flow. If your script really does the business then it would be simple for people to use without the need for further hardware devices. I'm sure that it could be updated to take account of the latest firmware updates.
works really well, currently my solar pv is running the house and the immersion heater in the hot water tank.
If your house is drawing 3Kw (kettle) and solar generating 1.5Kw are you drawing or feeding 1.5Kw how do you know?
also its the inverter "drawing power" they need a small standby, mine is 36w ac clamp meters cannot tell if power is being fed or drawn (the direction of the power)
the way i tell if i am feeding or drawing of grid is i detect the state of led on meter. By using a cc digital board and an LDR if channel 3=500W then i am feeding grid. if 0 i am drawing.
I may be wrong but it sounds as if James has two clamps connected to a single primary transmitter ( which is capable of having and reporting and summing 3 clamps) ?
In this case the CC head unit simply adds the values for its display
With the current release of Livebox it is possible, when using a CurrentCost 128 or Envi, to have up to 9 'Appliance' channels. Typically these would be IAMs, plug in modules for monitoring subsections of your electricity consumption. However you can assign a spare, non-invasive, primary transmitter or a mini transmitter to these channels as well.
Mini Transmitters here http://www.flickr.com/photos/netcompsys/sets/72157624901424769/
The values from these channels are broadcast as xAPBSC endpoints and are therefore available to plugboard/lua
Maybe this might be a good enough reason to update your Livebox HAH?
In addition the issue of a floating base value for Appliance Channels was raised as issue 24
I also have two clamps attached to my CC meter. The problem is, as Dean says, that the clamp in the "conventional" position i.e. on the tail by the consumer meter only reads the total load; so I can't work out a way of telling if I'm generating 3 Kw and consuming 1.5 Kw or generating 1.5 Kw and consuming 3 Kw because the CC clamp show a load of 1.5 Kw in both cases.
In these circumstances switching on a water heater may just increase the amount of electricity being drawn from the grid and completely negate the idea of using "surplus" electricity.
So what is it that I'm missing from your code that allows you to determine whether the load is an import or an export?
Just to throw in my two 'penneth -
I have an EnviR rigged with
ch1 clamped on the PV array (before it hits the 'fuse box')
ch2 clamped on the mains supply (i.e. the meter reading)
ch3 clamped on the supply to the immersion boiler (nothing else on that line!)
Now - take a look at Pachube ( https://pachube.com/feeds/34982 )
Datastream 2 = PV generation (close to realtime)
Datastream 3 = what the immersion heater gets from my 'Solar Boiler'
Datastream 14 = what the mains (meter) reading looks like AND
Datastream 1 = what the house usage looks like after applying my lua filter applet.....work in progress, but you can see the difference.....so yes..as long as you know whats being generated and whats being 'metered' you can get a pretty good representation of 'House Use'...
Does this help?
PS big thanks to Brett for fixing the bulk posting to Pachube - it works real fine now!!!
Yes I can see what you mean. Feed 14 clearly shows the effect of the solar generation and feed 1 is more like general house use. So do I need 3 clamps instead of the 2 that I already have and I'd obvously be interested to see your "work in progress" to find out what you do with the data.
No, the third clamp is just for me to monitor what I'm able to push into the Immersion Heater....you only need two clamps to work out the House Consumption and the PV generation.....
As I said the lua script is a 'work in progress' because I think every house/clamp/array combination is going to be unique - so I don't think this'll be a generic fix for every situation, but when I tidy up the script I'll let you have a play.... it'll be usefull to see how much variance there actually is !!!
I'm currently tweaking the accumulation figures (Pachube datastreams 12 for the PV and 13 for the boiler) so that I have a daily figure for how many kWh I'm generating and able to use.... it's not as much as I'd hoped as once the boiler comes up to temp, the thermostat kicks in and the PV just pumps watts onto the grid!!!! I'm going to rig up a line to my wired underfloor heating and dump the excess there, temporarily, whilst i look round for a battery/energy storage solutions.
I like the looks of the hydrogen production rigs which are commercially available - but SWMBO won't have explosives in the house....pity.
Drop me an email and I'll package up the scripts and a writeup for you.....
Have a great weekend.....
Here is a modified version of jamesg's script for switching devices in order to use surplus PV generation. As far as I can tell I've just changed the bits that are needed in order to make the script run in the latest version of Plugboard. I don't fully understand the working but as I said the other day it seems to basically do what it is meant to do.
By way of explanation of what I do understand the section in global variables which reads:
is the bit that is configurable. The 3 parameters are: 1st the size of the load to be switched (in watts) 2nd a flag to show on (1) or off (0) and 3rd the rf device on the HAH which is to be switched (in this case rf2 and rf3).
I think that the switching is done sequentially so rf2 will be switched on first if there is enough surplus and rf3 will be switched on second if there is still spare capacity. They will be switched off in reverse order.
The current configuration is for PV output to be monitored by Currentcost ch1 and the grid load to be monitored by Currentcost ch2.
I've not really had very much sunshine in order to do any testing but it does seem to work. Maybe someone in the sunny bit of the country could have a go and comment on how it works.
I still think that there is a possibility that the script could misinterpret the grid reading and draw extra power from the grid when an import is already happening but the circumstances in which this would happen are probably rare. Perhaps jamesg would care to confirm whether or not my understanding of the script is accurate.
I'm planning on installing a similar system to use the excess generated power. How big a water heater is optimum.
I believe there are 2 or 3 products that do this but that they are quite expensive. Anyone tried them?
Also, as my PV system rarely gets to 1.5kW, I think I'd need a smaller heating element. Anyone found 1 1kW one?
BTW. Was just doing the sums around storing all the spare PV power in a battery. That does not have a good payback if batteries last 1-2 years or less. So producing and storing hot water feels like the best choice today.
I don't know exactly what you need but you could try something like this:
There are some on eBay as well see...
wire 2 diodes in parrallel (ensure you have them the same way round)
600j higher voltage option do not use d or a suffix
and put them in series with one of the supply wires that supplies the immersion. JUST ONE.
and they will half the wattage/consumption of immersion.
so if you have a 3Kw immersion brings it down to 1.5Kw
they half wave rectify the supply half of 240=120=half wattge/supply current.