Would you care to share the configuration you use to get these?
I‘d love to have them available in HA!
Edit: well, to answer my own question and potentially help others - here’s what i did.
Step 0: Enable SNMP in Omada (Site → Configuration → Settings → SNMP)
Step 1: find out the correct SNMP OIDs
I found them on this site: https://mibs.observium.org/mib/TPLINK-POWER-OVER-ETHERNET-MIB/#tpPoePower
In my case, it was 1.3.6.1.4.1.11863.6.56.1.1.2.1.1.7 i needed to query, use “snmpwalk” or “snmpget” to verify.
Example:
snmpwalk -c <communitystring> -Os -v 2c <IPofYourSwitch> 1.3.6.1.4.1.11863.6.56.1.1.2.1.1.7
That yielded the following result:
enterprises.11863.6.56.1.1.2.1.1.7.1 = INTEGER: 0
enterprises.11863.6.56.1.1.2.1.1.7.2 = INTEGER: 0
enterprises.11863.6.56.1.1.2.1.1.7.3 = INTEGER: 0
enterprises.11863.6.56.1.1.2.1.1.7.4 = INTEGER: 0
enterprises.11863.6.56.1.1.2.1.1.7.5 = INTEGER: 67
enterprises.11863.6.56.1.1.2.1.1.7.6 = INTEGER: 53
enterprises.11863.6.56.1.1.2.1.1.7.7 = INTEGER: 72
enterprises.11863.6.56.1.1.2.1.1.7.8 = INTEGER: 27
The additional digit at the end is the respective switchport - the value you see is in Watts multiplied by 0.1 - so we’ll need to divide by 10.
Step 2: define the sensors in configuration.yaml
Yes, SNMP stuff is considered “legacy” by HA, so we’ll need to dive into configuration.yaml and add them under “sensors:” like this:
sensor:
# Camera
- platform: snmp
host: IPofYourSwitch
community: communitystring
baseoid: 1.3.6.1.4.1.11863.6.56.1.1.2.1.1.7.5
name: "Camera Power"
unit_of_measurement: "W"
device_class: power
value_template: "{{ (value | int / 10) | round(1) }}"
Rinse, repeat for all other switchports you want to add - save configuration.yaml, restart HA
Step 3: Now, we’ve got a Power sensor but to add to the energy dashboard, we’ll need Powercalc from HACS.
Install Powercalc and add a Real power sensor - Powercalc documentation
After that being said and done - add the resulting energy sensor to the energy dashboard config.
Done!