Hi guys i’m getting the fellow errors but for the life of me cant fix ti. i coppied it from Github repos. the main issues are happening from Server1_CPU1_Temperature
Error:
Invalid config for [sensor.template]: expected dictionary for dictionary value @ data[‘sensors’]. Got None
extra keys not allowed @ data[‘Server1_CPU1_Temperature’]. Got OrderedDict([(‘state’, “{{states(‘sensor.SRV1CPU1Temp’)}}”), (‘unit_of_measurement’, ‘°C’), (‘device_class’, ‘temperature’), (‘state_class’, ‘measurement’)])
extra keys not allowed @ data[‘Server1_CPU2_Temperature’]. Got OrderedDict([(‘state’, “{{states(‘sensor.SRV1CPU2Temp’)}}”), (‘unit_of_measurement’, ‘°C’), (‘device_class’, ‘temperature’), (‘state_class’, ‘measurement’)])
extra keys not allowed @ data[‘Server1_Fan_Speed_Avg’]. Got OrderedDict([(‘state’, “{{ (( states(‘sensor.SRV1Fan1Speed’) | float +\n states(‘sensor.SRV1Fan2Speed’) | float) / 2) | round(0) }}\n”), (‘unit_of_measurement’, ‘RPM’), (‘icon’, ‘mdi:fan’)])
extra keys not allowed @ data[‘Server1_Inlet_Temperature’]. Got OrderedDict([(‘state’, “{{states(‘sensor.SRV1IntakeTemp’)}}”), (‘unit_of_measurement’, ‘°C’), (‘device_class’, ‘temperature’), (‘state_class’, ‘measurement’)])
extra keys not allowed @ data[‘Server1_Power’]. Got OrderedDict([(‘state’, “{{states(‘sensor.SRV1Power’)}}”), (‘unit_of_measurement’, ‘W’), (‘device_class’, ‘power’), (‘state_class’, ‘measurement’)])
extra keys not allowed @ data[‘Server2_CPU1_Temperature’]. Got OrderedDict([(‘state’, “{{states(‘sensor.SRV2CPU1Temp’)}}”), (‘unit_of_measurement’, ‘°C’), (‘device_class’, ‘temperature’), (‘state_class’, ‘measurement’)])
extra keys not allowed @ data[‘Server2_Fan_Speed_Avg’]. Got OrderedDict([(‘state’, “{{ (( states(‘sensor.SRV2Fan1Speed’) | float / 1) | round(0) }}\n”), (‘unit_of_measurement’, ‘RPM’), (‘icon’, ‘mdi:fan’)])
extra keys not allowed @ data[‘Server2_Inlet_Temperature’]. Got OrderedDict([(‘state’, “{{states(‘sensor.SRV2IntakeTemp’)}}”), (‘unit_of_measurement’, ‘°C’), (‘device_class’, ‘temperature’), (‘state_class’, ‘measurement’)])
extra keys not allowed @ data[‘Server2_Power’]. Got OrderedDict([(‘state’, “{{states(‘sensor.SRV2Power’)}}”), (‘unit_of_measurement’, ‘W’), (‘device_class’, ‘power’), (‘state_class’, ‘measurement’)]). (See ?, line ?).
My code:
#- platform: template
# sensors:
# last_alexa:
# value_template: >
# {{ states.media_player | selectattr('attributes.last_called','eq',true) | map(attribute='entity_id') | first }}
#Server1 IPMI Sensors
- platform: mqtt
name: "SRV1CPU1Temp"
state_topic: "homeassistant/sensor/srv1/cpu2"
unit_of_measurement: '°C'
value_template: "{{((value | float) / 10) | float}}"
- platform: mqtt
name: "SRV1CPU2Temp"
state_topic: "homeassistant/sensor/srv1/cpu2"
unit_of_measurement: '°C'
value_template: "{{((value | float) / 10) | float}}"
- platform: mqtt
name: "SRV1CPUUsage"
state_topic: "homeassistant/sensor/srv1/cpuuse"
unit_of_measurement: '%'
- platform: mqtt
name: "SRV1Intak Temp"
state_topic: "homeassistant/sensor/srv1/intemp"
unit_of_measurement: '°C'
value_template: "{{((value | float) / 10) | float}}"
- platform: mqtt
name: "SRV1Fan1Speed"
state_topic: "homeassistant/sensor/srv1/fan1"
value_template: '{{ value | multiply(0.001) | round(1) }}'
unit_of_measurement: 'kRPM'
- platform: mqtt
name: "SRV1Fan2Speed"
state_topic: "homeassistant/sensor/srv1/fan2"
value_template: '{{ value | multiply(0.001) | round(1) }}'
unit_of_measurement: 'kRPM'
- platform: mqtt
name: "SRV1Power"
state_topic: "homeassistant/sensor/srv1/power"
unit_of_measurement: 'W'
#Server1 IPMI Sensors
- platform: mqtt
name: "SRV2CPU1Temp"
state_topic: "homeassistant/sensor/srv2/cpu2"
unit_of_measurement: '°C'
value_template: "{{((value | float) / 10) | float}}"
- platform: mqtt
name: "SRV2IntakeTemp"
state_topic: "homeassistant/sensor/srv2/intemp"
unit_of_measurement: '°C'
value_template: "{{((value | float) / 10) | float}}"
- platform: mqtt
name: "SRV2Fan1Speed"
state_topic: "homeassistant/sensor/srv2/fan1"
value_template: '{{ value | multiply(0.001) | round(1) }}'
unit_of_measurement: 'kRPM'
- platform: mqtt
name: "SRV2Power"
state_topic: "homeassistant/sensor/srv2/power"
unit_of_measurement: 'W'
- platform: integration
source: sensor.server1_power
name: "Dell1 Server Energy"
unit_prefix: k
unit_time: h
round: 2
- platform: integration
source: sensor.server2_power
name: "Dell2 Server Energy"
unit_prefix: k
unit_time: h
round: 2
- platform: template
sensors:
Server1_Power:
state: "{{states('sensor.SRV1Power')}}"
unit_of_measurement: W
device_class: power #Power, watts. Not "Energy" i.e. Wh.
state_class: measurement
Server2_Power:
state: "{{states('sensor.SRV2Power')}}"
unit_of_measurement: W
device_class: power #Power, watts. Not "Energy" i.e. Wh.
state_class: measurement
Server1_Inlet_Temperature:
state: "{{states('sensor.SRV1IntakeTemp')}}"
unit_of_measurement: °C
device_class: temperature
state_class: measurement
Server2_Inlet_Temperature:
state: "{{states('sensor.SRV2IntakeTemp')}}"
unit_of_measurement: °C
device_class: temperature
state_class: measurement
Server1_CPU1_Temperature:
state: "{{states('sensor.SRV1CPU1Temp')}}"
unit_of_measurement: °C
device_class: temperature
state_class: measurement
Server1_CPU2_Temperature:
state: "{{states('sensor.SRV1CPU2Temp')}}"
unit_of_measurement: °C
device_class: temperature
state_class: measurement
Server2_CPU1_Temperature:
state: "{{states('sensor.SRV2CPU1Temp')}}"
unit_of_measurement: °C
device_class: temperature
state_class: measurement
Server1_Fan_Speed_Avg:
state: >
{{ (( states('sensor.SRV1Fan1Speed') | float +
states('sensor.SRV1Fan2Speed') | float) / 2) | round(0) }}
unit_of_measurement: RPM
icon: mdi:fan
Server2_Fan_Speed_Avg:
state: >
{{ (( states('sensor.SRV2Fan1Speed') | float / 1) | round(0) }}
unit_of_measurement: RPM
icon: mdi:fan