I have a few of these TP-Link devices, too. I’ve created entities for the values I care about, and exclude the switch entity they’re pulled from. For example, I have a couple of sump pumps and pull out a few attributes from each like this:
- platform: template
sensors:
switch_east_sump_pump_amps:
friendly_name_template: "East Sump Pump Current"
value_template: "{{ state_attr('switch.east_sump_pump', 'current_a') | float}}"
unit_of_measurement: 'A'
switch_east_sump_pump_volts:
friendly_name_template: "East Sump Pump Voltage"
value_template: "{{ state_attr('switch.east_sump_pump', 'voltage') | float}}"
unit_of_measurement: 'V'
switch_east_sump_pump_today_kwh:
friendly_name_template: "East Sump Pump Today's Consumption"
value_template: "{{ state_attr('switch.east_sump_pump', 'today_energy_kwh') | float}}"
unit_of_measurement: 'kWh'
Now I can exclude the switch they’re pulled from:
recorder:
purge_keep_days: 7
commit_interval: 5
exclude:
entities:
- switch.east_sump_pump
I actually exclude some of the templated entities, too, but you get the idea.
I do the same thing with the weather entities and various other sensor entities which tend to generate bloated attribute lists. My exclude list is pretty long. Some folks go the other way and just include the things they know they want recorder to store. For me this was a bit easier and has been very effective, but I could argue for either approach.