I am using the HP ILO integration to monitor a server and have a server health object called:
sensor.microserver_server_health
that looks like this:
{'fans': {'Fan 1': {'zone': 'System', 'label': 'Fan 1', 'status': 'OK', 'speed': (18, 'Percentage')}}, 'temperature': {'01-Inlet Ambient': {'label': '01-Inlet Ambient', 'location': 'Ambient', 'status': 'OK', 'currentreading': (26, 'Celsius'), 'caution': (42, 'Celsius'), 'critical': (46, 'Celsius')}, '02-CPU': {'label': '02-CPU', 'location': 'CPU', 'status': 'OK', 'currentreading': (40, 'Celsius'), 'caution': (70, 'Celsius'), 'critical': 'N/A'}, '03-P1 DIMM 1-2': {'label': '03-P1 DIMM 1-2', 'location': 'Memory', 'status': 'OK', 'currentreading': (50, 'Celsius'), 'caution': (87, 'Celsius'), 'critical': 'N/A'}, '04-HD Max': {'label': '04-HD Max', 'location': 'System', 'status': 'Not Installed', 'currentreading': 'N/A', 'caution': 'N/A', 'critical': 'N/A'}, '05-Chipset': {'label': '05-Chipset', 'location': 'System', 'status': 'OK', 'currentreading': (68, 'Celsius'), 'caution': (105, 'Celsius'), 'critical': 'N/A'}, '06-Chipset Zone': {'label': '06-Chipset Zone', 'location': 'System', 'status': 'OK', 'currentreading': (50, 'Celsius'), 'caution': (68, 'Celsius'), 'critical': (73, 'Celsius')}, '07-VR P1 Zone': {'label': '07-VR P1 Zone', 'location': 'System', 'status': 'OK', 'currentreading': (65, 'Celsius'), 'caution': (93, 'Celsius'), 'critical': (98, 'Celsius')}, '08-Supercap Max': {'label': '08-Supercap Max', 'location': 'System', 'status': 'Not Installed', 'currentreading': 'N/A', 'caution': 'N/A', 'critical': 'N/A'}, '09-iLO Zone': {'label': '09-iLO Zone', 'location': 'System', 'status': 'OK', 'currentreading': (52, 'Celsius'), 'caution': (72, 'Celsius'), 'critical': (77, 'Celsius')}, '10-PCI 1': {'label': '10-PCI 1', 'location': 'I/O Board', 'status': 'Not Installed', 'currentreading': 'N/A', 'caution': 'N/A', 'critical': 'N/A'}, '11-PCI 1 Zone': {'label': '11-PCI 1 Zone', 'location': 'I/O Board', 'status': 'OK', 'currentreading': (44, 'Celsius'), 'caution': (64, 'Celsius'), 'critical': (69, 'Celsius')}, '12-Sys Exhaust': {'label': '12-Sys Exhaust', 'location': 'Chassis', 'status': 'OK', 'currentreading': (54, 'Celsius'), 'caution': (68, 'Celsius'), 'critical': (73, 'Celsius')}, '13-LOM': {'label': '13-LOM', 'location': 'System', 'status': 'Not Installed', 'currentreading': 'N/A', 'caution': 'N/A', 'critical': 'N/A'}}, 'power_supplies': {'Power Supply 1': {'label': 'Power Supply 1', 'present': 'Yes', 'status': 'Good, In Use', 'pds': 'No', 'hotplug_capable': 'No', 'model': ' ', 'spare': 'Unknown', 'serial_number': ' ', 'capacity': '0 Watts', 'firmware_version': 'N/A'}}, 'power_supply_summary': {'present_power_reading': '0 Watts', 'power_management_controller_firmware_version': 'N/A', 'hp_power_discovery_services_redundancy_status': 'N/A', 'high_efficiency_mode': 'N/A'}, 'vrm': None, 'processors': {'Proc 1': {'label': 'Proc 1', 'name': ' Intel(R) Xeon(R) CPU E3-1265L V2 @ 2.50GHz ', 'status': 'OK', 'speed': '2500 MHz', 'execution_technology': '4/4 cores; 8 threads', 'memory_technology': '64-bit Capable', 'internal_l1_cache': '128 KB', 'internal_l2_cache': '1024 KB', 'internal_l3_cache': '8192 KB'}}, 'memory': {'advanced_memory_protection': {'amp_mode_status': 'Advanced ECC', 'configured_amp_mode': 'Advanced ECC', 'available_amp_modes': 'Advanced ECC'}, 'memory_details_summary': {'cpu_1': {'number_of_sockets': 2, 'total_memory_size': '16 GB', 'operating_frequency': '1600 MHz', 'operating_voltage': '1.50 v'}}, 'memory_details': {'CPU_1': {'socket 1': {'socket': 1, 'status': 'Good, In Use', 'hp_smart_memory': 'No', 'part': {'number': 'N/A'}, 'type': 'DIMM DDR3', 'size': '8192 MB', 'frequency': '1866 MHz', 'minimum_voltage': '1.50 v', 'ranks': 2, 'technology': 'UDIMM'}, 'socket 2': {'socket': 2, 'status': 'Good, In Use', 'hp_smart_memory': 'No', 'part': {'number': 'N/A'}, 'type': 'DIMM DDR3', 'size': '8192 MB', 'frequency': '1866 MHz', 'minimum_voltage': '1.50 v', 'ranks': 2, 'technology': 'UDIMM'}}}}, 'nic_information': {'NIC Port 1': {'network_port': 'Port 1', 'port_description': 'HP Ethernet 1Gb 2-port 332i Adapter', 'location': 'Embedded', 'mac_address': '34:64:a9:9a:f8:f4', 'ip_address': '192.168.1.220', 'status': 'OK'}, 'NIC Port 2': {'network_port': 'Port 2', 'port_description': 'HP Ethernet 1Gb 2-port 332i Adapter', 'location': 'Embedded', 'mac_address': '34:64:a9:9a:f8:f5', 'ip_address': '192.168.1.164', 'status': 'OK'}}, 'storage': {'Controller on System Board': {'label': 'Controller on System Board', 'status': 'OK', 'controller_status': 'OK', 'serial_number': 'N/A', 'model': 'Dynamic Smart Array B120i Controller', 'fw_version': '5.00'}}, 'storage_discovery_status': 'Discovery Complete', 'firmware_information': {'iLO': '2.50 Sep 23 2016', 'System ROM': 'J06 11/02/2015', 'Redundant System ROM': 'J06 07/16/2015', 'Intelligent Provisioning': '1.61.45', 'Intelligent Platform Abstraction Data': '0.00', 'System ROM Bootblock': '02/04/2012', 'System Programmable Logic Device': 'Version 0x06', 'Server Platform Services (SPS) Firmware': '2.2.0.31.2', 'Dynamic Smart Array B120i Controller': '5.00', 'HP Ethernet 1Gb 2-port 332i Adapter': 'bc 1.39 ncsi 1.3.16.0'}, 'health_at_a_glance': {'bios_hardware': {'status': 'OK'}, 'fans': {'status': 'OK'}, 'temperature': {'status': 'OK'}, 'power_supplies': {'status': 'OK'}, 'processor': {'status': 'OK'}, 'memory': {'status': 'OK'}, 'network': {'status': 'OK'}, 'storage': {'status': 'OK'}}}
I have a template:
platform: template
sensors:
microserver_fan:
value_template: '{{states.sensor.microserver_server_health.attributes.fans["Fan 1"]["speed"][0] }}'
unit_of_measurement: '%'
entity_id: sensor.microserver_server_health
friendly_name: "Fan Speed"
microserver_glance_fans:
value_template: '{{states.sensor.microserver_server_health.attributes.health_at_a_glance["fans"]["status"] }}'
entity_id: sensor.microserver_server_health
friendly_name: "Fans"
and lots of others like it to pull out information from the server_health sensor. When I start up the server I am getting this error:
2017-09-06 15:01:01 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Fan Speed: UndefinedError: 'mappingproxy object' has no attribute 'fans'
2017-09-06 15:01:01 ERROR (MainThread) [homeassistant.components.sensor.template] Could not render template Fans: UndefinedError: 'mappingproxy object' has no attribute 'health_at_a_glance'
I am sure this used to work fine, I can’t see the source of the error.