APDS9960 sensor invalid id

Hi, I purchased an APDS9960 sensor. While installing my .yaml file, I’m getting an error.


[17:48:42][E][apds9960:147]: APDS9960 has invalid id!
[17:48:42][E][component:082]:   Component apds9960 is marked FAILED

.yaml code

esphome:
  name: esphome-web-a10a90
  friendly_name: PIRmotion
  min_version: 2024.11.0
  name_add_mac_suffix: false

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf

logger:

api:

ota:
  platform: esphome
  
wifi:
  networks:
    - ssid: !secret wifi_ssid
      password: !secret wifi_password

i2c:
  sda: GPIO7
  scl: GPIO8
  scan: true

apds9960:
  address: 0x39
  update_interval: 1s
  ambient_light_gain: 16X

binary_sensor:
  - platform: apds9960
    direction: UP
    id: apds960_up
    on_state:
      then:
        - text_sensor.template.publish:
            id: direction_status
            state: "UP"

  - platform: apds9960
    direction: DOWN
    id: apds960_down
    on_state:
      then:
        - text_sensor.template.publish:
            id: direction_status
            state: "DOWN"

  - platform: apds9960
    direction: LEFT
    id: apds960_left
    on_state:
      then:
        - text_sensor.template.publish:
            id: direction_status
            state: "LEFT"

  - platform: apds9960
    direction: RIGHT
    id: apds960_right
    on_state:
      then:
        - text_sensor.template.publish:
            id: direction_status
            state: "RIGHT"

text_sensor:
  - platform: template
    name: "direction_status"
    id: direction_status

I read a few similar forum topics suggesting that it might be a low-quality Chinese clone sensor. Could that be the case, or is there something wrong with my code?

Yes.
Error is for id, so it’s not problem of your code.

1 Like