Jump to content

System parameters accessible as variables


larryllix

Recommended Posts

Posted

Time and date variables would simplify repetitive schedule things, almost as well or as an alternative to wildcards.

Many tasks would become much simpler to programme with. e.g. Time accumulation trackers and date scheduled triggers, fan cyclers, etc. without loading the CPU and progarmming space with constant wait or repeat timers.

$sys.year

$sys.month

$sys.date

$sys.day

$sys.hour

$sys.minute

$sys.second

$sys.alive.time (2^31 seconds <= 68 years since last boot)

$sys.DST

$sys.kWh.price

$sys.kW.active.total

$sys.kWh.cumulative (resettable)

Posted

One I can think of quickly...

 

If $sys.month = 12

And $sys.date = 25

Then

Program.ChristmasDay.RunThen

 

..or something like that.. :)

Posted

Regular time based events would stay more accurate than repeat loops

------------------------------

If
   $sys.minute = 0
 OR
   $sys.minute = 30
Then
   set 'chime' on

If
    $sys.month is not $current_month
Then
    $current_month = $sys.month
    $current_month  init to  $current_month
    $YearlyTotal      += $MonthlyTotal
    $MonthlyFanCost = MonthlyTotal
    $MonthlyTotal      = 0
    $MonthlyFanCost *= 32
    $MonthlyFanCost *= $sys.kWh.baseprice
    $MonthlyFanCost  /= 100
     Run Program 'Reset Fan Time Counter'  (If)
     Send Notification  to 'Text Larry' content  'It's a new month! Change the water filter!'

Measuring usage time

-------------------------

If
   control 'Furnace Fan' is switched On
Then 
    $TimeOn = $sys.hour
    $TimeOn *= 60
    $TimeOn += $sys.minute
Else
    $TimeOff = $sys.hour
    $TimeOff *= 60
    $TimeOff += $sys.minute
    $TimeRun = $TimeOff
    $TimeRun -= $TimeOn
     Run Program 'Past Midnight'  (If)
     Wait 15 seconds
    $TimeTotal += $TimeOn

I am not sure what the intent of the Power database information in ISY is

If
       $sys.kW.active.total >= 10000
   AND
       From 9:00 AM
       To     3:00 PM (same day)
Then
    Run Program 'TOU devices cutback' (if)

Logging events

-----------------

If 
    Control 'Doorbell' is switched On
Then
    $LastTime = $sys.month
    $LastTime *= 100
    $LastTime += $sys.date
    $LastTime *= 100
    $LastTime += $sys.hour
    $LastTime *= 100
    $LastTime += $sys.minute
    $LastTime *= 100
    $LastTime += $sys.second

Posted

If
   $sys.alive.time = 15
Then
   Send Notification 'email CAI'  Content   'OK I am initialised  - resend initialisation data'
   Send Notification 'eMail Larry'  Content   'ISY rebooted - possible power failure at home'

 

If
   $sys.alive.time = 300
Then
    Run Program 'GridSwitch sync and close' (if)
    Set 'Utility Room / CoGen' Off
    Send Notification 'eMail Larry'  Content   'House power back on grid - grid stable for 5 minutes'

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...