Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script not work #107633

Closed
ilvi80 opened this issue Jan 9, 2024 · 5 comments
Closed

Script not work #107633

ilvi80 opened this issue Jan 9, 2024 · 5 comments

Comments

@ilvi80
Copy link

ilvi80 commented Jan 9, 2024

The problem

not work

What version of Home Assistant Core has the issue?

2024.1.2

What was the last working version of Home Assistant Core?

2023.12.2

What type of installation are you running?

Home Assistant OS

Integration causing the issue

script

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

alias: Бризер 0-3-800
sequence:
  - service: climate.set_fan_mode
    data:
      fan_mode: 0-3:800
    target:
      entity_id: climate.tion_breezer_4s
  - delay:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 500
  - service: input_text.set_value
    data:
      value: Режим 0-3:800
    target:
      entity_id: input_text.go_sostoianie_raboty_brizera
mode: single

Anything in the logs that might be useful for us?

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:238
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 08:57:56 (7 occurrences)
Last logged: 14:04:06

[547391541312] sequence item 2: expected str instance, int found
[547332057792] sequence item 2: expected str instance, int found
[547856658880] sequence item 2: expected str instance, int found
[547588421568] sequence item 2: expected str instance, int found
[547261711296] sequence item 2: expected str instance, int found
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 238, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 605, in _service_handler
    response = await self._async_start_run(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 563, in _async_start_run
    script_result = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 594, in _async_run
    return await self.script.async_run(script_vars, context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1587, in async_run
    return await asyncio.shield(run.async_run())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 426, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 479, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 502, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 476, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 713, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 675, in _async_run_long_action
    return long_task.result()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 565, in async_handle_set_fan_mode_service
    self._valid_mode_or_raise("fan", fan_mode, self.fan_modes)
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 526, in _valid_mode_or_raise
    modes_str: str = ", ".join(modes) if modes else ""
                     ^^^^^^^^^^^^^^^^
TypeError: sequence item 2: expected str instance, int found

Additional information

not work

@home-assistant
Copy link

home-assistant bot commented Jan 9, 2024

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (websocket_api) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of websocket_api can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign websocket_api Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


websocket_api documentation
websocket_api source
(message by IssueLinks)

@HaZe2232
Copy link

im having the same issues, but with using Eufy Security from HACS.

Screenshot 2024-01-11 165826
Screenshot 2024-01-11 165923

@RealLord
Copy link

RealLord commented Jan 16, 2024

I have the same issues. Costom integration. All brakes after changing version from 2023.12 to 2024.01
Script:

alias: 3 этаж [Кабинет Дима] Бризер ON
description: ""
trigger:
  - platform: time
    at: "08:00"
condition: []
action:
  - service: climate.set_fan_mode
    target:
      area_id:
        - 3_etazh_kabinet_dima
    data:
      fan_mode: "2:2"
mode: single
Logger: homeassistant.components.automation.vkliuchit_brizery_v_kabinete_dima
Source: helpers/script.py:476
Integration: Автоматизация ([documentation](https://www.home-assistant.io/integrations/automation), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+automation%22))
First occurred: 15:25:47 (1 occurrences)
Last logged: 15:25:47

3 этаж [Кабинет Дима] Бризер ON: Error executing script. Unexpected error for call_service at pos 1: sequence item 2: expected str instance, int found
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 476, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 713, in _async_call_service_step
    response_data = await self._async_run_long_action(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 675, in _async_run_long_action
    return long_task.result()
           ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2149, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2186, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 272, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 882, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 952, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 565, in async_handle_set_fan_mode_service
    self._valid_mode_or_raise("fan", fan_mode, self.fan_modes)
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 526, in _valid_mode_or_raise
    modes_str: str = ", ".join(modes) if modes else ""
                     ^^^^^^^^^^^^^^^^
TypeError: sequence item 2: expected str instance, int found

@home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (climate) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of climate can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign climate Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


climate documentation
climate source
(message by IssueLinks)

@gjohansson-ST
Copy link
Member

Please raise an issue at the custom components repository.
mode and modes needs to be strings https://developers.home-assistant.io/docs/core/entity/climate#properties

@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants