Coder Social home page Coder Social logo

Comments (15)

Jokeru18 avatar Jokeru18 commented on August 25, 2024

This is the log I get
As far as I can see the integration is setup correctly but Prana does not respond to connection. or?

2022-01-16 07:14:56 DEBUG (PranaWorker) [custom_components.prana] Updating Prana device... 34:86:5d:10:06:62
2022-01-16 07:14:56 DEBUG (Thread-3) [custom_components.prana.prana] Sending command BEEF0501000000005A to prana 34:86:5d:10:06:62
2022-01-16 07:14:56 DEBUG (Thread-3) [custom_components.prana.prana] Connecting to Prana...
2022-01-16 07:14:56 DEBUG (Thread-3) [custom_components.prana.prana] Error talking to prana.
Traceback (most recent call last):
File "/config/custom_components/prana/prana.py", line 114, in sendCommand_raw
device = btle.Peripheral(self.mac)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 391, in init
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral 34:86:5d:10:06:62, addr type: public
2022-01-16 07:14:56 DEBUG (Thread-3) [custom_components.prana.prana] Cannot connect to Prana. Retrying (remaining: 2)...
2022-01-16 07:14:57 DEBUG (Thread-3) [custom_components.prana.prana] Sending command BEEF0501000000005A to prana 34:86:5d:10:06:62
2022-01-16 07:14:57 DEBUG (Thread-3) [custom_components.prana.prana] Connecting to Prana...
2022-01-16 07:14:57 DEBUG (Thread-3) [custom_components.prana.prana] Error talking to prana.
Traceback (most recent call last):
File "/config/custom_components/prana/prana.py", line 114, in sendCommand_raw
device = btle.Peripheral(self.mac)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 391, in init
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral 34:86:5d:10:06:62, addr type: public
2022-01-16 07:14:57 DEBUG (Thread-3) [custom_components.prana.prana] Cannot connect to Prana. Retrying (remaining: 1)...
2022-01-16 07:14:57 DEBUG (Thread-3) [custom_components.prana.prana] Sending command BEEF0501000000005A to prana 34:86:5d:10:06:62
2022-01-16 07:14:57 DEBUG (Thread-3) [custom_components.prana.prana] Connecting to Prana...
2022-01-16 07:14:57 DEBUG (Thread-3) [custom_components.prana.prana] Error talking to prana.
Traceback (most recent call last):
File "/config/custom_components/prana/prana.py", line 114, in sendCommand_raw
device = btle.Peripheral(self.mac)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 391, in init
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral 34:86:5d:10:06:62, addr type: public
2022-01-16 07:14:57 ERROR (Thread-3) [custom_components.prana.prana] Prana communication failed. Stopping trying.
2022-01-16 07:14:57 DEBUG (PranaWorker) [custom_components.prana.prana] result = 0
2022-01-16 07:14:57 DEBUG (PranaWorker) [custom_components.prana] Update failed...

from ha-prana.

alextud avatar alextud commented on August 25, 2024

Hey @Jokeru18, can you try to use the iPhone app, at the same place where HA is placed ? maybe HA is placed to far away from the Prana device, and is not been able to communicate ... so we can check that iPhone app is working ...

from ha-prana.

Jokeru18 avatar Jokeru18 commented on August 25, 2024

Hi, Thank you for the reply.
I was thinking of this posibility so I moved the Laptop in the room where the Prana recuperator is placed but still no luck.
BTW: I'm Runing a virtual machine under windows 10. but the BT 4.0 device is shared with the Virtual machine.

I tried installing HA core straight on linux but I keep running into issues so I opted for this possibiliy.

PS: I confgured a fresh install of HA today, jut to make sure the issue is not some previous config... but it still behaves the same. *Prana communication failed. Stopping trying.
PRANA
*

from ha-prana.

Jokeru18 avatar Jokeru18 commented on August 25, 2024

