alextud / ha-prana

Prana recuperators (fan) for Home Assistant
23 stars 2 forks source link

Upgrading to a new version of Python in HA 2022.7 #5

Open rubic0day opened 2 years ago

rubic0day commented 2 years ago

The plugin stopped working in the new version of Home Assistant (2022.7) on HasOs.I think the reason for this is the switch to the new version of Python.

Logger: homeassistant.setup Source: setup.py:162 First occurred: 12:50:05 (1 occurrences) Last logged: 12:50:05

Setup failed for custom integration prana: Requirements for prana not found: ['bluepy==1.3.0'].

ValiEne commented 2 years ago

+1, thanks

luciandf commented 2 years ago

same problem here! really wish this plugin could be updated! I have found this in HACS:

https://github.com/custom-components/ble_monitor

But this doesn't seem to discover Prana. It did discover and I can access MiFlora sensors that were also inactive after the latest update.

alextud commented 2 years ago

I've changed bluetooth library to bleak, it should work right now. But I assume that there might be some bugs or not stable enough.

If running home assistant in docker you need to add also docker parameters

-v /var/run/dbus/:/var/run/dbus/:z
ValiEne commented 2 years ago

It worked for me, thanks a lot @alextud

luciandf commented 2 years ago

it worked for me too! thank you @alextud

rubic0day commented 2 years ago

A new error on HA 2022.8.0 Integration error: prana - Requirements for prana not found: ['bleak==0.14.3'].

luciandf commented 2 years ago

I have the following error which appears randomnly. Sometimes the device is accessible for a bit and then becomes gray. Other times after HA restart it is just gray.

 Logger: custom_components.prana.prana
Source: custom_components/prana/prana.py:128
Integration: Prana
First occurred: 27 July 2022 at 15:32:49 (10919 occurrences)
Last logged: 10:38:05
Prana communication failed. Stopping trying.

I have not updated to 2022.8.0 yet!

alextud commented 2 years ago

A new error on HA 2022.8.0 Integration error: prana - Requirements for prana not found: ['bleak==0.14.3'].

I've increased bleak version to ['bleak==0.15.1'] should work.

alextud commented 2 years ago

I have the following error which appears randomnly. Sometimes the device is accessible for a bit and then becomes gray. Other times after HA restart it is just gray.

 Logger: custom_components.prana.prana
Source: custom_components/prana/prana.py:128
Integration: Prana
First occurred: 27 July 2022 at 15:32:49 (10919 occurrences)
Last logged: 10:38:05
Prana communication failed. Stopping trying.

I have not updated to 2022.8.0 yet!

I have the following error which appears randomnly. Sometimes the device is accessible for a bit and then becomes gray. Other times after HA restart it is just gray.

 Logger: custom_components.prana.prana
Source: custom_components/prana/prana.py:128
Integration: Prana
First occurred: 27 July 2022 at 15:32:49 (10919 occurrences)
Last logged: 10:38:05
Prana communication failed. Stopping trying.

I have not updated to 2022.8.0 yet!

For me this happens when bluetooth connection is not stable (poor signal). Since Prana is pooling for changes every minute I think, you can increase pooling interval. For me is 2 minutes, ex:

prana: scan_interval: 120

ValiEne commented 2 years ago

The fix doesn't work for me, I get this error: _"This error originated from a custom integration. Logger: custom_components.prana.prana Source: customcomponents/prana/prana.py:144 Integration: Prana First occurred: 22:16:17 (5 occurrences) Last logged: 22:20:19 Prana communication failed. Stopping trying."'

HA details: Home Assistant 2022.8.2 Supervisor 2022.07.0 Operating System 8.4 Frontend 20220802.0 - latest

alextud commented 2 years ago

Do you have Bluetooth integration active ? For me Prana is not working when this integration si enabled, so I disabled for now:

Screenshot 2022-08-09 at 13 24 51
ValiEne commented 2 years ago

You are right @alextud, after disabling the BT integration in Devices I can control the fan without any issue. Maybe this integration "locks" the BT adapter access so the Prana integration fails to talk with the fan?

luciandf commented 2 years ago

it happened again after update:

 Logger: homeassistant.setup
Source: setup.py:184
First occurred: 15:47:49 (1 occurrences)
Last logged: 15:47:49
Setup failed for custom integration prana: Requirements for prana not found: ['bleak==0.14.3'].

Is there a way to make it so that is doesn't depend on an actual version of bleak?

ValiEne commented 2 years ago

Just replace the content of the files located in custom_components with the latest versions from here. Also, you need to disable the newly added Bluetooth add-on in HA.

it happened again after update:


 Logger: homeassistant.setup

Source: setup.py:184

First occurred: 15:47:49 (1 occurrences)

Last logged: 15:47:49

Setup failed for custom integration prana: Requirements for prana not found: ['bleak==0.14.3'].

Is there a way to make it so that is doesn't depend on an actual version of bleak?

luciandf commented 2 years ago

it is working now! thank you! Any idea how I can automate the fan? like set a speed level for in and another for out at a certain time?

ValiEne commented 2 years ago

it is working now! thank you! Any idea how I can automate the fan? like set a speed level for in and another for out at a certain time?

No worries. I have no clue how I can play with different speeds for in and out vents. For automations I've using Node Red most of the time as I find it more simple and easy to troubleshot

alextud commented 2 years ago

Currently we are using home assistant fan entity which expose a subset of functionality (generic fan)

In node red are exposed these functionalities:

Screenshot 2022-08-13 at 15 21 02

. In order to expose other functionalities I think that we need to write code (create new services)

alfyoc commented 2 years ago

would you be so kind to update your very useful app? with the latest homeassistn update an error appears and bon I can make it work, thank you very much

alextud commented 2 years ago

should work now ...

alfyoc commented 2 years ago

i tried but it doesn't work

alextud commented 2 years ago

Do you have any logs from HA?

alfyoc commented 2 years ago

Hello, yes

image

zauan commented 2 years ago

It doesn't work for me either. i am using the Bluethooth integration from HA. Here are the logs

2022-10-20 11:47:34.453 DEBUG (MainThread) [custom_components.prana.prana] Sending command BEEF0501000000005A to prana 34:86:5D:10:0B:06
2022-10-20 11:47:34.453 DEBUG (MainThread) [custom_components.prana.prana] Error talking to prana.
Traceback (most recent call last):
File "/config/custom_components/prana/prana.py", line 107, in sendCommand
await asyncio.wait_for(device.connect(), timeout=30)
File "/usr/local/lib/python3.10/asyncio/tasks.py", line 445, in wait_for
return fut.result()
File "/usr/src/homeassistant/homeassistant/components/bluetooth/models.py", line 285, in connect
self._backend = wrapped_backend.client(
File "/usr/src/homeassistant/homeassistant/components/esphome/bluetooth/client.py", line 86, in __init__
self.domain_data = DomainData.get(async_get_hass())
File "/usr/src/homeassistant/homeassistant/core.py", line 190, in async_get_hass
return _cv_hass.get()
LookupError: <ContextVar name='current_entry' at 0x7f8ad74dd0d0>
alextud commented 1 year ago

Are you using latest version of HA ? just checking ... I have a switchbot that is using default bluetooth integration and is seem to work. But who know maybe there are some case when is not working correctly ...