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

Error with set schedule service. #69

Open
Trickytree1984 opened this issue Aug 21, 2024 · 8 comments
Open

Error with set schedule service. #69

Trickytree1984 opened this issue Aug 21, 2024 · 8 comments

Comments

@Trickytree1984
Copy link

I get the following error when trying to run the set schedule service...

Error: expected str, bytes or os.PathLike object, not NoneType

Config is like so:
image

image

error
image

Current state of target rate sensor in octopus integration:
image

@martinpelant
Copy link

Probably same issue as #66 Until fix is ready you should be able to replace it yourself locally Screenshot 2024-08-21 at 4 18 47 PM

@Trickytree1984
Copy link
Author

Probably same issue as #66 Until fix is ready you should be able to replace it yourself locally Screenshot 2024-08-21 at 4 18 47 PM

Thanks for this. I changed the variable above but still get the same error. Looking deeper into the logs this is the error:

Logger: homeassistant.helpers.script.websocket_api_script
Source: helpers/script.py:525
First occurred: 11:09:17 (2 occurrences)
Last logged: 11:12:53

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: expected str, bytes or os.PathLike object, not NoneType
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 525, 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(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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 2763, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hypervolt_charger/service.py", line 56, in async_set_schedule
timezone = get_time_zone(coordinator.data.schedule_tz)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/dt.py", line 105, in get_time_zone
return zoneinfo.ZoneInfo(time_zone_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/zoneinfo/_tzpath.py", line 73, in find_tzfile
_validate_tzfile_path(key)
File "/usr/local/lib/python3.12/zoneinfo/_tzpath.py", line 86, in _validate_tzfile_path
if os.path.isabs(path):
^^^^^^^^^^^^^^^^^^^
File "", line 62, in isabs
TypeError: expected str, bytes or os.PathLike object, not NoneType

@Meatballs1
Copy link
Contributor

Meatballs1 commented Aug 31, 2024

What version of HA are you on?
What version of the integration are you on?
What charger have you got?
What timezone are you in/what is the charger set to?

I'm not seeing this issue with 2024.5 and v2.3.2 and a v2 charger in BST/UK.

It looks like it stems from:

timezone = get_time_zone(coordinator.data.schedule_tz)

Have you ever setup a schedule before? I wonder if the timezone may be Null if you have never used one, so maybe set one up in the app first.

@Trickytree1984
Copy link
Author

Hi i still have the issue.

HA versions

Core 2024.9.3
Supervisor 2024.09.1
Operating System 13.1
Frontend 20240909.1

Hypervolt V3 charger

Hypervolt integration version: 2.3.2

I have set a scheduled in in the past, there is one set on the charger at the moment (from when i had last set it for negative agile rates)

image

@Trickytree1984
Copy link
Author

Looking in the settings on the hypervolt app, timezone is set to Europe/London

@johnbradshw
Copy link

Mine does this as well, the Hypervolt API is not returning the timezone for the charger (perhaps because the charger was created before Hypervolt supported timezones).

@gndean If you get chance could you update to default to "Europe/London" when the timezone isn't available please?

@mrsimon34
Copy link

I'm getting this error also. Timezone appears to be set up correctly on the app.

Core 2024.11.2
Supervisor 2024.11.4
Operating System 13.2
Frontend 20241106.2
Hypervolt "Home 3 Pro" charger
Hypervolt integration version: 2.4.1

@Meatballs1
Copy link
Contributor

Could try the following fix: https://github.com/Meatballs1/home-assistant-hypervolt-charger/blob/timezone_workaround/custom_components/hypervolt_charger/service.py

I've not tested it yet

                        try:
                            timezone = get_time_zone(coordinator.data.schedule_tz)
                        except Exception:
                            timezone = get_time_zone("Europe/London")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants