Hello
I have a tag I would like to tie an alarm to. However, I want it to alarm out only during the shift hours which are 8PM - 6AM. How would I create a tag to express the tag only during this time?
Thank you
Steve
Hello
I have a tag I would like to tie an alarm to. However, I want it to alarm out only during the shift hours which are 8PM - 6AM. How would I create a tag to express the tag only during this time?
Thank you
Steve
I would make 4 tags.
Have an alarm configured on the Shift Alarm Tag. It's expression should check for Alarm Tag and current time between Shift Start and End Time.
{alarmTag} && dateIsBetween(now(),{shiftStart},{shiftEnd})
How would you update the shift time to today's date automatically? From my limited understanding, the date format requires a specific date to be set.
Ah, yes. I overlooked that. I think you should be able to use an expression function to strip out the hours and minutes for comparison, rather than using the dateIsBetween()
function.
In that case, I would modify the original 4 tags and add one. Shift Start and End become INTs ranging from 0000 -> 2359. Then, add another INT memory tag for the current time with the same range.
alarm
shiftStart_HHMM
shiftEnd_HHMM
now_HHMM
shiftAlarm
now_HHMM
's expression is
( getHour24(now()) *100) + getMinute(now())
shiftAlarm
's expression would be
{alarm}
&&
( {now_HHMM} > {shiftStart_HHMM} ) && ( {now_HHMM} < {shiftEnd_HHMM} )
Use some expression bindings on the container that sets the shift start and end times to combine them for storage in the tags.
**edit: you might have to mess with this expression because I now see that what I have written won't quite work for times that go overnight
You could use scheduled scripts to toggle a boolean tag at the start and end of the shift, and use that tag in the evaluation.
But do you want to suppress the alarm entirely, or only the notification ?