core: the price of energy is not saved

The problem

When I add a consumption element and set a static energy price this is not saved.

When I create a new consumption element

If, after saving, I change the amount of the energy cost, this data is not saved. After save this is the result

In the summary page the cost is not calculated. Energy report page

What version of Home Assistant Core has the issue?

core-2022.3.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Energy

Link to integration documentation on our website

https://www.home-assistant.io/docs/energy

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

[547540945984] Error handling message: Unknown error
12:21:07 – (ERRORE) Home Assistant WebSocket API - il messaggio si è verificato per la prima volta alle 12:20:58 e compare 7 volte
Logger: homeassistant.components.websocket_api.http.connection
Source: components/energy/data.py:135
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 12:20:58 (7 occurrences)
Last logged: 12:21:07

[547540945984] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/connection.py", line 107, in async_handle
    handler(self.hass, self, schema(msg))
  File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 386, in validate_mapping
    cval = cvalue(key_path, value)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/validators.py", line 215, in _run
    return self._exec(self._compiled, value, path)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/validators.py", line 339, in _exec
    v = func(path, v)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
    return schema(data)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 635, in validate_sequence
    cval = validate(index_path, value)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
    return schema(data)
  File "/usr/src/homeassistant/homeassistant/helpers/config_validation.py", line 901, in key_value_validator
    return cast(dict[Hashable, Any], value_schemas[key_value](value))
  File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 386, in validate_mapping
    cval = cvalue(key_path, value)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/validators.py", line 215, in _run
    return self._exec(self._compiled, value, path)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/validators.py", line 339, in _exec
    v = func(path, v)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 635, in validate_sequence
    cval = validate(index_path, value)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/validators.py", line 215, in _run
    return self._exec(self._compiled, value, path)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/validators.py", line 339, in _exec
    v = func(path, v)
  File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
    return schema(data)
  File "/usr/src/homeassistant/homeassistant/components/energy/data.py", line 135, in _flow_from_ensure_single_price
    val["entity_energy_price"] is not None
KeyError: 'entity_energy_price'



### Additional information

_No response_

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 17 (1 by maintainers)

Most upvoted comments

@parberge I confirm, the problem seems solved. Thanks.

Marco

Typing in the input results in dialog-energy-grid-flow-settings.ts:72 Uncaught TypeError: Cannot read properties of undefined (reading 'value')