Set last tripped/alarm date, or last action date to an item - best practice?

Ha! I just abandoned that naming scheme. I came up with it in the beginning but found myself not using it consistently and finding special cases where it didn’t fit.

But for completeness, my old naming convention was:

// Naming Conventions:
//  - Groups all start with a lowercase g
// 	- Items are all capitalized camel case
//  - Takes the form of X_X_Name
//	- The first letter denotes the Item type:
//		None	Internal utility
//		'N'		Sensor
//		'S'		Switch
//		'T'		Trigger (switch without a state)
//		'W'		Weather
//	- The second letter denotes the object type
//		None	Internal utility
//		'C'		Controller
//		'D'		Door
//		'I'		Input
//		'L'		Light
//		'V'		Value
//		'W'		Window

The fact that I had to document my naming scheme in my Items file in a comment should have been my first clue this approach was untenable.

I’ve since vastly simplified this scheme:

// Naming Convention: Starts with
// - g : Group
// - v : Value/Sensor
// - a : Actuator
// - t : Timer using Expire binding

What is after that initial letter is kind of free form. I usually do camel case first letter capitalized after that for an Item. Associated Items are named with a “_” followed by the what it is.

The one exception I have is Timers that are associated Items do not start with “t” and instead start the same as the “parent” Item and end with “_Timer”.

For an example from my current rewrite of my rules:

Group:Contact:OR(OPEN,CLOSED) gDoorSensors "The doors are [MAP(en.map):%s]"

Group:DateTime:MAX gDoorsLast "The last door event was [%1$tm/%1$td %1$tH:%1$tM]"

Group:Switch:OR(ON, OFF) gDoorsTimers

Switch aGarageOpener1 "Garage Door Opener 1"
  
Contact vGarageOpener1 "Garage Door Opener 1 is [MAP(en.map):%s]"
  (gDoorSensors)
  { mqtt="<[chimera:entry_sensors/main/garage/door1:state:default]" }
  
Switch vGarageOpener1_Timer // Gets set to ON when vGarageOpener1's state changes to OPEN, gets set to OFF (i.e. timer canceled) when vGarageOpener1's state changed to CLOSED, triggers an alerting rule when receives OFF command
  (gDoorsTimers)
  { expire="1h,command=OFF" }
  
DateTime vGarageOpener1_LastUpdate "Garage Door Opener 1 [%1$tm/%1$td %1$tH:%1$tM]"
  (gDoorsLast)

...
Group:Switch:OR(ON,OFF) gPresent

Switch vPresent "Presence [MAP(en.map):%s]" 
  <present>

Switch tPresent { expire="5m,command=OFF" } // when it goes OFF it fires a rule to set vPresent to OFF, gets set to ON when gPresent goes to OFF

I’m not super happy with my treatment of Timers but it is a minor concession to make writing my rules slightly easier. It is a whole lot easier to just append “_Timer” than it is to parse out the name of an Item and replace the first character. But not massively so so I might end up doing that eventually. After I get my system back up and running fully.