sanjoyg / dirigera_platform

HomeAssistant Integration for Dirigera Platform
MIT License
122 stars 16 forks source link

Inspelning support #74

Closed AboveColin closed 1 month ago

AboveColin commented 1 month ago

Describe your changes

Added support for the inspelning. I don't have other IKEA plugs, so I can't test to know for sure if it broke the other plugs, so it would be nice if someone could test that out :) Feel free to comment if something needs to be altered 😁

Screenshot 2024-10-03 at 10 22 44

Checklist before submitting a pull request

Checklist for reviewer

Leave-MeAlone commented 1 month ago

Sensors are not visible if I update those 2 files, also my VINDSTYRKA sensors stop working

AboveColin commented 1 month ago

Sensors are not visible if I update those 2 files, also my VINDSTYRKA sensors stop working

Forgot to add the upgrade to the newest version of the dirigera package, the sensors should be available now! Could you add some logs of the error of the vindstyrka is causing? 😁

Leave-MeAlone commented 1 month ago

2024-10-04 14_24_08-Instellingen – Home Assistant and 6 more pages - Work - Microsoft​ Edge 2024-10-04 14_24_49-Instellingen – Home Assistant and 6 more pages - Work - Microsoft​ Edge 2024-10-04 14_25_27-Instellingen – Home Assistant and 6 more pages - Work - Microsoft​ Edge 2024-10-04 14_26_06-Instellingen – Home Assistant and 6 more pages - Work - Microsoft​ Edge 2024-10-04 14_26_22-Instellingen – Home Assistant and 6 more pages - Work - Microsoft​ Edge

Lot of different errors if I update with your files

AboveColin commented 1 month ago

Lot of different errors if I update with your files

Hi! I updated some stuff, could you try again?

fa-ve commented 1 month ago

Lot of different errors if I update with your files

Hi! I updated some stuff, could you try again?

best way to update? download files and overwrite?

AboveColin commented 1 month ago

best way to update? download files and overwrite?

What you like the most: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

If you don't want to deal with git, I think downloading and overwriting manually is the easiest :)

fa-ve commented 1 month ago

I put a test instance up to do these tests, did a full copy paste:

Logger: homeassistant.helpers.frame Source: helpers/frame.py:155 First occurred: 15:08:58 (1 occurrences) Last logged: 15:08:58

Detected code that calls async_forward_entry_setups for integration dirigera_platform with title: IKEA Dirigera Hub : 192.168.179.71 and entry_id: 01J9C0Y75WWMJ1B0G4XDZJ3XY3, during setup without awaiting async_forward_entry_setups, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:361 integration: Sensor (documentation, issues) First occurred: 14:56:14 (1 occurrences) Last logged: 14:56:14

Error while setting up dirigera_platform platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/dirigera_platform/sensor.py", line 82, in async_setup_entry await hass.async_add_executor_job(hub.create_empty_scene,scene_name, controller.unique_id) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/dirigera_platform/dirigera_lib_patch.py", line 42, in create_empty_scene response_dict = self.post( ^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/hub/hub.py", line 131, in post response.raise_for_status() File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://192.168.179.71:8443/v1/scenes

It's complaining about scene's and I have one in HA but don't have any in the HUB 2024-10-06 15_11_17-Settings – Home Assistant and 4 more pages - Personal - Microsoft​ Edge Beta

And nothing else in changed, no extra sensors and vindstyrka doesn't show anything anymore.

2024-10-06 15_17_01-Settings – Home Assistant and 4 more pages - Personal - Microsoft​ Edge Beta

AboveColin commented 1 month ago

I put a test instance up to do these tests, did a full copy paste:

Logger: homeassistant.helpers.frame Source: helpers/frame.py:155 First occurred: 15:08:58 (1 occurrences) Last logged: 15:08:58

Detected code that calls async_forward_entry_setups for integration dirigera_platform with title: IKEA Dirigera Hub : 192.168.179.71 and entry_id: 01J9C0Y75WWMJ1B0G4XDZJ3XY3, during setup without awaiting async_forward_entry_setups, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:361 integration: Sensor (documentation, issues) First occurred: 14:56:14 (1 occurrences) Last logged: 14:56:14

Error while setting up dirigera_platform platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 361, in _async_setup_platform await asyncio.shield(awaitable) File "/config/custom_components/dirigera_platform/sensor.py", line 82, in async_setup_entry await hass.async_add_executor_job(hub.create_empty_scene,scene_name, controller.unique_id) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/dirigera_platform/dirigera_lib_patch.py", line 42, in create_empty_scene response_dict = self.post( ^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/dirigera/hub/hub.py", line 131, in post response.raise_for_status() File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://192.168.179.71:8443/v1/scenes

It's complaining about scene's and I have one in HA but don't have any in the HUB 2024-10-06 15_11_17-Settings – Home Assistant and 4 more pages - Personal - Microsoft​ Edge Beta

And nothing else in changed, no extra sensors and vindstyrka doesn't show anything anymore.

2024-10-06 15_17_01-Settings – Home Assistant and 4 more pages - Personal - Microsoft​ Edge Beta

that's weird, Are you sure it's related? I didn't change anything to scenes

AboveColin commented 1 month ago

Fixed this (unrelated) warning:

Detected code that calls async_forward_entry_setups for integration dirigera_platform with title: IKEA Dirigera Hub : 192.168.179.71 and entry_id: 01J9C0Y75WWMJ1B0G4XDZJ3XY3, during setup without awaiting async_forward_entry_setups, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.

And your VINDSTYRKA should now show up again :) Like i said before, I don't have any VINDSTYRKA to test out on, but it'll probably work correctly now again

fa-ve commented 1 month ago

Still broken, I give up and wait till the owner will fix his package, no idea why your updates doesn't show up and parts failing. thanks for the effort..

sanjoyg commented 1 month ago

Have provided the fixes