This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Dynamically change the Scheduled program time parameters from visualization
#21
In the end, I want to charge my home battery at time x and decharge my home battery at time y. And, I want to be able to change x en y easily using the visualization, so that my husband (who knows nothing from the LM) can change the hours. Because the use of the battery depends on the seasons, sun, energy consumption,... Also the amount that the battery had to charge, is a variable. The purpose is to load the battery during night and to use the stored power during day, when the electricity is more expensive.

I already know to manipulate the battery and I already have a script that starts loading the battery at 10 o'clock and start recharging it at 6 o'clock in the morning. Now, I'm trying to write a script to change the 10 o'clock and the 6 o'clock. But, during programming and to make the problem a bit easier, I've made a group adress which changes from 0 to 1, at 10 0'clock and changes from 1 to 0 at 6 o'clock. This is just a setup to test my script I'm trying to write. I've divided the big problem in a lot of little steps.
Reply
#22
(29.02.2024, 20:39)Amelie Wrote: In the end, I want to charge my home battery at time x and decharge my home battery at time y. And, I want to be able to change x en y easily using the visualization, so that my husband (who knows nothing from the LM) can change the hours. Because the use of the battery depends on the seasons, sun, energy consumption,... Also the amount that the battery had to charge, is a variable. The purpose is to load the battery during night and to use the stored power during day, when the electricity is more expensive.

I already know to manipulate the battery and I already have a script that starts loading the battery at 10 o'clock and start recharging it at 6 o'clock in the morning. Now, I'm trying to write a script to change the 10 o'clock and the 6 o'clock. But, during programming and to make the problem a bit easier, I've made a group adress which changes from 0 to 1, at 10 0'clock and changes from 1 to 0 at 6 o'clock. This is just a setup to test my script I'm trying to write. I've divided the big problem in a lot of little steps.

Hi!

If you want change charging and discharging times manually I would create resident script and use some virtual group addresses.
Example:
Code:
--RESIDENT SCRIPT WITH SLEEP INTERVAL 1 SECOND
time_and_date_now = os.date('*t')

start_charging_hour = grp.getvalue('')    
end_charging_hour = grp.getvalue('')
start_discharging_hour = grp.getvalue('')
end_discharging_hour = grp.getvalue('')


if time_and_date_now.hour == start_charging_hour and time_and_date_now.sec == 0  then
  --CHARGE COMMAND TO BATTERY/INVERTER
elseif time_and_date_now.hour == end_charging_hour and time_and_date_now.sec == 0 then
  --CHARGING STOP COMMAND TO BATTERY/INVERTER
elseif time_and_date_now.hour == start_discharging_hour and time_and_date_now.sec == 0 then
  --DISCHARGE COMMAND TO BATTERY/INVERTER
elseif time_and_date_now.hour == end_discharging_hour and time_and_date_now.sec == 0 then
  --DISCHARGE STOP COMMAND TO BATTERY/INVERTER
end

I don't know what is your bigger plan and your specific needs...

I have made automatic charging and discharging system to my clients what does charging and discharging automatically (plus it's possible to discharge on max power back to grid when electricity price is high - this is mostly used in summer). 

Everything runs via resident script and using scheduled script only to request electricity price.
Maybe here is some inspiration for future scripting...

Blue - El. price
Yellow - Sun angle

Green - Buying from grid
Red - Selling full power to grid (not used right now)
Dotted line - Cloud index
Brown - Battery percentage

Attached Files Thumbnail(s)
   
Reply
#23
For simple timed on-off control you can use a scheduler. No scripts are needed.
Reply


Forum Jump: