zxdavb / ramses_cc

HA integration for CH/DHW and HVAC systems that use the RAMSES II RF protocol
GNU General Public License v3.0
80 stars 17 forks source link

voluptuous.error.MultipleInvalid: not a valid value for dictionary value @ data['class'] after updating to 2024.8.0 #198

Closed daanroeterink closed 3 months ago

daanroeterink commented 3 months ago

Describe the bug Configuration error after updating to: Home assisstant 2024.8.0

To Reproduce Steps to reproduce the behaviour (for example):

  1. After the update the ramses_cc integration didn't want to load
  2. Running Ramses_cc 0.41.23 Which worked in the 2024.7 releases of home assistant
  3. Error in logging shows configuration error

Configuration

  serial_port: '/dev/serial/by-id/usb-SparkFun_evofw3_atmega32u4-if00'
  packet_log:
    file_name: packet.log
    rotate_bytes: null
    rotate_backups: 7
  orphans_hvac: [30:123456, 32:222222, 32:157747]
  known_list:
    29:179540:
      class: "REM"
      faked: True
      commands:
        away: " I --- 29:179540 32:157747 --:------ 22F1 003 000004"
        low: " I --- 29:179540 32:157747 --:------ 22F1 003 000104"
        medium: " I --- 29:179540 32:157747 --:------ 22F1 003 000204"
        high: " I --- 29:179540 32:157747 --:------ 22F1 003 000304"
        auto: " I --- 29:179540 32:157747 --:------ 22F1 003 000404"
        auto2: " I --- 29:179540 32:157747 --:------ 22F1 003 000504"
        boost: " I --- 29:179540 32:157747 --:------ 22F1 003 000604"
        disable: " I --- 29:179540 32:157747 --:------ 22F1 003 000704"
        bypass_open: " W --- 29:179540 32:157747 --:------ 22F7 003 00C8EF"
        bypass_close: " W --- 29:179540 32:157747 --:------ 22F7 003 0000EF"
        bypass_auto: " W --- 29:179540 32:157747 --:------ 22F7 003 00FFEF"
        reset_filter: " W --- 29:179540 32:157747 --:------ 10D0 002 00FF"
    32:157747:
      class: "FAN"

Exception

Logger: homeassistant.config_entries
Source: config_entries.py:604
First occurred: 9:52:45 AM (6 occurrences)
Last logged: 11:02:53 AM

Error setting up entry RAMSES RF for ramses_cc
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ramses_cc/__init__.py", line 89, in async_setup_entry
    await broker.async_setup()
  File "/config/custom_components/ramses_cc/broker.py", line 146, in async_setup
    await self.client.start(cached_packets=cached_packets())
  File "/usr/local/lib/python3.12/site-packages/ramses_rf/gateway.py", line 184, in start
    load_schema(self, known_list=self._include, **self._schema)  # create faked too
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/ramses_rf/schemas.py", line 378, in load_schema
    dev = _get_device(gwy, device_id)  # , **traits)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/ramses_rf/schemas.py", line 343, in _get_device
    return gwy.get_device(dev_id, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/ramses_rf/gateway.py", line 396, in get_device
    traits: dict[str, Any] = SCH_TRAITS(self._include.get(device_id, {}))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 259, in __call__
    return self._exec((Schema(val) for val in self.validators), v)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 315, in _exec
    raise error if self.msg is None else AnyInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 307, in _exec
    return func(v)
           ^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 205, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 256, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 315, in _exec
    raise error if self.msg is None else AnyInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 309, in _exec
    return func(path, v)
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 779, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 205, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 549, in validate_dict
    return base_validate(path, data.items(), out)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 382, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: not a valid value for dictionary value @ data['class']

I already tried to add quotes to the value of class in the known_list entries but that didn't seem to do the trick.

RandE24 commented 3 months ago

I’ve got the same problem.

ndeunk commented 3 months ago

Same issue here.

if I remove the fake remote from the configuration there is no problem (but then I do not have a remote).

I reverted back to 2024.07.4. Then the fake remotes works again.

acseven commented 3 months ago

I am experiencing the same issue as well.

zxdavb commented 3 months ago

I can look at this mid next week.

rolandc commented 3 months ago

I have the same issue. When I remove the "commands" section from the configuration, it works. Maybe that helps in the investigation.

surfsebas commented 3 months ago

I am having the same issue The HVAC Orcon part stopt working after update. Evo home still works fine. the service: ramses_cc.send_command is missing in the developer tools ?

service: ramses_cc.send_command data: entity_id: remote.29_149235 command: high1h num_repeats: 3 delay_secs: 0.05

jcjveraa commented 3 months ago

Yup same here, at the exact timestamp after an 'auto update' to the latest HASS "stable"-tag docker image on 07-08-2024 (which was 2024.8.0) the packet.log also stopped updating (likely related to the plugin not initializing). The docker image has been updated since then on 10-08 but error remains the same. Nothing really noteworthy in the releasenotes, and based on my inspection of the docker image layers between the current verstion and 2024.07 they both use python 3.12.4.

jcjveraa commented 3 months ago

Additionally, after rolling back to 2024.7.4 this morning as reported by Daan it works again. Also I noticed the following log line when starting: The 'ramses_cc' option near /config/configuration.yaml:3 is deprecated, please remove it from your configuration.

FYI my (messy, but exactly as-is) config

ramses_cc:
  serial_port: /dev/ttyACM0
#   serial_port: /share/Logs_SSD/homeassistant_symlinks/ttyEvoFw3

#   restore_cache:
#     restore_schema: false
#     restore_state: true

  packet_log:
    file_name: evohome_rameses_logs/packet.log
    rotate_backups: 7

  ramses_rf:
    enforce_known_list: true
    disable_discovery: false
    enable_eavesdrop: false
    # enable_eavesdrop: true

  01:176155:
    system:
      appliance_control: 10:133877

  known_list:
    18:071181: # gateway
    01:176155: # controller
    10:133877: # ketel?
    03:123456: {class: THM, faked: true}  # device type must be 03 (recommended), 12, 22 or 34
    37:123456: 
      class: REM
      faked: true
      commands:
        normal:       ' I 073 --:------ --:------ 31:086097 22F1 003 000204'
        boost:        ' I 069 --:------ --:------ 31:086097 22F1 003 000404'
zxdavb commented 3 months ago

I have issued a fix to the library that I believe is responsible for this bug: https://github.com/alecthomas/voluptuous/pull/524

zxdavb commented 3 months ago

Fixed in: https://github.com/zxdavb/ramses_cc/releases/tag/0.42.0

acseven commented 3 months ago

Works for me, thank you!

jcjveraa commented 2 months ago

Hi, would you be OK with actually releasing this (instead of "pre-release" which it is now)? The HACS "store" still shows 0.41.23 as the latest version, so I can't auto-Update to this version which I would prefer over a manual update.

With the colder weathered here in the Netherlands I might actually need to run my heating system any day now, so having my "faked" temperature sensors up and running would be great :-)

Thanks!

Op za 17 aug 2024 om 23:47 schreef acseven @.***>

Works for me, thank you!

— Reply to this email directly, view it on GitHub https://github.com/zxdavb/ramses_cc/issues/198#issuecomment-2294994366, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6CPHNIBMPJECBVMSGQKFTZR7AIVAVCNFSM6AAAAABMICAOXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJUHE4TIMZWGY . You are receiving this because you commented.Message ID: @.***>