LCN Toggle command bounces

Hi everyone
I’m new with Home Assistant and I managed to integrate all my LCN objects. I have one problem left, and it’s that my toggle commands for a relay bounces 3 times. So when I send the toggle command exp. 1T------ the command arrives 3 times in my LCN bus with the effect, that the relay switches 3 times.
Does anyone have a clue from where the bounces might come?
Thank you for any advice!

Hi @Pattz,
I’ve got a few more questions to track down the problem.
How do you send the command? Is it done using the “Relay” service call?
What’s the time interval between the 3 toggles?
Are you triggering the command from an automation?
Does it work if you send the command using LCN-Pro?

Hi @alengwenus
Thank you very much for your quick replay! I send the command on 3 ways to the relay:

  1. direct service lcn.relays
  2. over an key → lcn.send_key
  3. over a switch defined in the config.yaml (Toggle)
    always the same behavior.
    The command is sent 3 times, with 3 Sek. between the 2nd. and the 3rd. command (Actually it bounces 2 times → in total 3 times sent).
    I don’t know actually whether the bounce is generated by Home Assistant itself or within the way between Home Assistant and the bus (LinHK on a Fritzbox, that’s my interface to the bus, and over RS232).

Do you have an idea how I can figure out where the bounce is generated?

What I see is, that the command arrives 3 times on the bus monitor.

Are you triggering the command from an automation? → Yes, it’s the same within the automation, as I use the same service call lcn.relays.

At the moment I use the workaround, that I send the command ------11 instead of ------1T and so the bounce doesn’t matter (Doesn’t work on the switch → always toggle).

Does it work if you send the command using LCN-Pro? → Yes, and also with LinHK alone, it works like a charm (since 17 years ;-).

Looking forward to hearing from you!

Sounds like your modules do not send any achknowledge commands (or at least they do not arrive at HomeAssistant). In that case the command is sent again two times with a delay of 3 seconds.

That’s strange and I can only guess what’s going on here (also I don’t have much experience with 17 year old modules).

If you send a command to a module from LCN-PRO, leaving the “claim receipt” box checked, do you get readings like “… → LPRO pos.receipt” in the log?

Could you also please put the following code in your configuration.yaml, send a toggle command and post the Home Assistant logs output?

logger:
  default: error
  logs:
    homeassistant.components.lcn: debug
    pypck: debug

Thanks!

Hi @alengwenus

Thank you! You are right, the no acknowledge commands doesn’t come through.

I can see them on the bus within LCN-PRO and also within LinHK, but not on Home Assistant. On the HA Log, I can’t see any acknowledgment.

LCN-PRO Bus Monitor
21:55:11:203 - M004 → M112 Ausg.1: AUS, Rampe: 0.00 Sek
21:55:11:238 ✓ M112 → M004 Pos.Quittung

LinHK

22:00:14.170705 M000127 sonstiges positive Quittung -M000127!
22:00:14.153361 M000004 M000127 Ausgänge Ausgang 1 dimmen auf 100% >M000127!A1DI100000

HA
2021-12-17 22:00:10 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000127!A1DI100000
2021-12-17 22:00:14 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000127!A1DI100000
2021-12-17 22:00:17 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000127!A1DI100000

Does that help?

No idea, why the acknowledgment commands don’t come through…

Do you have an idea?

Thank you!

Hi @Pattz,

so the acknowledgements actually are not received.
At the moment I suspect this LinHK software to cause the problems. In the past I have seen a lot of incompatibilities compared to the official PCHK software. But the fact that it filters acknowledgement commands sounds really strange to me.

However, there is one thing you could check to verify this assumption:
Try to establish a telnet connection to the LinHK on port 4114, log in and send the “>M000127!A1DI100000” command. If there isn’t a response like “-M000127!” then it’s the LinHK software which causes problems. :worried:
You can use the Windows command prompt for that: telnet [host-ip] 4114

Btw.: The fact that it works with the LCN-PRO software could be explained by the fact that a different (encrypted) protocol is used for communication.

However, I’m just guessing…

Hi @alengwenus

Thank you. I made the test within LinHK and the acknowledge arrives… I’m right know in contact with the LinHK developer to check, why the acknowledgment is not forwarded towards Home Assistant.

