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

[Bug]: Help for Actions needed #868

Open
4 of 5 tasks
viper539 opened this issue Dec 11, 2024 · 1 comment
Open
4 of 5 tasks

[Bug]: Help for Actions needed #868

viper539 opened this issue Dec 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@viper539
Copy link

Describe the issue

Hi, i really like what you have build here.
I'm currently struggling with the Action: Huawei Solar: Set Fixed Charge Periods
I created a period via template, but it wouldn't accept it.

This, via Dev-tools->Actions, works:
action: huawei_solar.set_fixed_charge_periods data: device_id: <long key> periods: | {{states('sensor.batterie_laden_value')}}

This, via button, not:
type: button tap_action: action: none hold_action: action: perform-action confirmation: text: Batterie Ladeperiode speichern? perform_action: huawei_solar.set_fixed_charge_periods target: {} data: device_id: <long key> periods: | {{states('sensor.batterie_laden_value')}} show_state: false icon: mdi:battery-charging name: setze Ladeperiode

sensor.batterie_laden_value = "05:30-06:00/6000W"

HD tells me:
"Failed to perform the action huawei_solar/set_fixed_charge_periods. Invalid periods"

I would be very happy when you could add some examples to the Documentation.

Thank you very much!
viper539

Describe your Huawei Solar Setup

Inverter Type: SUN2000-10KTL-M1
Inverter Firmware version: V100R001C00SPC161
sDongle present: Yes
sDongle Type: sDongleA-05 (WiFi / Ethernet)
sDongle Connectivitiy: WiFi
sDongle Firmware: V100R001C00SPC133
Power meter present: three phase
Optimizers Present: No
Battery: LUNA2000 10KW-C1
Battery Firmware version: unknown
Huawei Solar integration version: unknown

How do you connect to the inverter?

Via the SUN2000-<serial_no> WiFi

Upload your Diagnostics File

Drag & Drop your Diagnostics File here.

Upload your relevant debug logs

2024-12-11 02:24:43.756 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139875847375744] Unexpected exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 245, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<7 lines>...
    )
    ^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/huawei_solar/services.py", line 604, in set_fixed_charge_periods
    raise ValueError("Invalid periods")
ValueError: Invalid periods

Please confirm the following:

  • I'm running the latest release of Home Assistant.
  • I'm running the latest release of this integration.
  • I did not find an existing issue describing this problem.
  • I did upload the diagnostics-file that I could retrieve from the 'Devices & Services Page'
  • I did upload the relevant debug logs (via 'Enable Debug Logging'-feature or by manually configuring HA logging)
@viper539 viper539 added the bug Something isn't working label Dec 11, 2024
@scruysberghs
Copy link

looks like a similar error is trown when I try to call :

action: huawei_solar.set_capacity_control_periods
data:
  device_id: f0c20b3b4e7a1af202ae2bca230becbe
  periods: 00:00-23:59/1234567/5200W

`Logger: homeassistant.helpers.script.websocket_api_script
Source: helpers/script.py:526
First occurred: 5:30:29 PM (2 occurrences)
Last logged: 5:54:55 PM

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'tuple' object has no attribute 'set'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<9 lines>...
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/huawei_solar/services.py", line 575, in set_capacity_control_periods
await bridge.set(
^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'set'


Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/huawei_solar/services.py:573
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 5:30:40 PM (3 occurrences)
Last logged: 5:31:20 PM
[139632520784064] Error handling message: Unknown error (unknown_error) Steven Cruysberghs from 100.93.213.49 (Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0)

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 816, in handle_execute_script
script_result = await script_obj.async_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
msg.get("variables"), context=context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1801, in async_run
return await asyncio.shield(create_eager_task(run.async_run()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 464, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 528, in _async_step
self._handle_exception(
~~~~~~~~~~~~~~~~~~~~~~^
ex, continue_on_error, self._log_exceptions or log_exceptions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 558, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 526, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 764, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<9 lines>...
)
^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 727, in _async_run_long_action
return await long_task
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2802, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2845, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/huawei_solar/services.py", line 573, in set_capacity_control_periods
raise ValueError("Invalid periods")
ValueError: Invalid periods`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants