Support

Open search

HW-N950 - Add new IR codes for Logitech Harmony / Feature Request

Highlighted
First Poster

I'm having a terrible time getting my new HW-N950 to play nice with my Logitech Harmony control. 

 

This could be solved with a pretty simple firmware update. 

- Add distinct IR codes for ON and OFF

- Add distinct IR codes for each source

- Allow me to disable auto-power-off

 

Hopefully we can convince Samsung to add these in a future feature update, but in the mean time, does anyone have a workaround?

10 REPLIES 10
Highlighted
Apprentice

I don't.  The single code for rotating inputs works so poorly with the Harmony Companion.  Very unreliable.  Let me know if you ever get the codes to individually select the input source.  Thanks!

Highlighted
New Member

I agree. The biggest problem I have is getting the Sound Bar onto the right source. Sometimes it auto changes and sometimes not. A specific code for each source is a must for samsung soundbars to work with harmony. 

Highlighted
New Member

*Following

Highlighted
Apprentice

Hi there

I have the same issue, my Harmony now sets the correct input but the soundbar changes after that again. Any update on this issue??

Thanks and regards

Martin

Highlighted
Apprentice

I went back and  forth  with Samsung and Harmony.  Both seemed to suggest that the codes needed to be provided by the other.  I eventually gave up.  :(

 

If someone else wants to take a pass at this, I'd be thrilled.  For now I route my devices to an HDMI switch  and then that to the soundbar into HDMI 1 and then that into my LG B8.  Works well.  Can't take advantage of ARC though.

Highlighted
New Member

FYI to anybody searching this, I got mine to work really well. I added a an activity exit command (press right on the directional pad) that does nothing but wake the soundbar up. The input selector now works every time. I also assigned the red button to the input selector just in case.

 

I did have to move my hub to make this work. I had it behind glass before, which worked for years with every other device. The soundbar seemed to be more finicky with that setup.

Highlighted
First Poster

Quick update - I've bypassed the issues with changing source by setting up my OpenHAB hub to listen to Harmony source changes, and then fire a URL at the soundbar.  I actually send the same command twice - once when the activity is starting and then after it has started to ensure the soundbar catches the change. 

 

The 3 inputs I'm using are coded hdmi1 (Nvidia Shield), hdmi2 (DVD) and arc (for inputs connected via the TV)

 

The only issue I've still got is that the soundbar auto-turns off after a period of time; and the left press to disable this doesn't work.  Any ideas on how to keep it on until I deliberately turn it off?

 

I  guess what I need to do is run a timer on OpenHAB to send a button press to the sound bar every so often while any Harmony activity is active.  I guess a right button press would work, but not sure how to code this in.

 

rule "Starting Shield"
when 
  Channel "harmonyhub:hub:HarmonyHub:activityStarting" triggered Shield
then
  logInfo("Harmony", "Shield starting...")
  sendHttpGetRequest("http://192.168.1.16:56001/UIC?cmd=%3Cname%3ESetFunc%3C/name%3E%3Cp%20type=%22str%22%20name=%22function%22%20val=%22hdmi1%22/%3E")
end

rule "Started Shield"
when 
  Channel "harmonyhub:hub:HarmonyHub:activityStarted" triggered Shield
then
  logInfo("Harmony", "...Shield started")
  sendHttpGetRequest("http://192.168.1.16:56001/UIC?cmd=%3Cname%3ESetFunc%3C/name%3E%3Cp%20type=%22str%22%20name=%22function%22%20val=%22hdmi1%22/%3E")
end

rule "Starting DVD"
when
  Channel "harmonyhub:hub:HarmonyHub:activityStarting" triggered DVD
then
  logInfo("Harmony", "DVD starting...")
  sendHttpGetRequest("http://192.168.1.16:56001/UIC?cmd=%3Cname%3ESetFunc%3C/name%3E%3Cp%20type=%22str%22%20name=%22function%22%20val=%22hdmi2%22/%3E")
end

rule "Started DVD"
when
  Channel "harmonyhub:hub:HarmonyHub:activityStarted" triggered DVD
then
  logInfo("Harmony", "DVD started...")
  sendHttpGetRequest("http://192.168.1.16:56001/UIC?cmd=%3Cname%3ESetFunc%3C/name%3E%3Cp%20type=%22str%22%20name=%22function%22%20val=%22hdmi2%22/%3E")
end

rule "Starting Orange"
when
  Channel "harmonyhub:hub:HarmonyHub:activityStarting" triggered Orange
then
  logInfo("Harmony", "Orange starting...")
  sendHttpGetRequest("http://192.168.1.16:56001/UIC?cmd=%3Cname%3ESetFunc%3C/name%3E%3Cp%20type=%22str%22%20name=%22function%22%20val=%22ARC%22/%3E")
end

rule "Started Orange"
when
  Channel "harmonyhub:hub:HarmonyHub:activityStarted" triggered Orange
then
  logInfo("Harmony", "Orange started...")
  sendHttpGetRequest("http://192.168.1.16:56001/UIC?cmd=%3Cname%3ESetFunc%3C/name%3E%3Cp%20type=%22str%22%20name=%22function%22%20val=%22ARC%22/%3E")
end

rule "Starting HTPC"
when
  Channel "harmonyhub:hub:HarmonyHub:activityStarting" triggered PC
then
  logInfo("Harmony", "HTPC starting...")
  sendHttpGetRequest("http://192.168.1.16:56001/UIC?cmd=%3Cname%3ESetFunc%3C/name%3E%3Cp%20type=%22str%22%20name=%22function%22%20val=%22ARC%22/%3E")
end

rule "Started HTPC"
when
  Channel "harmonyhub:hub:HarmonyHub:activityStarted" triggered PC
then
  logInfo("Harmony", "HTPC started...")
  sendHttpGetRequest("http://192.168.1.16:56001/UIC?cmd=%3Cname%3ESetFunc%3C/name%3E%3Cp%20type=%22str%22%20name=%22function%22%20val=%22ARC%22/%3E")
end
Highlighted
First Poster

I got my sound bar to go to the right input  this way, this always gets me to hdmi 2

21D3A1D9-C732-4A1D-A7E2-2B2C61033781.png

 

CD0B7FCC-23A3-4BC1-982B-2F75099F90F5.png

 

84B94913-88A2-42DA-B0D2-9C3A0DEF1B24.png

 

Highlighted
Just Browsing

Hi Andy, great post and it gave me a hint to be able to do the same with Home-Assistant which I find a bit easier to navigate and link than OpenHAB.

 

Installing home-assistant was straight forward, i had a pre-existing media server running Ubuntu Server 20.04. Created groups and users, create the directory for the application and configuration then install the docker container.

~$ sudo groupadd -g 1002 homeassistant
~$ sudo useradd -s /usr/bin/bash -m -d /opt/homeassistant homeassistant
~$ sudo su - homeassistant
bash-5.0# mkdir /opt/homeassistant/config
bash-5.0# exit

~$ sudo docker create \
 --name="home-assistant" \
 --net=host \
 -e PUID=1002 \
 -e PGID=1002 \
 -e "TZ=Australia/Melbourne" \
 -v /opt/homeassistant/config:/config \
 homeassistant/home-assistant:stable

After installing Home Assistant and importing the devices it found for home-automation on my network, most importantly the Harmony Hub, i created/edited these files to build my configuration and automations:

 

/config/soundbar/curlhdmi1

/config/soundbar/curlhdmi1

/config/soundbar/curlarc

/config/shell_commands.yaml

/config/automations.yaml - this already existed but was empty.

/config/configuration.yaml - this already existed but added configuration to it.

 

/config/soundbar/* contains a file each for each of the Web URL calls require to change to that input that I want, which is (based on your submission):

bash-5.0# pwd
/config/soundbar
bash-5.0# cat curlhdmi1
http://SamsungN950:56001/UIC?cmd=<name>SetFunc</name><p%20type="str"%20name="function"%20val="hdmi1"/>
bash-5.0# cat curlhdmi2
http://SamsungN950:56001/UIC?cmd=<name>SetFunc</name><p%20type="str"%20name="function"%20val="hdmi2"/>
bash-5.0# cat curlarc
http://SamsungN950:56001/UIC?cmd=<name>SetFunc</name><p%20type="str"%20name="function"%20val="arc"/>

From there I can show the calls made using the CLI command 'curl' to make a http call to change the input from the /config/shell_commands.yaml file:

bash-5.0# pwd
/config
bash-5.0# cat shell_commands.yaml
set_soundbar_hdmi1: 'curl --connect-timeout 2 $(cat /config/soundbar/curlhdmi1)'
set_soundbar_hdmi2: 'curl --connect-timeout 2 $(cat /config/soundbar/curlhdmi2)'
set_soundbar_arc: 'curl --connect-timeout 2 $(cat /config/soundbar/curlarc)'

I then used an example from the home-assistant website about using triggers from harmony_hub to then run an action. This is what i've got in /config/automations.yaml (i don't have an ARC input configured yet, but I have the shell command built to use it in the future).

bash-5.0# pwd
/config
bash-5.0# cat automations.yaml
- alias: "Watch PayTV started from harmony hub"
  trigger:
    platform: state
    entity_id: remote.harmony_hub
  condition:
    condition: template
    value_template: '{{ trigger.to_state.attributes.current_activity == "Watch PayTV" }}'
  action:
    service: shell_command.set_soundbar_hdmi1
- alias: "Switch to SHIELD TV started from harmony hub"
  trigger:
    platform: state
    entity_id: remote.harmony_hub
  condition:
    condition: template
    value_template: '{{ trigger.to_state.attributes.current_activity == "SHIELD TV" }}'
  action:
    service: shell_command.set_soundbar_hdmi2
- alias: "PowerOff started from harmony hub"
  trigger:
    platform: state
    entity_id: remote.harmony_hub
  condition:
    condition: template
    value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}'
  action:
    service: input_boolean.turn_off
    entity_id: input_boolean.notify

The names for the 'variables' in the value_template trigger.to_state.attributes.current_activity are from the harmony_DEVICENAME.conf which comes down from the harmony hub discovery. This is in the /conf directory.

bash-5.0# pwd
/config
bash-5.0# head harmony_13095281.conf
{
    "Activities": {
        "-1": "PowerOff",
        "34322322": "Watch PayTV",
        "34322331": "SHIELD TV",
    },
...

The final configuration is to update the /config/configuration.yaml to be sure it can inherit the shell_commands.yaml file:

bash-5.0# pwd
/config
bash-5.0# cat configuration.yaml

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
shell_command: !include shell_commands.yaml

As a result when Logitech fires a change of activity which requires a change in input on the Samsung N950 soundbar, it fires the line:

action: service: shell_command.set_soundbar_hdmi2

which essentially runs the commandline equivalent (with http return data):

bash-5.0# curl --connect-timeout 2 'http://SamsungN950:56001/UIC?cmd=<name>SetFunc</name><p%20type="str"%20name="function"%20val="hdmi2"/>'

<?xml version="1.0" encoding="UTF-8"?><UIC><method>PowerStatus</method><version>1.0</version><speakerip>10.0.0.61</speakerip><user_identifier>public</user_identifier><response result="ok"><powerStatus>1</powerStatus></response></UIC>

This also turns on the soundbar if it is off which is a benefit.

 

Now if only the Harmony could embed Web Calls like this, i wouldn't have to do this and it would be IMMENSELY easier out of the box for direct input change rather than input cycling. Hopefully a FW update in the future for the N950 doesn't break this access.

 

With all this information, and an existing media center that is docker enabled, I could get this up and running in under 10 minutes now.

 

 

 

 

Top Liked Authors