dirigera icon indicating copy to clipboard operation
dirigera copied to clipboard

Only one event on remote is send

Open sschnake opened this issue 2 years ago • 14 comments

When subscribing to the events I do only get one event on pressing the remote firmware_version='1.0.47', hardware_version='1', model='RODRET Dimmer', manufacturer='IKEA of Sweden', Need to reboot the hub to get the event only one time again. I do only have remotes on the hub as I wanted to use the Ikea devices to control other home devices. Current plan is to get all the remotes to mqtt.

sschnake avatar Oct 23 '23 20:10 sschnake

This sounds strange, but from the description I can't really think of a fix. Can you share your code?

Leggin avatar Oct 26 '23 18:10 Leggin

Hi, I also have question about remotes. Is there a way to listen to events on remote in order to create own automations? I can list my controllers using get_controllers but I'm not receiving any messages from it. I have it currently linked to a bulb and I only see events from the bulb:

def on_message(ws: Any, message: str):
    message_dict = json.loads(message)
    data = message_dict["data"]
    print(data)

def on_error(ws: Any, message: str):
    print(message)

hub.create_event_listener(
    on_message=on_message, on_error=on_error
)

Example:

{'id': 'a83fc40d-3e29-4b63-b6c2-f61e5ccbbffa_1', 'type': 'light', 'deviceType': 'light', 'createdAt': '2024-02-20T20:19:10.000Z', 'isReachable': True, 'lastSeen': '2024-02-21T02:02:21.000Z', 'attributes': {'isOn': True}, 'remoteLinks': ['ce33f4cc-904b-4520-9c38-135352b576c6_1', 'e2e1d184-ad4f-4b53-ba05-f47cda3fd8b8_1']}

ce33f3cc is my Styrbar controller I'm currently testing.

bwiklak avatar Feb 21 '24 01:02 bwiklak

@bwiklak I actually think the remotes don't publish their events, sadly. My workaround is to create "fake" scenes that don't do anything (in the IKEA app) and then tie them to the controllers (at least that works for the action button). Then I just wait until that scene gets triggered and check if the trigger was my button. It is a bit annoying, but it works well enough.

TomyMMX avatar Feb 24 '24 09:02 TomyMMX

Right, thanks for answer, I already bought action buttons so this should work.

bwiklak avatar Feb 24 '24 11:02 bwiklak

@TomyMMX that's a cool work around! With the normal remote control it does not seem to work sadly so I can't test it. But I thinks this would be a great addition to the readme for others to use in this scenario, would you be interested in opening a PR with these infos?

Leggin avatar Feb 25 '24 10:02 Leggin

@bwiklak I actually think the remotes don't publish their events, sadly. My workaround is to create "fake" scenes that don't do anything (in the IKEA app) and then tie them to the controllers (at least that works for the action button). Then I just wait until that scene gets triggered and check if the trigger was my button. It is a bit annoying, but it works well enough.

How you can create a fake scenes? I can't create empty scene as provided in screenshot: IMG_948D7646D9B3-1 What's your workaround?

@Leggin How you are exploring dirigiera api? I didn't see anything about single, double and long press event :/ It will be perfect to get this actions :P

slajob avatar Mar 27 '24 20:03 slajob

@slajob yeah, scenes can't be empty. I have a light bulb that I only use when I go to sleep in the evening, so that "fake" scene just turns that off. Which is fine as it is always off when I use my action button. Not ideal, I know, but works for me.

TomyMMX avatar Mar 28 '24 08:03 TomyMMX

Okey, maybe burned out old tradfri light could be perfect for that

slajob avatar Mar 28 '24 14:03 slajob

To summarize:

  • The raw button clicks don't result in an event
  • Button clicks that are connected to a device or a scene trigger an event for that device/scene

@slajob I found a way to create an empty scene via the api, I could add scene creating functionalities to the library if that helps?

Leggin avatar Apr 03 '24 14:04 Leggin

@Leggin that will be great! Creating empty scenes can resolve that 🥹

slajob avatar Apr 03 '24 14:04 slajob

@slajob the first version for scene manipulation is release, please let me know if you encounter any problems.

Leggin avatar Apr 05 '24 16:04 Leggin

@slajob the first version for scene manipulation is release, please let me know if you encounter any problems.

Thanks! I'll try it and give you some feedback

slajob avatar Apr 06 '24 05:04 slajob

Apologies, slight necro post,

Testing this at the moment with both the STYRBAR and RODRET and unfortunately it only seems to register any actions via one of the buttons.

What I've attempted is looping through the controllers, then an int loop of say, 5 or so, and attempting to create a new scene using this module using that int as the button index, and referencing the int in the scene name too (I used the remote device id, followed by _ and the int, my hopes being I could then check for that ID when the hub event fires)

As mentioned, unfortunately it only connects to the one button on each remote.

I'd link it to a dummy plug for example using the app itself however it's incredibly limited, it'll either just be on or off.

--

Update: Still testing but as others have said seems that it'll only trigger the scene via the main button, so regardless if you have the Styrbar (4 buttons), Somrig (2 buttons), Rodret (2 buttons), you're limited to just the main action button.

In my case I just have the fake scene id match the controller id to then check via a dict for what automations to run. Unfortunate but I guess it's something? Probably better going with NFC tags or something at the moment to trigger things, then handle the devices using this module (which thanks again for maintaining)

vaylvn avatar Sep 03 '24 19:09 vaylvn

Perhaps potential to use fake lights or something?

Link fake light to remote, hopefully the hub then fires events for switch on / off and dim if using controllers that support it?

vaylvn avatar Sep 04 '24 18:09 vaylvn

I don't know of any possibility to add fake devices.

Leggin avatar Oct 18 '24 11:10 Leggin