Here is the .items file that gets created for a Gen 2 dimmer:
Switch Lightwave_BedroomLight_identify “Bedroom Light identify” (GroupGroundSocketsOther)
Switch Lightwave_BedroomLight_reset “Bedroom Light reset” (GroupGroundSocketsOther)
Switch Lightwave_BedroomLight_upgrade “Bedroom Light upgrade” (GroupGroundSocketsOther)
Number Lightwave_BedroomLight_diagnostics "Bedroom Light diagnostics "
String Lightwave_BedroomLight_periodOfBroadcast "Bedroom Light periodOfBroadcast "
Number Lightwave_BedroomLight_rgbColor "Bedroom Light rgbColor "
Switch Lightwave_BedroomLight_switch “Bedroom Light” (GroupGroundSockets)
Dimmer Lightwave_BedroomLight_dimLevel “Bedroom Light dimLevel” (GroupGroundLights)
String Lightwave_BedroomLight_dimSetup "Bedroom Light dimSetup "
Switch Lightwave_BedroomLight_protection “Bedroom Light protection” (GroupGroundSocketsOther)
Number Lightwave_BedroomLight_power “Bedroom Light power [%.1f W] (Read Only)” (GroupGroundSocketsPower)
Number Lightwave_BedroomLight_energy “Bedroom Light energy [%.2f kWh] (Read Only)” (GroupGroundSocketsEnergy)
String Lightwave_BedroomLight_bulbSetup "Bedroom Light bulbSetup "
Number Lightwave_BedroomLight_Power_Cost “Bedroom Light Power Cost [%.3f]” (GroupGroundSocketsPowerCost)
Number Lightwave_BedroomLight_Energy_Cost “Bedroom Light Energy Cost [%.2f]” (GroupGroundSocketsEnergyCost)
Here’s the Structure for the Gen 2 dimmer:
{“deviceId”:“5a6a3fbfc211836b17f98f26-28-3157328472+0”,“name”:“Bedroom Light”,“productCode”:“L21”,“featureSets”:[{“featureSetId”:“5a6a3fbfc211836b17f98f26-5b59e7cd6955591b24a9d698”,“name”:“Bedroom Light”,“features”:[{“featureId”:“5a6a3fbfc211836b17f98f26-88-3157328472+0”,“type”:“identify”,“writable”:true},{“featureId”:“5a6a3fbfc211836b17f98f26-89-3157328472+0”,“type”:“reset”,“writable”:true},{“featureId”:“5a6a3fbfc211836b17f98f26-90-3157328472+0”,“type”:“upgrade”,“writable”:true},{“featureId”:“5a6a3fbfc211836b17f98f26-91-3157328472+0”,“type”:“diagnostics”,“writable”:true},{“featureId”:“5a6a3fbfc211836b17f98f26-92-3157328472+0”,“type”:“periodOfBroadcast”,“writable”:true},
{“featureId”:“5a6a3fbfc211836b17f98f26-93-3157328472+0”,“type”:“rgbColor”,“writable”:true},{“featureId”:“5a6a3fbfc211836b17f98f26-94-3157328472+0”,“type”:“switch”,“writable”:true},{“featureId”:“5a6a3fbfc211836b17f98f26-95-3157328472+0”,“type”:“dimLevel”,“writable”:true},{“featureId”:“5a6a3fbfc211836b17f98f26-96-3157328472+0”,“type”:“dimSetup”,“writable”:true},{“featureId”:“5a6a3fbfc211836b17f98f26-97-3157328472+0”,“type”:“protection”,“writable”:true},{“featureId”:“5a6a3fbfc211836b17f98f26-98-3157328472+0”,“type”:“power”,“writable”:false},{“featureId”:“5a6a3fbfc211836b17f98f26-99-3157328472+0”,“type”:“energy”,“writable”:false},{“featureId”:“5a6a3fbfc211836b17f98f26-121-3157328472+0”,“type”:“bulbSetup”,“writable”:true}]}],“product”:“L21”,“device”:“dimmer”,“desc”:“Smart Dimmer”,“type”:“lwrfTwoWay_v2”,“cat”:“Lighting”,“gen”:2},
Here’s the .items for a Gen 1 Plug-In Socket Switch:
Switch Lightwave_LavaLamp_switch “Lava Lamp” (GroupGroundSockets)
Switch Lightwave_LavaLamp_protection “Lava Lamp protection” (GroupGroundSocketsOther)
Number Lightwave_LavaLamp_Power_Cost “Lava Lamp Power Cost [%.3f]” (GroupGroundSocketsPowerCost)
Number Lightwave_LavaLamp_Energy_Cost “Lava Lamp Energy Cost [%.2f]” (GroupGroundSocketsEnergyCost)
And here’s the Structure for it:
{“deviceId”:“5a6a3fbfc211836b17f98f26-14-3157328472+0”,“name”:“Out3”,“productCode”:“LW320”,“featureSets”:[{“featureSetId”:“5a6a3fbfc211836b17f98f26-5a8c99a8b6fce426e56237b9”,“name”:“Lava Lamp”,“features”:[{“featureId”:“5a6a3fbfc211836b17f98f26-46-3157328472+0”,“type”:“switch”,“writable”:true},{“featureId”:“5a6a3fbfc211836b17f98f26-47-3157328472+0”,“type”:“protection”,“writable”:true}]}],“product”:“LW320”,“device”:“socket”,“desc”:“Plug-In Socket”,“type”:“lwrfOneWay_v1”,“cat”:“Power”,“gen”:1},
From the Structure you can get the LWRF Product Code, the device type, the category (power or lighting) and the Gen 1 or 2 simply by pulling the right fields out of the JSON. You can do that with JSONPATH as you’re already doing, or with a regular expression. I’ve messed with both approaches and have some examples if you need.
I didn’t bother with the Gen 2 sockets as you’ve got those, but I can if you ask.
I’ve got both types of Gen 1 plug-in socket and they both look exactly the same in the structure and items file. Also I have a Gen 1 three-way relay but that shows up in the structure as three Gen1 plug-in sockets because that’s basically what the innards are. So the structure and items for that also read exactly as for the Lava Lamp (yes, I’m sad, I do have a lava lamp and I quite like it).