normen / homebridge-433-arduino

A homebridge plugin to control 433MHz switches using an Arduino as transceiver
25 stars 11 forks source link

All switches triggered in Homebridge upon receiving one trigger from RC #30

Open superhenne opened 1 year ago

superhenne commented 1 year ago

Hi,

thanks for that nice integration.

First of all, the code is working fine to control 5 different elro sockets from Homebrige UI and Homekit.

But there is an issue when receiving a signal from the elro remote control: No matter which "on" or "off" button is pressed (unitcode), homebridge always set on ALL switches to on, or all to off. The log clearly reports the correct systemcode and unitcode, which correspond to the configured switches.

I am using ESPILight.

this is my switches config:

"name": "Arduino RC Switch Platform",
            "use_espilight": true,
            "host": "arduino-433",
            "input_output_timeout": 200,
            "switches": [
                {
                    "name": "A Licht",
                    "type": "elro_800_switch",
                    "message": {
                        "systemcode": 24,
                        "unitcode": 1
                    }
                },
                {
                    "name": "B Licht",
                    "type": "elro_800_switch",
                    "message": {
                        "systemcode": 24,
                        "unitcode": 2
                    }
                },
                {
                    "name": "C Licht",
                    "type": "elro_800_switch",
                    "message": {
                        "systemcode": 24,
                        "unitcode": 4
                    }
                },
                {
                    "name": "D Licht",
                    "type": "elro_800_switch",
                    "message": {
                        "systemcode": 24,
                        "unitcode": 8
                    }
                },
                {
                    "name": "Test A",
                    "type": "elro_800_switch",
                    "message": {
                        "systemcode": 26,
                        "unitcode": 1
                    }
                },
                {
                    "name": "Virtual B",
                    "type": "elro_800_switch",
                    "message": {
                        "systemcode": 26,
                        "unitcode": 2
                    }
                },
                {
                    "name": "Virtual C",
                    "type": "elro_800_switch",
                    "message": {
                        "systemcode": 26,
                        "unitcode": 4
                    }
                }
            ],
            "platform": "ArduinoRCSwitch"

and an example from the log:

[06/01/2023, 22:31:38] [Arduino RC Switch Platform] {"type":"elro_800_contact","message":{"systemcode":24,"unitcode":8,"state":"opened"}}
[06/01/2023, 22:31:38] [Arduino RC Switch Platform] {"type":"ehome","message":{"id":4,"state":"off"}}
[06/01/2023, 22:31:38] [Arduino RC Switch Platform] {"type":"daycom","message":{"id":21,"systemcode":337,"unit":1,"state":"on"}}
[06/01/2023, 22:31:38] [Arduino RC Switch Platform] {"type":"logilink_switch","message":{"systemcode":344401,"unitcode":1,"state":"on"}}
[06/01/2023, 22:31:38] [Arduino RC Switch Platform] {"type":"kerui_D026","message":{"unitcode":567338,"state":"closed"}}
[06/01/2023, 22:31:38] [Arduino RC Switch Platform] {"type":"eurodomest_switch","message":{"id":481237,"all":1,"state":"off"}}
[06/01/2023, 22:31:38] [Arduino RC Switch Platform] Received on code for A Licht
[06/01/2023, 22:31:38] [Arduino RC Switch Platform] Received on code for B Licht
[06/01/2023, 22:31:38] [Arduino RC Switch Platform] Received on code for C Licht
[06/01/2023, 22:31:38] [Arduino RC Switch Platform] Received on code for D Licht
[06/01/2023, 22:31:38] [Arduino RC Switch Platform] Received on code for Test A
[06/01/2023, 22:31:38] [Arduino RC Switch Platform] Received on code for Virtual B
[06/01/2023, 22:31:38] [Arduino RC Switch Platform] Received on code for Virtual C

What is wrong here?

thanks, Hendrik

MuktinCobus commented 1 year ago

I have exactly the same problem :) what can we do? By the way, thanks for sharing your code with us!

normen commented 1 year ago

hm, no idea, did you try the other apparently compatible types? Otherwise, if it says it receives the switch signal it probably does receive it, maybe the remote is sending some other signals as well?

MuktinCobus commented 1 year ago

Hey normen, thanks for your reply. I tried all other apparently compatible types. Same behavior. It always switches state for all the other Switches (all have different unitcode's and the console outputs only receiving the correct unit code.). Any other ideas?

It works when I don't use Pilight mode but then some other Switch signals (other brands) aren't recognised. :(

normen commented 1 year ago

Hm, idk, did you check with the pilight project if theres any similar issues for other people? I can't really help as my switches work both with pilight and rcswitch..

MuktinCobus commented 1 year ago

Ok thank you, just one last question, the difference between the working (all are working only switching in the interface is not working properly on remote switch) and the not working switches is:

Working: Different id in message and same unitcode. {"name": "light1","type": "arctech_switch", "message": { "id": 66536448, "unit": 2}}, {"name": "light2","type": "arctech_switch", "message": { "id": 24222720, "unit": 2}},

Not working: Same id different unitcode. {"name": "light3", "type": "elro_800_switch", "message": {"systemcode": 18, "unitcode": 8}}, {"name": "light4", "type": "elro_800_switch", "message": {"systemcode": 18, "unitcode": 2}},

Could it be that all switches with the same id geht the same switche state when on is recived from the remote?

Thanks for your help, I really appreciate that.

normen commented 1 year ago

Okay, thanks, that might be helpful when digging into this.

superhenne commented 1 year ago

i want to add something, don't know if that helps here: For me controlling the elro switches from homebridge UI only works when using the elro config: { "name": "A Licht", "id": "241", "type": "elro_800_switch", "message": { "systemcode": 24, "unitcode": 1 } },

I tried both alternate models (kerui_D026, ev1527; with one unitcode instead of system+unitcode). These models are shown in the log when pressing a button on the elro remote. With this config the switches do not work when pressing the button in homebridge ui.

But the initial issue remains - all buttons are changing state when receiving a remote control signal.

smj135 commented 1 year ago

I've run into this exact issue too, trying to resolve it in diffrent ways, but so far noting works. Still getting 'false' triggers on multiple buttons that have the same "type", but different "unitcode" - when using devices that send out "id" and "unit" it's not an issue, but alot of my buttons and sensors doesn't send messages out like that, unfortunably

Thanks to normen for creating this plugin, great work!