I see in the manifest it sais "requirements": ["bluepy==1.3.0"]. maybe this is why it is not working
BUt how to I install or check for bluepy in Home Assistant Operating System.
Terminal does not allow any of the regular commands.

from ha-prana.

Jokeru18 avatar Jokeru18 commented on August 25, 2024

I have tried everything. I even installed Home Asssistant Supervised directly in Ubuntu to avoid using a virtual machine but the behavior is the same. Checked and Bluepy 1.3.0 is installed under Python 3.9
I can see that the Bluetooth in Linux shows a connection so it connects to the device but the log looks the same:
Connecting to prana
Connected to prana
Error talking to prana ..

I have no password on the Prana.
No other divice is connected to it.
Laptop is 2m away from the Reruperator

I don't know what's wrong, could it be hardware related? The Bluetooth device is Intel, comes with Dual Band wireless AC-3160.

from ha-prana.

alextud avatar alextud commented on August 25, 2024

Can you try to test bluetooth connection using one these 2 cli tools bluetoothctl or gatttool ?

EX 1:

sudo bluetoothctl 
connect MAC_ADDRESS
menu gatt
select-attribute 0000cccc-0000-1000-8000-00805f9b34fb
notify on
write "0xBE 0xEF 0x05 0x01 0x00 0x00 0x00 0x00 0x5A"

EX 2:

gatttool -b MAC_ADDRESS -I
connect
char-write-req 0x000f 0100
mtu 200
char-write-req 0x000e BEEF0501000000005A

from ha-prana.

Jokeru18 avatar Jokeru18 commented on August 25, 2024

With the first ex. I get stuck at menu gatt. It answers with a list of commands. It also refreshes available devices like crazy.

Second one looks like this:

gatttool -b 34:86:5d:10:06:62 -I
[34:86:5d:10:06:62][LE]> connect
Attempting to connect to 34:86:5d:10:06:62
Connection successful
[34:86:5d:10:06:62][LE]> char-write-req 0x000f 0100
Error: Characteristic Write Request failed: Invalid handle
[34:86:5d:10:06:62][LE]> mtu 200
MTU was exchanged successfully: 200
[34:86:5d:10:06:62][LE]> char-write-req 0x000e BEEF0501000000005A
Error: Characteristic Write Request failed: Invalid handle
[34:86:5d:10:06:62][LE]>
gatttool

from ha-prana.

alextud avatar alextud commented on August 25, 2024

I think that your device is not supported, it is using a different communication handle (address) .

from ha-prana.

Jokeru18 avatar Jokeru18 commented on August 25, 2024

I tried again Ex. 1 and I think I had more success

[PRANA RECUPERATOR       ]# list-attributes
Primary Service (Handle 0x0009)
	/org/bluez/hci0/dev_34_86_5D_10_06_62/service0001
	00001801-0000-1000-8000-00805f9b34fb
	Generic Attribute Profile
Characteristic (Handle 0xd0e4)
	/org/bluez/hci0/dev_34_86_5D_10_06_62/service0001/char0002
	00002a05-0000-1000-8000-00805f9b34fb
	Service Changed
Descriptor (Handle 0x0015)
	/org/bluez/hci0/dev_34_86_5D_10_06_62/service0001/char0002/desc0004
	00002902-0000-1000-8000-00805f9b34fb
	Client Characteristic Configuration
Primary Service (Handle 0xf920)
	/org/bluez/hci0/dev_34_86_5D_10_06_62/service0028
	0000baba-0000-1000-8000-00805f9b34fb
	Unknown
Characteristic (Handle 0x1214)
	/org/bluez/hci0/dev_34_86_5D_10_06_62/service0028/char0029
	0000cccc-0000-1000-8000-00805f9b34fb
	Unknown
Descriptor (Handle 0x0015)
	/org/bluez/hci0/dev_34_86_5D_10_06_62/service0028/char0029/desc002b
	00002902-0000-1000-8000-00805f9b34fb
	Client Characteristic Configuration
