Skip to content

The use of number_timer for XXX is deprecated and should be replaced by time.timer #3761

@robinhood-code

Description

@robinhood-code

Description

Got a number of timer deprecation warnings during HA startup or when devices are reloaded:

Logger: custom_components.tuya_local.helpers.config
Source: custom_components/tuya_local/helpers/config.py:34
integration: Tuya Local ([documentation](https://github.com/make-all/tuya-local), [issues](https://github.com/make-all/tuya-local/issues))
First occurred: September 21, 2025 at 10:58:53 PM (32 occurrences)
Last logged: 11:02:03 AM
The use of number_timer for Dimmer switch is deprecated and should be replaced by time.timer.
The use of number_timer for Dimming lightbulb is deprecated and should be replaced by time.timer.
The use of number_timer for RGBCW Lightbulb is deprecated and should be replaced by time.timer.
The use of number_timer for Simple switch with timer is deprecated and should be replaced by time.timer.
The use of number_timer for Advanced energy monitoring smartplug is deprecated and should be replaced by time.timer.

AND

Logger: custom_components.tuya_local.entity
Source: custom_components/tuya_local/entity.py:119
integration: Tuya Local ([documentation](https://github.com/make-all/tuya-local), [issues](https://github.com/make-all/tuya-local/issues))
First occurred: September 21, 2025 at 10:58:53 PM (30 occurrences)
Last logged: 11:02:03 AM

The use of number_timer for Dimmer switch is deprecated and should be replaced by time.timer.
The use of number_timer for Dimming lightbulb is deprecated and should be replaced by time.timer.
The use of number_timer for RGBCW Lightbulb is deprecated and should be replaced by time.timer.
The use of number_timer for Simple switch with timer is deprecated and should be replaced by time.timer.
The use of number_timer for Advanced energy monitoring smartplug is deprecated and should be replaced by time.timer.

Checked that they are not from my automation with time stamps as there were no automation run at that time.

Steps to reproduce

With one of the devices (RGBCW Lightbulb) and enabled debug logging for the integration and reloaded the device:

2025-09-22 11:02:03.468 DEBUG (SyncWorker_35) [custom_components.tuya_local.device] Buffet Light Bulb refreshed device state: {"dps": {"20": true, "21": "white", "22": 110, "23": 0, "24": "0009029f012a", "25": "000e0d0000000000000000c80000", "26": 3600, "34": true, "41": true}}
2025-09-22 11:02:03.468 DEBUG (SyncWorker_35) [custom_components.tuya_local.device] new state (incl pending): {"updated_at": 1758502923.4684432, "20": true, "21": "white", "22": 110, "23": 0, "24": "0009029f012a", "25": "000e0d0000000000000000c80000", "26": 3600, "34": true, "41": true}
2025-09-22 11:02:03.479 DEBUG (SyncWorker_13) [custom_components.tuya_local.helpers.device_config] Loaded device config rgbcw_lightbulb.yaml
2025-09-22 11:02:03.521 DEBUG (SyncWorker_25) [custom_components.tuya_local.helpers.device_config] Loaded device config rgbcw_lightbulb.yaml
2025-09-22 11:02:03.527 DEBUG (SyncWorker_20) [custom_components.tuya_local.helpers.device_config] Loaded device config rgbcw_lightbulb.yaml
2025-09-22 11:02:03.527 DEBUG (SyncWorker_10) [custom_components.tuya_local.helpers.device_config] Loaded device config rgbcw_lightbulb.yaml
2025-09-22 11:02:03.528 DEBUG (SyncWorker_18) [custom_components.tuya_local.helpers.device_config] Loaded device config rgbcw_lightbulb.yaml
2025-09-22 11:02:03.532 DEBUG (SyncWorker_29) [custom_components.tuya_local.helpers.device_config] Loaded device config rgbcw_lightbulb.yaml
2025-09-22 11:02:03.536 DEBUG (MainThread) [custom_components.tuya_local.helpers.config] Adding time for time_timer
2025-09-22 11:02:03.537 DEBUG (MainThread) [custom_components.tuya_local.device] Starting monitor loop for Buffet Light Bulb
2025-09-22 11:02:03.538 WARNING (MainThread) [custom_components.tuya_local.helpers.config] The use of number_timer for RGBCW Lightbulb is deprecated and should be replaced by time.timer.
2025-09-22 11:02:03.538 DEBUG (MainThread) [custom_components.tuya_local.helpers.config] Adding number for number_timer
2025-09-22 11:02:03.539 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Step for value is 60 with scale 60
2025-09-22 11:02:03.539 WARNING (MainThread) [custom_components.tuya_local.entity] The use of number_timer for RGBCW Lightbulb is deprecated and should be replaced by time.timer.
2025-09-22 11:02:03.539 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] Step for value is 60 with scale 60
2025-09-22 11:02:03.540 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] RGBCW Lightbulb: Mapped dps 26 value from 3600 to 60.0
2025-09-22 11:02:03.540 DEBUG (MainThread) [custom_components.tuya_local.helpers.device_config] RGBCW Lightbulb: Mapped dps 26 value from 3600 to 60.0
2025-09-22 11:02:03.540 DEBUG (MainThread) [custom_components.tuya_local.helpers.config] Adding text for text_scene

Checked the rgbcw_lightbulb.yaml and found the following entries which should be related to the issue:

  - entity: time
    translation_key: timer
    category: config
    dps:
      - id: 26
        name: second
        type: integer
        optional: true
        range:
          min: 0
          max: 86400
  - entity: number
    translation_key: timer
    # 2025-07-20
    deprecated: time.timer
    class: duration
    category: config
    dps:
      - id: 26
        name: value
        type: integer
        optional: true
        range:
          min: 0
          max: 86400
        unit: min
        mapping:
          - scale: 60
            step: 60

Go to the device, disable the following time entitiy (number.buffet_light_bulb_timer), reload the device, now the deprecation warning from custom_components.tuya_local.helpers.config REMAINS, but custom_components.tuya_local.entity is now gone

Image
2025-09-22 11:47:03.591 WARNING (MainThread) [custom_components.tuya_local.device] Buffet Light Bulb receive loop has terminated
2025-09-22 11:47:03.924 WARNING (MainThread) [custom_components.tuya_local.helpers.config] The use of number_timer for RGBCW Lightbulb is deprecated and should be replaced by time.timer.

Expected behaviour

No response

Additional context

No response

Confirmation

  • I am sure this is a bug or improvement, that is well enough described that it can be implemented.

  • This report is for tuya-local, not for localtuya.

  • If this is for a specific device, the device config filename is mentioned above, or diagnostics are included.

  • Log messages or diagnostics relevant to the issue are included.

  • This is not requesting addition of a new device.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions