alengwenus / pypck

Asynchronous LCN-PCK library written in Python
MIT License
10 stars 5 forks source link

Add SKH message to PckParser #23

Closed maximilianriemensberger closed 3 years ago

maximilianriemensberger commented 4 years ago

Keys can be programmed to issue a SKH (Sende Kommando Host) message including two arbitrary programmed bytes and send the command to PCHK. The bytes can for example be used to identify the key table, the key number and the action (hit make break). This enables LCN key presses to control any arbitrary software functionality that is wired up to PCHK and listens for particular key presses.

maximilianriemensberger commented 3 years ago

@alengwenus I saw your SKH branch. Thanks for taking a stab at this issue.

I'm curios about the number of parameters.

https://github.com/alengwenus/pypck/blob/38b3e16bb2d3a7946db32f35c9646b81198ba8df/pypck/pck_commands.py#L145-L151

I did only know about 2 parameter bytes (as documented in the mygekko handbook) for 0x57 version of the command. Is there another version of the SKH command with more parameters? And are those all statically set in LCN-PRO like for the two parameter version or can some of those contain dynamic content. Dynamic content would be really interesting for some use cases.

alengwenus commented 3 years ago

For key actions LCN-Pro only allows programmming of 2 parameters for the 0x57 command using the "free input" command. However, PCHK accepts 2, 6 or 14 parameters for the telegram. Those parameters are straight translated into the corresponding PCK status message. Btw.: Currently I am thinking about how to integrate the command into HomeAssistant (maybe a binary sensor with all the parameters as attributes). Unfortunately I'm quite busy at the moment. So this might take some time...

maximilianriemensberger commented 3 years ago

Thanks for the info and especially for pointing me at HomeAssistant. I haven't been aware of the project and its LCN integration. Definitely looks very interesting.

alengwenus commented 3 years ago

Implemented in PR #26.