11:03:09.726835 M000127 sonstiges positive Quittung -M000127!
11:03:09.710493 M000004 M000127 Ausgänge Ausgang 1 dimmen auf 0% >M000127!A1DI000000

Thanks @Pattz,

please keep me informed. I‘m open to implement everything to get you started. But I need an idea what‘s going on there. :confused:

Besides, I had a look into the underlying LCN library HomeAssistant is using. Every message which arrives at the socket (even if it is garbage) should be logged in the output.

Thank you @alengwenus

The behavior is always the same, when I start a command from Home Assistant.

  1. the command
  2. Acknowledgment
  3. Status
    4: Command
  4. Acknowledgment
  5. command
  6. Acknowledgment
19:42:39.090819 M000127 sonstiges positive Quittung -M000127!
19:42:39.082856 M000004 M000127 Ausgänge Ausgang 1 dimmen auf 100% >M000127!A1DI100000
19:42:35.574781 M000127 sonstiges positive Quittung -M000127!
19:42:35.567721 M000004 M000127 Ausgänge Ausgang 1 dimmen auf 100% >M000127!A1DI100000
19:42:32.158828 M000127 Ausgänge Status Ausgang 1 (100%) :M000127A1100
19:42:32.083079 M000127 sonstiges positive Quittung -M000127!
19:42:32.063648 M000004 M000127 Ausgänge Ausgang 1 dimmen auf 100% >M000127!A1DI100000
19:37:23.790789 M000112 sonstiges positive Quittung -M000112!
19:37:23.773876 M000004 M000112 Ausgänge Ausgang 1 dimmen auf 100% >M000112!A1DI100000
19:37:20.282704 M000112 sonstiges positive Quittung -M000112!
19:37:20.268618 M000004 M000112 Ausgänge Ausgang 1 dimmen auf 100% >M000112!A1DI100000
19:37:16.882718 M000112 Ausgänge Status Ausgang 1 (100%) :M000112A1100
19:37:16.778759 M000112 sonstiges positive Quittung -M000112!
19:37:16.763085 M000004 M000112 Ausgänge Ausgang 1 dimmen auf 100% >M000112!A1DI100000

The Acknowledgement (-M000127! or -M000112!) exists and is visible is on bus! I can see it on the LinHK bus Monitor (aswell as on LCN-PRO), but I have no clue why it’s not recognized by Home Assistant.

Is there a way, other than the log, to monitor the LCN bus from Home Assistant? A real-time monitor?

The developer from LinHK confirmed me, that all commands from the bus should be forwarded by LinHK to the clients.

So the big question now is, is the Acknowledgement not forwarded from LinHK, or is it not recognized by Home Assistatnt?

Any further idea, how can I figure that out?

As I mentioned before: Please open a telnet session to the LinHK IP address on port 4114, log in using your credentials and observe the bus.

Please do not use the LinHK to observe the bus!

Are the acknowledges visible in the telnet session?

Could you also please try to safe the telnet session to a file and send me that file as an attachment?

Do other messages from modules appear in the HomeAssistant log? For example status messages which start with :M ?

Hi @alengwenus
I just made the telnet (on Mac now nc) session and monitored the bus.
I can see the acknowledgment messages and the status messages.

immediately after the command:

    1. Acknowledgment
  • Status
    after 3 Sec. (first resend from HA)
  • 2nd. Acknowledgment
    after 3 Sec. (2nd. resend from HA)
  • 3rd Acknowledgment

Here the traffic on the LinHK-Bus bus: (telnet)
-M000112!
:M000112A1000
-M000112!
-M000112!

-M000112!
:M000112A1100
-M000112!
-M000112!

That’s what I see when I conect over telnet.

No other Status Messages in the Home Assistant Log!

Only the commands that are sent and the temperature requests (probably from LinHK).
Log:
2021-12-18 22:33:36 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000112!A1DI100000
2021-12-18 22:33:37 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000112!A1DI100000
2021-12-18 22:33:38 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000112!A1DI100000
2021-12-18 22:33:38 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000112!A1DI000000
2021-12-18 22:33:42 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000112!A1DI000000
2021-12-18 22:33:45 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000112!A1DI000000
2021-12-18 22:33:47 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000012.MWV
2021-12-18 22:33:47 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000021.MWV
2021-12-18 22:33:47 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000023.MWV
2021-12-18 22:33:47 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000126.MWV
2021-12-18 22:33:47 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000129.MWV
2021-12-18 22:33:47 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000221.MWV
2021-12-18 22:33:47 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000222.MWV
2021-12-18 22:33:47 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000223.MWV
2021-12-18 22:33:47 DEBUG (MainThread) [pypck.connection] to d8b6aa958bec1bc44462cbcd990c71e3: >M000224.MWV