[PRANA RECUPERATOR       ]# select-attribute 0000cccc-0000-1000-8000-00805f9b34fb
[PRANA RECUPERATOR       :/service0028/char0029]# notify on
[CHG] Attribute /org/bluez/hci0/dev_34_86_5D_10_06_62/service0028/char0029 Value:
  00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e     ............... 
[CHG] Attribute /org/bluez/hci0/dev_34_86_5D_10_06_62/service0028/char0029 Notifying: yes
Notify started
[PRANA RECUPERATOR       :/service0028/char0029]# write "0xBE 0xEF 0x05 0x01 0x00 0x00 0x00 0x00 0x5A"
Attempting to write /org/bluez/hci0/dev_34_86_5D_10_06_62/service0028/char0029
[CHG] Attribute /org/bluez/hci0/dev_34_86_5D_10_06_62/service0028/char0029 Value:
  be ef 05 01 00 00 00 00 5a c0 01 c0 08 c0 01 c0  ........Z.......
  00 c0 00 00 00 c0 00 40 01 40 1e c0 01 c0 1e c0  .......@.@......
  01 c0 0a 00 00 80 00 00 00 c0 01 00 01 00 00 00  ................
  80 77 00 00 00 00 80 c8 00 00 00 00 aa 00 00 00  .w..............
  00 00 00 00 00 00 00 00 00 00 00 00 00 82 e0 00  ................
  00 00 00 00 00 00 00 00 00 00 00 00 00 ff c0 00  ................
  00 00 00 00 01 00 3c e9 fe                       ......<..       
[PRANA RECUPERATOR       :/service0028/char0029]# 

from ha-prana.

Jokeru18 avatar Jokeru18 commented on August 25, 2024

So I was playing some more with gatttool trying to understand more and I found that I can manually send commands and they work. If I send this **char-write-cmd 0x002a BEEF0405** it turns on Heat so they actually correspond to the ones you have in Prana.py

I ended up to the handle -0x002a by drilling down and if I use char-read-hnd 0x002a I get
Characteristic value/descriptor: 95 ef 05 02 00 00 00 00 5a 00 00 00 00 00 00 00 01 50 52 41 4e 41 20 52 45 43 55 50 45 52 41 54 4f 52 20 20 20 20 20 20 20 03 f0 03 f2 03 f4 03 f6 11 00 00 00 00 00 00 04 00 20 0a 0a 0a 64 64 64 01 09 01 03 0a 64 0a 0a 64 0a 0a 64 0a 00 01 1e 05 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 13 ad 2b e9 fe 6b a4 e1 8e 8b 90 1f 41 a5 b6 36 5a 7a 29 cf 33 fe bf 50 5b 26 a3 7b 96 a3 9b fa 86 92 1f 68 76 0c 08 31 01 00 12 00 00 00 4d 3e 56 9f b3 55 75 7e f2 34 6d ae 21 2e

Any sugestions? What shoudl I should change in the integration files?

Thank you!

from ha-prana.

alextud avatar alextud commented on August 25, 2024

I found a different opensource integration for Prana, can you try to see if this one works for you ?

https://github.com/corvis/prana_rc

it might have a slightly different implementation than mine ...

from ha-prana.

Jokeru18 avatar Jokeru18 commented on August 25, 2024

Hi, yes it works
But there are some issues with the HTTP server as it randomly stops sending data to HA and needs to be restarted.
It also doesn't support independent in/out flow setup.

from ha-prana.

busutm avatar busutm commented on August 25, 2024

Hi,
i have the same problem.
i installed homeassistant via vm with proxmox.
prana

