Overriding philips hue light sync with home assistant?

Hi all.

I’m trying to find a way to turn off several hue play lights attached to my computer that are synced to the display. When light sync is enabled, no commands from HA seem to work. I’m exposing the lights to HA via the hue hub, to use dynamic scenes for other rooms.

Is there a way to override a light sync with a HA command?

Yes you can! You can create a button or automation to turn of the " Hue Sync " mode directly on the bridge using the Hue Bridge Api. Down below is the information i used from chatgpt to configure this.

:key: Step 1: Find your Hue Bridge IP

  1. Open the Hue app on your phone.
  2. Go to: Settings → Bridge Information.
  3. Note the IP address (something like 192.168.1.50).

:key: Step 2: Use the Hue Debug Tool

  1. In a browser, go to:
    http://<BRIDGE_IP>/debug/clip.html
    (replace <BRIDGE_IP> with your bridge IP).
  2. You’ll see the Philips Hue CLIP API Debugger page.

:key: Step 3: Create a New API Key

  1. In the debugger:
  • URL field: /api
  • Method: POST
  • Message Body:
    {“devicetype”:“homeassistant#mybutton”}
  1. Press the physical button on top of your Hue Bridge (the round link button).
  2. Immediately click POST in the debugger.
  3. If successful, you’ll get a response like:

[
{
“success”: {
“username”: “xxxxxxxxxxxxxxxxxxxx”
}
}
]

:white_check_mark: Copy that long string (the "username") — this is your API key.
On bridges with the newer API (v2), it may be called "hue-application-key".


:key: Step 4: Test the Key

  1. In the Debug Tool:
  • URL field: /clip/v2/resource/bridge
  • Method: GET
  • Headers:
hue-application-key: <YOUR_API_KEY>
  1. Click GET. If it responds with JSON about your bridge, the key works. :tada:

:key: Step 5: Add to configuration.yaml

rest_command:
hue_sync_off:
url: “http://<BRIDGE_IP>/clip/v2/resource/entertainment_configuration/<ENTERTAINMENT_ID>”
method: put
headers:
hue-application-key: “<YOUR_HUE_API_KEY>”
Content-Type: “application/json”
payload: ‘{“action”: “deactivate”}’

Replace:

  • <BRIDGE_IP> → your bridge’s local IP (e.g. 192.168.1.50)
  • <YOUR_HUE_API_KEY> → your Hue developer key
  • <ENTERTAINMENT_ID> → I

Get your Entertainment Area ID

We need this because the command to “turn off Hue Sync” must target the entertainment area your TV uses.

  1. Open your browser and go to:
https://<BRIDGE_IP>/clip/v2/resource/entertainment_configuratio

:key: Step 6: Create a button. ( or just automate is with the res service commands)

type: button
tap_action:
  action: call-service
  service: rest_command.hue_sync_off
name: Turn Off Hue Sync
icon: mdi:television-off

the url from step 5 (also with N after it)
shows “Oops, there appears to be no lighting here”

Was doing that today, my notes:

  1. You can use postman to do requests but in postman turn OFF Enable SSL certificate verification
  2. to stop sync use PUT to

https://YOUR_IP/clip/v2/resource/entertainment_configuration/LONG_ENTERTAINMENT_ID

body:

{“action”: “stop”}

  1. Node red flow

[
{
“id”: “c02060ce165d7165”,
“type”: “http request”,
“z”: “c33cf0962b17c261”,
“name”: “”,
“method”: “PUT”,
“ret”: “obj”,
“paytoqs”: “ignore”,
“url”: “https://your_ip/clip/v2/resource/entertainment_configuration/your_id”,
“tls”: “b56c9327b5949180”,
“persist”: false,
“proxy”: “”,
“insecureHTTPParser”: false,
“authType”: “”,
“senderr”: false,
“headers”: [
{
“keyType”: “other”,
“keyValue”: “hue-application-key”,
“valueType”: “other”,
“valueValue”: “your_token”
},
{
“keyType”: “other”,
“keyValue”: “Content-Type”,
“valueType”: “other”,
“valueValue”: “application/json”
}
],
“x”: 790,
“y”: 60,
“wires”: [
[
“63d191cfbcd66c72”
]
]
},
{
“id”: “fde6a2c6262f2eb2”,
“type”: “function”,
“z”: “c33cf0962b17c261”,
“name”: “Stop HUE Sync”,
“func”: “msg.payload = {\n action: "stop"\n};\n\nreturn msg;\n”,
“outputs”: 1,
“timeout”: 0,
“noerr”: 0,
“initialize”: “”,
“finalize”: “”,
“libs”: ,
“x”: 600,
“y”: 60,
“wires”: [
[
“c02060ce165d7165”
]
]
},
{
“id”: “b56c9327b5949180”,
“type”: “tls-config”,
“name”: “”,
“cert”: “”,
“key”: “”,
“ca”: “”,
“certname”: “”,
“keyname”: “”,
“caname”: “”,
“servername”: “”,
“verifyservercert”: false,
“alpnprotocol”: “”
}
]

I had the same problem. Be sure to us HTTPS to connect to the debug tool:
https://<BRIDGE_IP>/debug/clip.html

This worked well for me. I can stop it using the rest_command and I created a smart things routine to start hue sync and I can call that from Home Assistant as well.

I also have the same problem with the “Oops, there appears to be no lighting here” message.

I’ve used a https connexion with CLIP API Debugger.

And i can’t pass the “Step 4”, i get “Error 403” in the Command Response field

From “Step 3”, i get "username" not “hue-application-key”

Any idea how to fix this?

With this method I also got the same error.
It worked for me using the method described in this Reddit post Link to post

This method uses the Hue API V1 instead of the Hue API V2.

1 Like

Thank you very much! It worked to turn off sync.
But I’m using sync on the app on my LG OLED TV and I can’t turn sync back on.
But it’s still cool to be able to disable sync so it’s not active during the day.

i’ve made a script to turn on the sync from the app and go back to previous source:

  tv_hue_sync_complet:
    alias: "[TV] Hue Sync silencieux"
    sequence:
      - variables:
          source_actuelle: "{{ state_attr('media_player.lg_webos_tv_oled83c44la_2','source') }}"
      - service: media_player.select_source
        data:
          entity_id: media_player.lg_webos_tv_oled83c44la_2
          source: "Hue Sync"
      - delay: "00:00:04"
      - service: remote.send_command
        data:
          entity_id: remote.harmony_hub
          device: "81674934"
          command: OK
      - delay: "00:00:01"
      - service: media_player.select_source
        data:
          entity_id: media_player.lg_webos_tv_oled83c44la_2
          source: "{{ source_actuelle }}"