P1 smart meter solar power not to the net
Posted: Saturday 16 March 2019 18:05
I'm install viewtopic.php?f=59&t=22177 great script from McMellow
Does not want to pollute his topic, so i made a new one.
So i have Devices idxprod , thats the kWh what is going to the net.
I want indicate how much goes too the net.
I think i buy a barrel and heatpipes in the future.
And switch 6 solid state relay for heating elements
So i made my first dzVentz script , and i think with a lot off mistakes
-------------------------------------------------------------------------------------------------------------
return {
on = {
timer = {
'between 05:00 and 22:00'
},
devices = {
'idxprod'
},
},
execute = function(domoticz, idxprod)
if tonumber(idxprod) > 500 and Switch1.state == 'Off' then Switch1.switchOn()
elseif tonumber(idxprod) < 500 and Switch1.state == 'On' then Switch1.switchOff()
if tonumber(idxprod) > 1000 and Switch2.state == 'Off' then Switch2.switchOn()
elseif tonumber(idxprod) < 1000 and Switch2.state == 'On' then Switch2.switchOff()
if tonumber(idxprod) > 1500 and Switch3.state == 'Off' then Switch3.switchOn()
elseif tonumber(idxprod) < 1500 and Switch3.state == 'On' then Switch3.switchOff()
if tonumber(idxprod) > 2000 and Switch4.state == 'Off' then Switch4.switchOn()
elseif tonumber(idxprod) < 2000 and Switch4.state == 'On' then Switch4.switchOff()
if tonumber(idxprod) > 2500 and Switch5.state == 'Off' then Switch5.switchOn()
elseif tonumber(idxprod) < 2500 and Switch5.state == 'On' then Switch5.switchOff()
if tonumber(idxprod) > 3000 and Switch6.state == 'Off' then Switch6.switchOn()
elseif tonumber(idxprod) < 3000 and Switch6.state == 'On' then Switch6.switchOff()
end
}
-------------------------------------------------------------------------------------------------------------
Can anyone tune up my scripts ?
You would make me very happy with it
Does not want to pollute his topic, so i made a new one.
So i have Devices idxprod , thats the kWh what is going to the net.
I want indicate how much goes too the net.
I think i buy a barrel and heatpipes in the future.
And switch 6 solid state relay for heating elements
So i made my first dzVentz script , and i think with a lot off mistakes

-------------------------------------------------------------------------------------------------------------
return {
on = {
timer = {
'between 05:00 and 22:00'
},
devices = {
'idxprod'
},
},
execute = function(domoticz, idxprod)
if tonumber(idxprod) > 500 and Switch1.state == 'Off' then Switch1.switchOn()
elseif tonumber(idxprod) < 500 and Switch1.state == 'On' then Switch1.switchOff()
if tonumber(idxprod) > 1000 and Switch2.state == 'Off' then Switch2.switchOn()
elseif tonumber(idxprod) < 1000 and Switch2.state == 'On' then Switch2.switchOff()
if tonumber(idxprod) > 1500 and Switch3.state == 'Off' then Switch3.switchOn()
elseif tonumber(idxprod) < 1500 and Switch3.state == 'On' then Switch3.switchOff()
if tonumber(idxprod) > 2000 and Switch4.state == 'Off' then Switch4.switchOn()
elseif tonumber(idxprod) < 2000 and Switch4.state == 'On' then Switch4.switchOff()
if tonumber(idxprod) > 2500 and Switch5.state == 'Off' then Switch5.switchOn()
elseif tonumber(idxprod) < 2500 and Switch5.state == 'On' then Switch5.switchOff()
if tonumber(idxprod) > 3000 and Switch6.state == 'Off' then Switch6.switchOn()
elseif tonumber(idxprod) < 3000 and Switch6.state == 'On' then Switch6.switchOff()
end
}
-------------------------------------------------------------------------------------------------------------
Can anyone tune up my scripts ?
You would make me very happy with it