#Not sure if this is the right place to

1 messages ยท Page 1 of 1 (latest)

echo basin
#

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 ๐Ÿ˜ฆ

vernal sparrow
#

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

echo basin
#

๐Ÿค” trying this now. Last time I tried this out (months ago) those two were not allowed for SNMP Sensors

vernal sparrow
#

Hmm I just had a look at the docs and they're listed there as options

#

but haven't tried them myself before

echo basin
#

I think this looks right

echo basin
#

hm, still nothing in the energy dashboard

vernal sparrow
#

sensor.dell_server_energy has wrong attributes

#

you still have the customisation probably

echo basin
#

hm, they're commented out. Let me restart again

vernal sparrow
#

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

echo basin
#

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

vernal sparrow
#

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?

vernal sparrow
#

Let's just start over

echo basin
#

lol

vernal sparrow
#

you have an snmp sensor made

echo basin
#

yup

vernal sparrow
#

let's see that from the table

echo basin
#
    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)
vernal sparrow
#

that looks good yaml wise yeah

#

and those attributes show now on the sensor?

echo basin
vernal sparrow
#

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

echo basin
#

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

vernal sparrow
#

forget about the template

#

it's not needed

echo basin
#

kk, so integration should reference the above snmp sensor

vernal sparrow
#

wasn't the only reason you had it in order to pass in the attributes power/measurement?

echo basin
#
    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

vernal sparrow
#

from looking at it you aren't doing any math on the state part

#

you have just added the state/device classes

vernal sparrow
#

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)

echo basin
#

so the template should be

  - sensor:
      - name: "Server Power"
        state: "{{states('sensor.RawDellServerPower')}}"
        unit_of_measurement: W
        device_class: power 
        state_class: measurement```
vernal sparrow
#

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

echo basin
#

ah, I see. It's redundant now

vernal sparrow
#

yeap

echo basin
#

so if everything works right, this can be done with just the SNMP sensor (obviously) and the integration

vernal sparrow
#

correct

#

source sensors with measurement/power used in integration should result in the new sensor created automatically having then attributes energy/total

echo basin
#
    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
vernal sparrow
#

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

echo basin
#

ah, I will try that, I have a lot of old entities hanging around

vernal sparrow
#

this won't delete the entity itself of course. Just its history

echo basin
#

recorder: purge entities?

vernal sparrow
#

Ah yes

echo basin
#

just ran that against the Dell energy sensor ๐Ÿคž

vernal sparrow
#

any change?

echo basin
#

hm, still not showing in the energy dashboard

vernal sparrow
#

are the attributes fixed now at least?

echo basin
#

what should it be?

vernal sparrow
#

energy/total

echo basin
#

hm, nope

vernal sparrow
#

see if you can find this entity ID under STATISTICS tab

echo basin
vernal sparrow
#

hmm so weird

#

make a new integration helper but give it a new unique name instead

echo basin
#

just to clarify, that's the platform: integration part, right?

vernal sparrow
#

yes

#

sorry my bad

#

I keep saying helper because you can also make them in the UI

#

and there they are found under helpers

echo basin
#

oh wow, TIL... lol

#

if I do it that way, would that be the Utility Meter or the Riemann sum?

vernal sparrow
#

riemann sum

echo basin
#

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? ๐Ÿค”

vernal sparrow
#

this seems correct

#

does this one have correct attributes?

echo basin
#

I think this one looks better, except for cost being undefined maybe

vernal sparrow
#

Hmm no these are also wrong

#

do you have these in customization.yaml too?

#

what's also the difference between 1st & 2nd?

echo basin
#

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```
vernal sparrow
#

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

echo basin
#

ah, yea, I did not do a purge for this
is there a global option?

#

wait I don't want to do that lol

vernal sparrow
#

If anything add back customisation in order to make state_class: total

#

for the integration sensor obviously

echo basin
#

I've re-enabled and updated the customization

vernal sparrow
#

did you remove last_reset entirely?

echo basin
#

ah, I forgot that
let me remove and restart

vernal sparrow
#

there is a reload option in YAML tab

#

restarting isn't necessary

echo basin
#

I'm learning a lot today ๐Ÿ˜‚

vernal sparrow
#

you're welcome ๐Ÿ˜‚

echo basin
#

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!

vernal sparrow