Bonjour,
Ayant le pb du klf qui restart depuis hier, j’ai fait ce que vous avez proposé avec un script python avec du debug et en le simplifiant au maximum avec une seule instruction open ou close suivant la position du volet.
Le script python:
"""Just a demo of the new PyVLX module."""
import asyncio
import logging
from pyvlx import PYVLXLOG, PyVLX, Position
async def main(loop):
"""Log packets from Bus."""
# Setting debug
PYVLXLOG.setLevel(logging.DEBUG)
stream_handler = logging.StreamHandler()
stream_handler.setLevel(logging.DEBUG)
PYVLXLOG.addHandler(stream_handler)
"""Demonstrate functionality of PyVLX."""
# Alternative:
pyvlx = PyVLX(host="IPmonKLF", password="monPassWifi", loop=loop)
# Changing position of windows:
await pyvlx.load_nodes()
# await pyvlx.nodes['VoletSDE'].open()
await pyvlx.nodes['VoletSDE'].close()
# await asyncio.sleep(20)
await pyvlx.disconnect()
if __name__ == '__main__':
# pylint: disable=invalid-name
LOOP = asyncio.get_event_loop()
LOOP.run_until_complete(main(LOOP))
# LOOP.run_forever()
LOOP.close()
La trace de l’exécution:
Connecting to KLF 200.
SEND: <FramePasswordEnterRequest password="vC****"/>
REC: <FramePasswordEnterConfirmation status="PasswordEnterConfirmationStatus.SUCCESSFUL"/>
SEND: <FrameGetVersionRequest/>
REC: <FrameGetVersionConfirmation software_version="0.2.0.0.71.0" hardware_version="6" product="KLF 200"/>
SEND: <FrameGetProtocolVersionRequest/>
REC: <FrameGetProtocolVersionConfirmation version="3.14"/>
Connected to: <DtoVersion softwareversion="0.2.0.0.71.0" hardwareversion="6" productgroup="14" producttype="3"/>, <DtoProtocolVersion majorversion="3" minorversion="14"/>
SEND: <FrameGetStateRequest/>
REC: <FrameGetStateConfirmation gateway_state="GatewayState.GATEWAY_MODE_WITH_ACTUATORS" gateway_sub_state="GatewaySubState.IDLE"/>
SEND: <FrameSetUTCRequest time="2021-12-01 09:21:04"/>
REC: <FrameSetUTCConfirmation/>
SEND: <FrameGetNetworkSetupRequest/>
REC: <FrameGetNetworkSetupConfirmation ipaddress="192.168.1.100" netmask="255.255.255.0" gateway="192.168.1.100" dhcp="DHCPParameter.DISABLE"/>
SEND: <FrameHouseStatusMonitorEnableRequest/>
REC: <FrameHouseStatusMonitorEnableConfirmation/>
SEND: <FrameGetAllNodesInformationRequest/>
REC: <FrameGetAllNodesInformationConfirmation status="AllNodesInformationStatus.OK" number_of_nodes="1"/>
REC: <FrameGetAllNodesInformationNotification node_id="0" order="0" placement="0" name="VoletSDE" velocity="Velocity.DEFAULT" node_type="NodeTypeWithSubtype.ROLLER_SHUTTER" product_group="1" product_type="5" node_variation="NodeVariation.NOT_SET" power_mode="1" build_number="9" serial_number="53:2a:5d:32:14:1b:14:37" state="5" current_position="0x0000" target="0x0000" current_position_fp1="0xF7FF" current_position_fp2="0xF7FF" current_position_fp3="0xF7FF" current_position_fp4="0xF7FF" remaining_time="0" time="2021-12-01 09:21:04" alias_array=""/>
NodeUpdater process frame: <FrameGetAllNodesInformationNotification node_id="0" order="0" placement="0" name="VoletSDE" velocity="Velocity.DEFAULT" node_type="NodeTypeWithSubtype.ROLLER_SHUTTER" product_group="1" product_type="5" node_variation="NodeVariation.NOT_SET" power_mode="1" build_number="9" serial_number="53:2a:5d:32:14:1b:14:37" state="5" current_position="0x0000" target="0x0000" current_position_fp1="0xF7FF" current_position_fp2="0xF7FF" current_position_fp3="0xF7FF" current_position_fp4="0xF7FF" remaining_time="0" time="2021-12-01 09:21:04" alias_array=""/>
REC: <FrameGetAllNodesInformationFinishedNotification/>
SEND: <FrameCommandSendRequest node_ids="[0]" parameter="100 %" functional_parameter="fp1: 0 %, fp2: 0 %, fp3: 0 %, fp4: 0 %, fp5: 0 %, fp6: 0 %, fp7: 0 %, fp8: 0 %, fp9: 0 %, fp10: 0 %, fp11: 0 %, fp12: 0 %, fp13: 0 %, fp14: 0 %, fp15: 0 %, fp16: 0 %, " session_id="1" originator="Originator.USER"/>
REC: <FrameCommandSendConfirmation session_id="1" status="CommandSendConfirmationStatus.ACCEPTED"/>
REC: <FrameNodeStatePositionChangedNotification node_id="0" state="2" current_position="0x0000" target="0xC800" current_position_fp1="0xF7FF" current_position_fp2="0xF7FF" current_position_fp3="0xF7FF" current_position_fp4="0xF7FF" remaining_time="0" time="1995-10-03 10:18:56"/>
NodeUpdater process frame: <FrameNodeStatePositionChangedNotification node_id="0" state="2" current_position="0x0000" target="0xC800" current_position_fp1="0xF7FF" current_position_fp2="0xF7FF" current_position_fp3="0xF7FF" current_position_fp4="0xF7FF" remaining_time="0" time="1995-10-03 10:18:56"/>
REC: <FrameCommandRunStatusNotification session_id="1" status_id="1" index_id="0" node_parameter="0" parameter_value="0"/>
REC: <FrameCommandRemainingTimeNotification session_id="1" index_id="0" node_parameter="0" seconds="33"/>
REC: <FrameNodeStatePositionChangedNotification node_id="0" state="4" current_position="0x0000" target="0xC800" current_position_fp1="0xF7FF" current_position_fp2="0xF7FF" current_position_fp3="0xF7FF" current_position_fp4="0xF7FF" remaining_time="33" time="1995-10-03 10:18:56"/>
NodeUpdater process frame: <FrameNodeStatePositionChangedNotification node_id="0" state="4" current_position="0x0000" target="0xC800" current_position_fp1="0xF7FF" current_position_fp2="0xF7FF" current_position_fp3="0xF7FF" current_position_fp4="0xF7FF" remaining_time="33" time="1995-10-03 10:18:56"/>
REC: <FrameCommandRunStatusNotification session_id="1" status_id="1" index_id="0" node_parameter="0" parameter_value="51200"/>
REC: <FrameSessionFinishedNotification session_id="1"/>
SSL error in data received
protocol: <asyncio.sslproto.SSLProtocol object at 0x7fb4823ba8>
transport: <_SelectorSocketTransport fd=7 read=polling write=<idle, bufsize=0>>
Traceback (most recent call last):
File "/usr/lib/python3.7/asyncio/sslproto.py", line 526, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File "/usr/lib/python3.7/asyncio/sslproto.py", line 207, in feed_ssldata
self._sslobj.unwrap()
File "/usr/lib/python3.7/ssl.py", line 767, in unwrap
return self._sslobj.shutdown()
ssl.SSLError: [SSL: KRB5_S_INIT] application data after close notify (_ssl.c:2609)
Le firmware du klf est le dernier proposé sur le site de Velux.
Le volet s’est bien fermé mais:
- Il y a déjà des erreurs SSL à la fin. Il faut decommenter le sleep du script pour qu’elles disparaissent.
- Malgré la mise à l’heure du KLF au début, dans l’exécution il y a des dates bizarres
time="1995-10-03 10:18:56"/hier soir c’était en 2054
Coté plugin, le volet est toujours en position ouvert à 100%. Il faut redémarrer le daemon pour corriger.
Pour les actions, je pense que je vais m’orienter temporairement vers des scripts python du même acabit que celui au dessus.
Pour le moment, je n’ai qu’un seul volet à piloter.