Camera recording state automations

Hello,

I want to trigger a notification using the camera recording state as a condition but I can’t find how.

I tried this but it doesn’t work:

- alias: 'Alert_MotionSensor'
  trigger:
    platform: state
    entity_id: binary_sensor.motionsensor
    to: 'on'
  condition:
      - condition: template
        value_template: "{% if is_state('camera.salon', 'recording') %}true{% endif %}"
  action:
    service: notify.gotify_1
    data:
      title: "Alert"
      message: "Motion Detected[]"

My camera is either showed as “Idle” or “Recording” in home assistant (that part is managed by Synology surveillance station + an IFTT webhook request without any problem)
Before I was using a switch related to the Home Mode on synology SS put it doesn’t work anymore, that’s why I want to use the Camera recording state now.

Thanks in advance for the help.

Replace the value_template in the condition with

"{{ is_state('camera.salon', 'recording') }}"

Also, what do you mean by “it doesn’t work”?

It works now, thank you very much for you reactivity !