Use rest API to activate deactivate Hue sensor

I would like to the have switch to use the HUE API to activate/ deactivate my HUE sensor.

This is workinging outside Home assistant correctly

I added the below lines on my configuration.yaml

#Hue sensor action
switch hue:

The switch is there, off, if I activate is comeback off directly and doing nothing… any idea?

I actually use a command line switch for this for a very specific use case.

- platform: command_line
      command_on: curl -X PUT -d '{"on":true}' ""
      command_off: curl -X PUT -d '{"on":false}' ""
      command_state: curl ""
      value_template: "{{ value_json.config.on }}"
      friendly_name: Laundry room motion sensor status

Adapt to your info of course.

that make sense …
I saw it’s not working here … which log will you check to understand the issue?

The home assistant log at configuration > logs