#Not sure if this is the right place to
1 messages ยท Page 1 of 1 (latest)
Sensor to gather current wattage:
host: !secret R730XD-IP
version: "3"
username: "prtgV3"
auth_key: !secret R730XD-SNMP-Password
auth_protocol: "hmac-sha"
priv_key: !secret R730XD-SNMP-Password
priv_protocol: "aes-cfb-128"
name: RawDellServerPower
baseoid: 1.3.6.1.4.1.674.10892.5.4.600.30.1.6.1.3
unit_of_measurement: W```
host: !secret R730XD-IP
version: "3"
username: "prtgV3"
auth_key: !secret R730XD-SNMP-Password
auth_protocol: "hmac-sha"
priv_key: !secret R730XD-SNMP-Password
priv_protocol: "aes-cfb-128"
name: RawDellServerPower
baseoid: 1.3.6.1.4.1.674.10892.5.4.600.30.1.6.1.3
unit_of_measurement: W```
source: sensor.server_power
name: "Dell Server Energy"
method: left
unit_prefix: k
unit_time: h
template: # https://www.home-assistant.io/integrations/template/#state-based-template-sensors
- sensor:
- name: "Server Power"
state: "{{states('sensor.RawDellServerPower')}}"
unit_of_measurement: W
device_class: power #Power, watts. Not "Energy" i.e. Wh.
state_class: measurement```
then under customize.yaml
I have ```#sensor.Dell Server EnergyDashboard:
icon: mdi:lightning-bolt
state_class: 'total_increasing'
device_class: energy
last_reset: "1970-01-01T00:00:00+00:00"```
I've waited overnight and I have nothing in my dashboard ๐ฆ
you don't need any customisations
the snmp sensors are power yes but you also don't need to make a template sensor to add device_class: power and state_class: measurement
you can add both of those thigns into the snmp yaml itself
with those there then create a Reimann Sum (platform: integration) of that snmp sensor
and remove the customisation entirely
your goal is to see in dev_tools in the table that the snmp sensor have right attributes first then create the helper
๐ค trying this now. Last time I tried this out (months ago) those two were not allowed for SNMP Sensors
Hmm I just had a look at the docs and they're listed there as options
but haven't tried them myself before
I think this looks right
hm, still nothing in the energy dashboard
sensor.dell_server_energy has wrong attributes
you still have the customisation probably
hm, they're commented out. Let me restart again
that top sensor is the one you had customisation on no?
and that's the one made via integration?
just to get my head around the entites
I'm trying too haha
I probably just have the customize.yaml set up very wrong?
# icon: mdi:lightning-bolt
# state_class: 'total_increasing'
# device_class: energy
# last_reset: "1970-01-01T00:00:00+00:00"```
(still all commented out)
I'm confused on whether the customize should reference an existing sensor, or be it's own new / unique sensor name
I guess it's moot if it's not needed anymore
the other confusion I have is that even if customisation was active I don't see where that first sensor is getting measurement from
the second sensor.rawdellserverpower is the snmp one?
you reference an existing sensor you want to override
Let's just start over
lol
you have an snmp sensor made
yup
let's see that from the table
name: RawDellServerPower
baseoid: 1.3.6.1.4.1.674.10892.5.4.600.30.1.6.1.3
unit_of_measurement: W
device_class: power
state_class: measurement```
(simplified)
right
now use this specific sensor to make a new one via integration
cos the one above I'm seeing has a different one as source
ah, maybe I have this backwards
so you're saying the integration should send to the template?
because currently my template is referencing the integraion
kk, so integration should reference the above snmp sensor
wasn't the only reason you had it in order to pass in the attributes power/measurement?
source: sensor.RawDellServerPower
name: "Dell Server Energy"
method: left
unit_prefix: k
unit_time: h```
so it should be this?
admittedly I had it because the guide I read online included it
but so much has changed with the energy dashboard in such a short amount of time
from looking at it you aren't doing any math on the state part
you have just added the state/device classes
Here's the guide I was copying
https://github.com/genestealer/Home-Assistant-Configuration/blob/master/packages/dell_server/dell_idrac.yaml
in terms of template you just consume the value of the original sensor as is --> states(entity_id)
Yeah I assume perhaps device/state classes weren't available in the past
and he used templates to pass those in
admittedly for simply adding/overriding attributes and not changing anything customization.yaml is exactly what is for
whereas with the templates you end up wtih two times the number of sensors
(also you know this name: RawDellServerPower doesn't have to be stuck to each other right?)
(or on purpose perhaps)
so the template should be
- sensor:
- name: "Server Power"
state: "{{states('sensor.RawDellServerPower')}}"
unit_of_measurement: W
device_class: power
state_class: measurement```
Sure but this template isn't doing anything
{{states('sensor.RawDellServerPower')}} is exactly the state of the sensor
you are just adding the attributes
but these are now directly defined on the snmp sensor
ah, I see. It's redundant now
yeap
so if everything works right, this can be done with just the SNMP sensor (obviously) and the integration
correct
source sensors with measurement/power used in integration should result in the new sensor created automatically having then attributes energy/total
source: sensor.RawDellServerPower
name: "Dell Server Energy"
method: left
unit_prefix: k
unit_time: h```
and now that it's referencing the SNMP sensor, this _should_ be ok lol
in theory yes ๐
it has the exact same name? It could be the old history is conflicting
if that's the case you might also want to use the call service purge.entities to delete that entity's history
this won't delete the entity itself of course. Just its history
recorder: purge entities?
Ah yes
just ran that against the Dell energy sensor ๐ค
any change?
hm, still not showing in the energy dashboard
are the attributes fixed now at least?
what should it be?
energy/total
see if you can find this entity ID under STATISTICS tab
just to clarify, that's the platform: integration part, right?
yes
sorry my bad
I keep saying helper because you can also make them in the UI
and there they are found under helpers
oh wow, TIL... lol
if I do it that way, would that be the Utility Meter or the Riemann sum?
riemann sum
yea, looks like this isn't working for a different device either, that updates more frequently
I see kWh data under the entity, but not in the energy dashboard
so it's mathing right? ๐ค
I think this one looks better, except for cost being undefined maybe
Hmm no these are also wrong
do you have these in customization.yaml too?
what's also the difference between 1st & 2nd?
customize is there, but commented out.
Config is:
- platform: snmp
name: HP_3800_energy
host: !secret 3800
version: "3"
username: "prtgV3"
auth_key: !secret HP-3800-SNMP-Password
auth_protocol: "hmac-sha"
priv_key: !secret HP-3800-SNMP-Password
priv_protocol: "aes-cfb-128"
accept_errors: true
baseoid: 1.3.6.1.4.1.11.2.14.11.5.1.71.1.1.1.3.101001
unit_of_measurement: "W"
device_class: power
state_class: measurement
- platform: integration
name: HP_3800_WH_energy
source: sensor.HP_3800_energy
method: left
unit_prefix: k
unit_time: h```
it seems it's not going away
cos there shouldn't be a last_reset
but more confusing is the fact it's saying measuremt although I remember your customisation was to make it say energy
ah, yea, I did not do a purge for this
is there a global option?
wait I don't want to do that lol
If anything add back customisation in order to make state_class: total
for the integration sensor obviously
I've re-enabled and updated the customization
did you remove last_reset entirely?
ah, I forgot that
let me remove and restart
I'm learning a lot today ๐
you're welcome ๐
holy crap it's working
I forgot I had a customize_glob in my main config
commented that out, kept the customize.yaml commented out and now I'm just using the sensor + helper
Thank you so much!
that would explain everything