KLF200 raspbian Bullseye

Bonsoir,

J’ai activé ma passerelle KLF200 avec le wifi, j’ai trouvé les modules (2 velux avec volets) et je les ai renommés sans Espace.

J’ai ensuite une installation raspberry Pi. J’ai démarré avec une version Rasbian Bullseye, mais j’ai vu que trop tard que ce n’était pas encore totalement validé…
Comme les plugins que j’utilise pour l’instant n’ont pas de soucis avec cette version, je suis resté comme celà.

Voila mes versions de plugins :

* [ Core et plugins](http://192.168.0.12/index.php?v=d&p=update#coreplugin)
* [ Informations](http://192.168.0.12/index.php?v=d&p=update#log)

||||||||
| --- | --- | --- | --- | --- | --- | --- |
|OK|default / core : jeedom V4-stable|4.2.21|4.2.21|2022-08-18 23:04:10|||

OK market / plugin : klf200 stable 2022-05-26 01:01:24 2022-05-26 01:01:24 2022-09-21 11:15:48 Ne pas mettre à jour

OK market / plugin : legrandeco stable 2021-12-28 01:08:09 2021-12-28 01:08:09 2022-08-06 19:19:14 Ne pas mettre à jour

OK market / plugin : reolink stable 2022-07-27 14:45:55 2022-07-27 14:45:55 2022-08-25 00:01:14 Ne pas mettre à jour

OK market / plugin : script stable 2020-06-24 09:18:07 2020-06-24 09:18:07 2022-08-01 21:14:57 Ne pas mettre à jour

OK market / plugin : virtual stable 2022-01-31 01:16:25 2022-01-31 01:16:25 2022-08-01 21:13:33 Ne pas mettre à jour

OK market / plugin : weather stable 2020-11-12 01:15:44 2020-11-12 01:15:44 2022-08-01 21:14:36 Ne pas mettre à jour

Par contre avec le plugin klf200, j’ai quelques soucis :

Pour les dépendances, je pense que c’est bon, malgré les Warning :

0000|********************************************************
0001|21/09/2022 13:22:45 Installation des dépendances
0002|********************************************************
0003|Hit:1 http://raspbian.raspberrypi.org/raspbian bullseye InRelease
0004|Hit:2 http://archive.raspberrypi.org/debian bullseye InRelease
0005|Reading package lists...
0006|Installation des dépendances apt
0007|Reading package lists...
0008|Building dependency tree...
0009|Reading state information...
0010|python3-venv is already the newest version (3.9.2-3).
0011|0 upgraded, 0 newly installed, 0 to remove and 65 not upgraded.
0012|WARNING: The directory '/var/www/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
0013|Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
0014|Requirement already satisfied: pyvlx in /var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages (0.2.20)
0015|Requirement already satisfied: PyYAML in /var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages (from pyvlx) (5.4.1)
0016|WARNING: The directory '/var/www/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
0017|Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
0018|Requirement already satisfied: aiohttp==3.7.4.post0 in /var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages (3.7.4.post0)
0019|Requirement already satisfied: yarl<2.0,>=1.0 in /var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages (from aiohttp==3.7.4.post0) (1.8.1)
0020|Requirement already satisfied: multidict<7.0,>=4.5 in /var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages (from aiohttp==3.7.4.post0) (6.0.2)
0021|Requirement already satisfied: attrs>=17.3.0 in /var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages (from aiohttp==3.7.4.post0) (22.1.0)
0022|Requirement already satisfied: async-timeout<4.0,>=3.0 in /var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages (from aiohttp==3.7.4.post0) (3.0.1)
0023|Requirement already satisfied: chardet<5.0,>=2.0 in /var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages (from aiohttp==3.7.4.post0) (4.0.0)
0024|Requirement already satisfied: typing-extensions>=3.6.5 in /var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages (from aiohttp==3.7.4.post0) (4.3.0)
0025|Requirement already satisfied: idna>=2.0 in /var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages (from yarl<2.0,>=1.0->aiohttp==3.7.4.post0) (3.4)
0026|WARNING: The directory '/var/www/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
0027|Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
0028|Collecting PyYAML==5.4.1
0029|Downloading https://www.piwheels.org/simple/pyyaml/PyYAML-5.4.1-cp39-cp39-linux_armv7l.whl (45 kB)
0030|Installing collected packages: PyYAML
0031|Attempting uninstall: PyYAML
0032|Found existing installation: PyYAML 5.4.1
0033|Uninstalling PyYAML-5.4.1:
0034|Successfully uninstalled PyYAML-5.4.1
0035|Successfully installed PyYAML-5.4.1
0036|WARNING: The directory '/var/www/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
0037|Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
0038|Requirement already satisfied: bottle in /var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages (0.12.23)
0039|********************************************************
0040|21/09/2022 13:23:44 Installation terminée
0041|********************************************************

Lancement du Daemon

0000|[2022-09-21 21:51:26]ERROR : KLF200 has been restarted after found not responding
0001|application protocol failed to receive SSL data
0002|protocol: 
0003|transport: <_SelectorSocketTransport fd=6 read=polling write=>
0004|Traceback (most recent call last):
0005|File "/usr/lib/python3.9/asyncio/sslproto.py", line 545, in data_received
0006|self._app_protocol.data_received(chunk)
0007|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/connection.py", line 52, in data_received
0008|frame = frame_from_raw(raw)
0009|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/api/frame_creation.py", line 53, in frame_from_raw
0010|frame.from_payload(payload)
0011|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/api/frames/frame_get_all_nodes_information.py", line 145, in from_payload
0012|self.node_type = NodeTypeWithSubtype(payload[69] * 256 + payload[70])
0013|File "/usr/lib/python3.9/enum.py", line 360, in __call__
0014|return cls.__new__(cls, value)
0015|File "/usr/lib/python3.9/enum.py", line 677, in __new__
0016|raise ve_exc
0017|ValueError: 1409 is not a valid NodeTypeWithSubtype
0018|Traceback (most recent call last):
0019|File "/var/www/html/plugins/klf200/resources/klf200d.py", line 269, in 
0020|LOOP.run_until_complete(init_pyvlx_connection(LOOP))
0021|File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
0022|return future.result()
0023|File "/var/www/html/plugins/klf200/resources/klf200d.py", line 22, in init_pyvlx_connection
0024|await pyvlx.load_nodes()
0025|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/pyvlx.py", line 78, in load_nodes
0026|await self.nodes.load(node_id)
0027|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/nodes.py", line 69, in load
0028|await self._load_all_nodes()
0029|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/nodes.py", line 87, in _load_all_nodes
0030|raise PyVLXException("Unable to retrieve node information")
0031|pyvlx.exception.PyVLXException:

Si je change le mdp dans le plugin j’ai cela comme réponse :

0000|[2022-09-21 21:54:42][ERROR] : KLF200 has been restarted after found not responding
0001|[2022-09-21 21:54:44][ERROR] : KLF200 has been restarted after found not responding
0002|Failed to authenticate with password "Gc****"
0003|Traceback (most recent call last):
0004|File "/var/www/html/plugins/klf200/resources/klf200d.py", line 269, in <module>
0005|LOOP.run_until_complete(init_pyvlx_connection(LOOP))
0006|File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
0007|return future.result()
0008|File "/var/www/html/plugins/klf200/resources/klf200d.py", line 22, in init_pyvlx_connection
0009|await pyvlx.load_nodes()
0010|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/pyvlx.py", line 78, in load_nodes
0011|await self.nodes.load(node_id)
0012|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/nodes.py", line 69, in load
0013|await self._load_all_nodes()
0014|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/nodes.py", line 85, in _load_all_nodes
0015|await get_all_nodes_information.do_api_call()
0016|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/api/api_event.py", line 21, in do_api_call
0017|await self.send_frame()
0018|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/api/api_event.py", line 33, in send_frame
0019|await self.pyvlx.send_frame(self.request_frame())
0020|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/pyvlx.py", line 66, in send_frame
0021|await self.connect()
0022|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/pyvlx.py", line 44, in connect
0023|await self.klf200.password_enter(password=self.config.password)
0024|File "/var/www/html/plugins/klf200/resources/venv/lib/python3.9/site-packages/pyvlx/klf200gateway.py", line 126, in password_enter
0025|raise PyVLXException("Login to KLF 200 failed, check credentials")
0026|pyvlx.exception.PyVLXException: <PyVLXException description="Login to KLF 200 failed, check credentials" />
0027|[2022-09-21 21:55:44][ERROR] : KLF200 has been restarted after found not responding

Je remet le bon mot de passe et j’obtient a nouveau l’alerte précédente.

Qd je fais un tcpdump sur le raspberry je vois des échanges vers le klf200 qui finissent par un Reset TCP.

Je ne sais pas débugué plus avec l’api Velux pour comprendre le probleme.

Merci d’avance

1 « J'aime »

En plongeant dans le code python j’ai compris le fonctionnement et j’ai commencé a voir que ca plantait au listing des Devices.
J’ai comparé l’API et le const.py de la lib pyvlx et j’ai vu qu’il manquait des truc (HEAT_PUMP 0x0580).

Par contre je ne fais pas le lien avec la valeur 1491 dans le log

ValueError: 1409 is not a valid NodeTypeWithSubtype

J’ai donc retirer par le wifi ma PAC Atlantic du KLF200 qui s’etait rajouté tout seul dans la phase de scan initiale.

La le daemon du plugin jedom a pu se lancer et je peux maintenant piloter mes velux (volet et ouverture).

Si tu as réussi à trouver ce point, tu te sentirais capable de rajouter le support du HEAT_PUMP dans pyvlx ? Si oui, hésite pas à leur envoyer un PR, une fois dans la lib je pourrais regarder pour l’intégrer à mon tour dans le plugin

La lib pyVLX est sur le github GitHub - Julius2342/pyvlx: PyVLX - controling VELUX windows with Python via KLF 200 ??

je peux tester des trucs en touchant le code sur le dépot local de mon Raspberry ?
Je veux bien toucher et corriger d’ailleurs des coquilles comme LOUVRE_BLINT 18 à la place de LOUVER_BLIND 18

Sinon ici je trouve pas trop d’info sur ma PAC Atlantic

Comment faire pour essayer de la prendre en compte ??

Bon ben j’ai essayé et ça marche simplement en rajoutant 2 lignes dans le const.py :

class NodeTypeWithSubtype(Enum):
    """Enum class for node type plus sub type combined values."""
    # pylint: disable=invalid-name
    NO_TYPE = 0
...
    EXTERIOR_HEATING = 0x0540
    HEATING_PUMP = 0x0580
    HEATING_PUMP_PAC = 0x0581
    SWINGING_SHUTTERS = 0x0600

J’ai compris que 1409 = 0x16x256 + 5x256 + 8x16 +1 donc écrit en hexa 0x0581
ça a marche donc avec la deuxième ligne.

Par contre il s’arrête la dans la prise en charge… au moins ça démarre.

Comment avoir des log debug de l’appli Web Python qui écoute sur le 9321 pour avoir les échanges du démarrage pour comprendre l’initialisation et la reconnaissance du type d’object qui pourra être géré par la lib pyvlx ??

Ce sujet a été automatiquement fermé après 4 jours. Aucune réponse n’est permise dorénavant.