I dont know how to send the file… here a part of the telnet session: Is it enough?


The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit Use zsh as the default shell on your Mac - Apple Support.
Pats-MBP:~ patlauber$ nc 192.168.xxx.xxx 4114
LCN-PCK/IP 1.0
Username:
xxxxxxx
Password:
xxxxxxx
OK
:M000005Rx001
:M000023Rx000
:M000013Rx008
:M000013Rx008
%M000023.S265535
%M000221.01270
%M000223.01243
%M000224.01221
%M000021.01193
%M000129.01262
%M000225.01233
%M000012.01201
:M000012Rx186
:M000012Rx186
:M000005Rx001
:M000123A1078
:M000123A1000
%M000126.01241
%M000221.01270
%M000223.01243
%M000224.01220
%M000012.01201
%M000021.01194
%M000129.01262
:M000005Rx001
:M000023Rx000
:M000013Rx008
:M000013Rx008
-M000112!
:M000112A1100
-M000112!
:M000013Rx008
-M000112!
:M000013Rx008
%M000223.01243
%M000012.01200
%M000221.01270
%M000225.01233
%M000023.01220
%M000129.01262
-M000112!
-M000112!
:M000112A1000
-M000112!
:M000112A1100
-M000112!
:M000112A1000
:M000113Rx226
-M000112!
:M000112A1100
:M000013Rx008
-M000112!
:M000112A1000
-M000112!
:M000112A1100
-M000112!
-M000112!
%M000126.01241
%M000021.01194
%M000221.01270
%M000223.01243
%M000224.01219
%M000225.01233
%M000129.01262
%M000012.01200
-M000112!
:M000012Rx186
-M000112!
:M000112A1000
-M000112!
:M000112A1100
-M000112!
:M000112A1000
:M000012Rx186
-M000112!
:M000112A1100
-M000112!
:M000112A1000
-M000112!
:M000112A1100
-M000112!
:M000012Rx186
-M000112!
:M000005Rx001
%M000023.01220
%M000126.01241
%M000221.01270
%M000224.01219
%M000012.01201
%M000223.01243
%M000129.01262
%M000225.01233
%M000021.01194
-M000112!
-M000112!
-M000112!
:M000005Rx001
:M000023Rx000
:M000013Rx008
:M000013Rx008
%M000126.01241
%M000221.01270
%M000223.01243
%M000224.01219
%M000225.01233
%M000012.01201
%M000129.01262
%M000021.01194
:M000013Rx008
-M000112!
-M000112!
:M000012Rx186
:M000005Rx001
:M000113Rx234
%M000126.01241
%M000221.01270
%M000222.01233
%M000223.01244
%M000224.01219
%M000129.01262
%M000012.01200
%M000021.01194
:M000005Rx001
:M000023Rx000
:M000013Rx008
:M000013Rx008
:M000013Rx008
%M000126.01241
%M000221.01270
%M000223.01244
%M000224.01219
%M000012.01200
%M000021.01194
%M000129.01262
:M000013Rx008

@alengwenus Thank you very much for your solution!

You were right, the problem was caused by a Special-character (ü and .) in the name of two of my LCN-Bus Modules!

That was the reason, that the LCN-Integration didn’t start correctly and therefore didn’t receive the acknowledgement, what caused the “bouncing” or like I know now, the 2 resends, after 3 and after 6 Sec.

I changed the names, and now it works like it should!

Thank you very much!!! That’s really important for me!

In conclusion the main problem is an incompatibility of the used inofficial coupling software (“LinHK”) with the LCN standard.
The problem described here does not occur with the official solutions (LCN-PCHK, LCN-PKE/VISU) provided by Issendorff.

If the LinHK software is used in conjunction with the HomeAssisstant LCN integration and you encounter the problems described here, ensure that you use module (hardware) names which contain only ASCII characters!