Help with emulated roku, device not selectable

update: when I activate the event in home assistant the trigger works and turn of the light, but not when I press my harmony remote key, hmmm

It might not read the code and only activate the lamps, so maybe something in the code needs to be changed or added?

You’ll have to post what you tried in your automation. Also, please make sure you format the text, you did not in the last post. Unformatted code is impossible to follow. Please see the FAQ to learn how to format code. FAQ item 21.

1 Like

Below is the formatted text, when I press up on the emulated roku I want hue lights 1,2,3 to turn of, what is missing in the code below?

alias: röd - lampa av
description: ""
trigger:
  - platform: event
    event_type: ""
    event_data:
      event_type: roku_command
      data:
        source_name: Home Assistant
        type: keypress
        key: Up
      origin: LOCAL
      time_fired: "2023-09-28T06:41:01.059712+00:00"
      context:
        id: 01HBD89X43P2J4XAP5T6DDHDAC
        parent_id: null
        user_id: null
condition: []
action:
  - type: turn_off
    device_id: c7da55494a9e9cf9e598a00e5f73857a
    entity_id: light.hue_white_lamp_1
    domain: light
  - type: turn_off
    device_id: a7177fa0c385d46b027c639240cdf995
    entity_id: light.hue_white_lamp_2
    domain: light
  - type: turn_off
    device_id: fdb6283d03be565fdddd5a0a948da729
    entity_id: light.hue_white_lamp_3
    domain: light
mode: single

bumping this topic

When you reply to people, reply to the message not the thread. Otherwise people do not get a notification.


alias: röd - lampa av
description: ""
trigger:
  - platform: event
    event_type: roku_command
    event_data:
      source_name: Home Assistant
      type: keypress
      key: Up
condition: []
action:
  - type: turn_off
    device_id: c7da55494a9e9cf9e598a00e5f73857a
    entity_id: light.hue_white_lamp_1
    domain: light
  - type: turn_off
    device_id: a7177fa0c385d46b027c639240cdf995
    entity_id: light.hue_white_lamp_2
    domain: light
  - type: turn_off
    device_id: fdb6283d03be565fdddd5a0a948da729
    entity_id: light.hue_white_lamp_3
    domain: light
mode: single

I see you posted my code again, did you change something?

see your code

versus

1 Like

I have a related issue I think.

I’ve read all the documentation and couldn’t see anything about how to trigger the automation. Came across this thread that explains how to start listening in devtools, only the roku_command is not one of my available things to listen to?

I’ve installed the integration and it shows up as a device in HA and in Harmony. I’ve configured the remote to send the command, but I have zero idea how to get HA to tell me it’s heard that command.

No, that’s not how it works. You can type any word into listen and it will present those events if they come through the event stream. Just literally type roku_command.

I did try that just in case, with no success. Will try again.

You have to type it in the listen field. Not the fire event field. Then click the start listening button.

Thanks Petro,

All working :+1:.

I’m still having a little weirdness (3 separately mapped buttons to stop/play/pause are all only being seen by HA as “Play”) but it’s meeting my needs for now.

Is it “best practice” to create a single automation and then use variables and if/then actions, or simply setup automations for each key?

Whatever you’re comfortable with. I personally go single automation.

1 Like