ThermIQ / thermiq_mqtt-ha

Home Assistant integration of ThermIQ-MQTT, providing control and logging of Thermia heatpumps
https://thermiq.net
MIT License
22 stars 19 forks source link

KeyError: 'step' during setup_input_number() #32

Closed Maaxion closed 2 years ago

Maaxion commented 2 years ago

Version of the custom_component

1.3.5

Configuration

# Begin ThermIQ #####
# ThermIQ-MQTT configuration.yaml entry
# Set your mqtt_node name here (from ThermIQ-MQTT WiFi config). Thats all!
# The mqtt_node name can also be seen in MQTT-Eplorer or similar
thermiq_mqtt:
  mqtt_node: ThermIQ/ThermIQ-mqtt
  language: "en" # Change friendly names of values. Implemented languages: en,se,fi,no,de
  thermiq_dbg: True
  hexformat: True

# End ThermIQ ######
# ##################

Describe the bug

Automation for creating input_numbers produces KeyError: 'step'.

A bit baffled by this one, I logged CONFIG_INPUT_NUMBER and all dicts contain 'step'. Any idea what could be going on here? Any additional logs that would be helpful?

Debug log


Traceback (most recent call last):
  File "/config/custom_components/thermiq_mqtt/__init__.py", line 177, in handle_home_assistant_started_event
    await create_entities_and_automations(hass)
  File "/config/custom_components/thermiq_mqtt/helper.py", line 259, in create_entities_and_automations
    await setup_input_number(hass, {COMPONENT_INPUT_NUMBER: CONFIG_INPUT_NUMBER})
  File "/usr/src/homeassistant/homeassistant/components/input_number/__init__.py", line 136, in async_setup
    await yaml_collection.async_load(
  File "/usr/src/homeassistant/homeassistant/helpers/collection.py", line 185, in async_load
    await self.notify_changes(change_sets)
  File "/usr/src/homeassistant/homeassistant/helpers/collection.py", line 142, in notify_changes
    await asyncio.gather(
  File "/usr/src/homeassistant/homeassistant/helpers/collection.py", line 380, in _collection_changed
    await entity_component.async_add_entities(new_entities)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 614, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 801, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 553, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 593, in _async_write_ha_state
    extra_state_attributes = self.extra_state_attributes
  File "/usr/src/homeassistant/homeassistant/components/input_number/__init__.py", line 266, in extra_state_attributes
    ATTR_STEP: self._step,
  File "/usr/src/homeassistant/homeassistant/components/input_number/__init__.py", line 246, in _step
    return self._config[CONF_STEP]
KeyError: 'step'
Maaxion commented 2 years ago

This one is partially solved.

There was an input_number I had in my configurations for a different integration that was incorrectly formatted (Missing the step variable). This was being collected into the CUSTOM_INPUT_NUMBER dict of helper.py and was causing this integration to crash.

ThermIQ commented 2 years ago

Closed as unrelated