I understand this is a can of worms
Over the years of using OH item naming has evolved or rather bastardised… mainly based on what seemed better based on examples code I have seen on OH from (what I deemed) experienced programmers.
One inconsitent example:
["ZevaAmpRemain","400.0"]
["Zeva_CellSetRaw","302,3427,3431,3441,3427"]
["ZevaCellVolt1_Chart_Period","1"]
["ZevaCellVolt2_Chart_Period","1"]
["ZevaChipTemperature","30"]
["ZevaCurrent","0.0"]
["ZevaCurrent_Chart_Period","2"]
["Zeva_CurrentRaw","40,0"]
["ZevaError","0"]
["Zeva_IP_Address","192.168.1.171"]
["ZevaLastReboot","2024-03-15T20:40:30.231862+1000"]
["ZevaLastUpdate","2024-03-18T09:39:22.399389+1000"]
["Zeva_MAC","43:41:4E:42:4D:53"]
["Zeva_Message","Arduino_CAN_BMS|INFO|DHCP OK"]
["Zeva_Name","Arduino_CAN_BMS"]
["ZevaSOC_Chart_Period","2"]
["ZevaStatus","2"]
["Zeva_Status","DHCP OK"]
["Zeva_StatusRaw","30,0,2,4000,547,32"]
["ZevaTemp_Chart_Period","1"]
["ZevaTemperature","32"]
["ZevaTempMax","32.0"]
["ZevaTempMin","29.0"]
["ZevaVolt","54.7"]
["ZevaVoltCellMax1","3.431"]
["ZevaVoltCellMax2","3.431"]
["ZevaVoltCellMin1","3.411"]
["ZevaVoltCellMin2","3.412"]
["ZevaVoltCellSum1","27.379"]
["ZevaVoltCellSum2","27.368"]
["ZevaVolt_Chart_Period","2"]
["ZevaVoltMax","54.7"]
["ZevaVoltMid_Chart_Period","1"]
["ZevaVoltMidDelta","0.011"]
["ZevaVoltMin","52.2"]
I am looking for input on what has proven to some as best approach for item naming. I am looking for a naming convention that is very practical and easy on the eye.
Yes, I can check the Internet, but am after the openHAB context.
E.g.,
- start a group item with ‘g’ → gShed_Windows
- Use of underscores (or other separator) to allow for easy split() → gDinRailRelay_02
- or easy search in the GUI
Is all lowercase and word-separated with _ or -? I use underscores, because the complete word highlights when double-clicking, e.g. when marking for a copy.
Is all CamelCase? If so, is the first char lower or upper case?
What is the preference for naming say lights; or any multiple device (temperature sensor, CO2 sensor, light, etc.?
Light_01 … Light_99 or Light_Bath or Light01_Zone2
For the purpose of rules, the ZoneX should be a group?! And then work with ‘member of’?!
Any other ‘argument’? Ideas?
Any input appreciated.