Skip to main content

Execute_AddEntityTag

Description

Adds a tag to the specified entity at runtime. The tag can optionally expire based on an ExpireRule specified in S2. If no ExpireRule is specified, it is treated as AfterMinutes.

Note

Supported ExpireRules:

  • AfterMinutes: tag expires after F1 minutes (max 1400 * 7).
  • AfterDaysAt: tag expires at a specific time (F2 in hhmm) after F1 days. If the calculated time has already passed that day, it rolls to the next valid day.
  • DayOfWeekAt: tag expires at a specific weekday (F1: 0=Monday ~ 6=Sunday) and time (F2 in hhmm). If the specified weekday+time has already passed, it rolls to the following week.

Parameters

ParameterDescription
BaseObjectThe entity to which the tag will be added
S1The tag name to add
S2ExpireRule: AfterMinutes, AfterDaysAt, or DayOfWeekAt. Defaults to AfterMinutes if omitted
F1Value determined by ExpireRule (minutes, days, or day-of-week index)
F2Additional value determined by ExpireRule (time in hhmm format)

Examples

DescriptionBaseObjectCommandS1S2F1F2
Add tag 'QWE' and keep it for 60 minutesSelfAddEntityTagQWE60
Add tag 'QWE' expiring at 03:00 after 2 daysSelfAddEntityTagQWEAfterDaysAt20300
Add tag 'QWE' expiring on Friday at 03:00SelfAddEntityTagQWEDayOfWeekAt40300