Cisco OID Temperature sensor card

Hello to all,
I am new to HA and trying to learn what I can.
If you can help me with something it would be much appreciated.

I have a Cisco 3750 and I would like to have a graph to show the temperature via SNMP with the OID.

I was able to find the OID after search on the web and the OID tester to be 1.3.6.1.4.1.9.9.13.1.3.1.3.1005

Paessler SNMP Tester - 20.2.4 Computername: MYS Interface: ()
5/2/2022 12:42:50 AM (5 ms) : Device: 192.168.1.123
5/2/2022 12:42:50 AM (9 ms) : SNMP v2c
5/2/2022 12:42:50 AM (12 ms) : Custom OID 1.3.6.1.4.1.9.9.13.1.3.1.3.1005
5/2/2022 12:42:50 AM (20 ms) : SNMP Datatype: ASN_UNSIGNED
5/2/2022 12:42:50 AM (23 ms) : -------
5/2/2022 12:42:50 AM (26 ms) : Value: 37
5/2/2022 12:42:50 AM (29 ms) : Done

The card I am trying to add is:

platform: snmp
name: 'Poseidon Temperature'
host: 192.168.1.123
baseoid: 1.3.6.1.4.1.9.9.13.1.3.1.3.1005
community: 'public'
version: '2c'
unit_of_measurement: '°C'
value_template: "{{ value.split(':')[1].split(' ')[0] }}"

but I am getting No card type found & No card type configured.

Does anyone have any idea?

Thank you!

That’s not a valid card configuration, it’s a sensor.

You should put this in your configuration.yaml:

sensor:
  - platform: snmp
    name: 'Poseidon Temperature'
    host: 192.168.1.123
    baseoid: 1.3.6.1.4.1.9.9.13.1.3.1.3.1005
    community: 'public'
    version: '2c'
    unit_of_measurement: '°C'

Restart Home Assistant afterwards.

That value_template doesn’t look right. I suggest dropping it for now. If the state of the sensor is formatted incorrectly, post it and we can take a look at fixing it.
Open your Home Assistant instance and show your state developer tools.

1 Like

Sir you are awesome! :metal:
Capture

Okay so first we cant put the code directly to the card but on the configuration.yaml and then restart the server.
Second I tried with the sensor.yaml and then do the include sensor.yaml on the configuration but didnt do the restart of the server.

One more question:
Is it possible somehow to generate an history average per week?
I have a powermonitor for example and I have two graphs 5days and 30days, but when I try to do the same with this it doesnt show me the sensor on the list.

Thanks again!

If you mean long-term statistics (statistics graph card), you’ll need to add state_class: measurement to the sensor. Platform snmp does not support this directly, so you’ll need to use customize.yaml:

sensor.poseidon_temperature:
  state_class: measurement
  device_class: temperature

The click “location & customizations” under “YAML configuration reloading” in Sever controls.
It probably won’t be available immediately, you’ll need to wait for an hour or so.

Aha!
So to make sure I understand it correctly.
1- Create the customize.yaml file to the config folder of HA
2- paste the code you send
3- edit the configuration.yaml file and add the code
customize: !include customize.yaml
4- restart again HA server
5- wait 2-3h for it to gather data
6- then go to dashboard and create a new card

type: statistics-graph
entities:
  - sensor.poseidon_temperature
chart_type: line
stat_types:
  - mean
title: Week
days_to_show: 7

correct?

It needs to be under homeassistant like this:

homeassistant:
  customize: !include customize.yaml

Other than that, I think you got it right.

lost you there,
under homeassistant? is this code still in the configuration.yaml?

Yes, it is in configuration.yaml.
But the customize key needs to be under the homeassistant key (mind the indentation).

excellent then!
let me try that.

I assume if I want to have clean code I can place the code of the sensor to the sensor.yaml file and do include in the configuration.yaml file correct?
Does this needs also to be under the umbrella of “homeassistant:”?

Correct.

Nope, sensor is a top-level key.

If you want to know more, I suggest that you read this:

1 Like