2022-02-11 09:12:46 DEBUG (PranaWorker) [custom_components.prana] Updating Prana device... A8:03:2A:E6:85:06
2022-02-11 09:12:46 DEBUG (Thread-33) [custom_components.prana.prana] Sending command BEEF0501000000005A to prana A8:03:2A:E6:85:06
2022-02-11 09:12:46 DEBUG (Thread-33) [custom_components.prana.prana] Connecting to Prana...
2022-02-11 09:12:46 DEBUG (Thread-33) [custom_components.prana.prana] Error talking to prana.
Traceback (most recent call last):
File "/config/custom_components/prana/prana.py", line 114, in sendCommand_raw
device = btle.Peripheral(self.mac)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 391, in init
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral A8:03:2A:E6:85:06, addr type: public
2022-02-11 09:12:46 DEBUG (Thread-33) [custom_components.prana.prana] Cannot connect to Prana. Retrying (remaining: 2)...
2022-02-11 09:12:46 DEBUG (Thread-33) [custom_components.prana.prana] Sending command BEEF0501000000005A to prana A8:03:2A:E6:85:06
2022-02-11 09:12:46 DEBUG (Thread-33) [custom_components.prana.prana] Connecting to Prana...
2022-02-11 09:12:46 DEBUG (Thread-33) [custom_components.prana.prana] Error talking to prana.
Traceback (most recent call last):
File "/config/custom_components/prana/prana.py", line 114, in sendCommand_raw
device = btle.Peripheral(self.mac)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 391, in init
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral A8:03:2A:E6:85:06, addr type: public
2022-02-11 09:12:46 DEBUG (Thread-33) [custom_components.prana.prana] Cannot connect to Prana. Retrying (remaining: 1)...
2022-02-11 09:12:46 DEBUG (Thread-33) [custom_components.prana.prana] Sending command BEEF0501000000005A to prana A8:03:2A:E6:85:06
2022-02-11 09:12:46 DEBUG (Thread-33) [custom_components.prana.prana] Connecting to Prana...
2022-02-11 09:12:46 DEBUG (Thread-33) [custom_components.prana.prana] Error talking to prana.
Traceback (most recent call last):
File "/config/custom_components/prana/prana.py", line 114, in sendCommand_raw
device = btle.Peripheral(self.mac)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 391, in init
self._connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 439, in _connect
raise BTLEDisconnectError("Failed to connect to peripheral %s, addr type: %s" % (addr, addrType), rsp)
bluepy.btle.BTLEDisconnectError: Failed to connect to peripheral A8:03:2A:E6:85:06, addr type: public
2022-02-11 09:12:46 ERROR (Thread-33) [custom_components.prana.prana] Prana communication failed. Stopping trying.
2022-02-11 09:12:46 DEBUG (PranaWorker) [custom_components.prana.prana] result = 0
2022-02-11 09:12:46 DEBUG (PranaWorker) [custom_components.prana] Update failed...

from ha-prana.

alextud avatar alextud commented on August 25, 2024

I use home-assistant trough docker.

I've tried to connect to Prana with another python library - bleak that is used by corvis project and it did not work for me. Currently I use bluepy library, in your case it seems that it's not connecting so I assume that is related to environment/hardware used.

from ha-prana.

Jokeru18 avatar Jokeru18 commented on August 25, 2024

Thanks for taking the time!
For me it sais Connectign to prana, Connected to prana, Error talking to prana. and I see on the Blueman icon that it is making a connection and after a while is disconnecting. However I couldn't figure out why it is not working. Maybe is something specific to the HW in the prana, mine is 200C premium with wifi. I tried commenting all the CO2 and VOC lines thinking this could be it but ...no go.
Bluepy 1.3.0 is installed in Python 3.9 library....
For the moment I gave up trying as I tested all possibilities. Virtual Machine, WLS2, Docker under Ubuntu 20.04, Docker under Debian 11, Supervised under Debian 11.

I somehow found a way to make the other integration, suggested by you, stable. I'm restating the Prana_rc server regularly with Cronetab and I replaced the command winter mode switch with speedInUp = "BEEF040E" and now I can have automations with different speeds for in and out.

from ha-prana.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.