make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.42k stars 551 forks source link

Smart socket only updating electrical stats at HomeAssistant if I keep my Tuya app opened #2090

Closed davefx closed 4 months ago

davefx commented 4 months ago

Describe the bug Starting a few days ago, my Tuya-local managed smart socket only updates its electrical information (power consumption, current, voltage) into Home Assistant if I open the "Electric" tab for this device inside the Tuya App in my phone.

To Reproduce No updates in power consumption, current, voltage in the last 10 minutes in Home Assistant. At the moment I open the "Electric" tab in my Tuya app for this smart socket, values for these entities start updating every 5 seconds. The updates stop again after closing the "Electric" tab.

Expected behavior The socket should keep sending periodic updates, no matter if the "Electric" tab of the app is opened or not.

Additional context Add any other context about the problem here.

If the bug involves a device, then please include device diagnostics from Settings / Devices & Services / Tuya Local (your device) / "1 device"

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.7.0",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Madrid",
    "os_name": "Linux",
    "os_version": "6.6.28-haos-raspi",
    "supervisor": "2024.06.2",
    "host_os": "Home Assistant OS 12.3",
    "docker_version": "25.0.5",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "pvpc_hourly_pricing": {
      "documentation": "https://github.com/azogue/ha-pvpc-custom",
      "version": "1.2.1",
      "requirements": [
        "aiopvpc>=4.3.1"
      ]
    },
    "smartthinq_sensors": {
      "documentation": "https://github.com/ollo69/ha-smartthinq-sensors",
      "version": "0.39.2",
      "requirements": [
        "pycountry>=23.12.11",
        "xmltodict>=0.13.0",
        "charset_normalizer>=3.2.0"
      ]
    },
    "google_home": {
      "documentation": "https://github.com/leikoilja/ha-google-home",
      "version": "1.11.1",
      "requirements": [
        "glocaltokens==0.7.1"
      ]
    },
    "asterisk": {
      "documentation": "https://github.com/TECH7Fox/Asterisk-integration",
      "version": "1.0.4",
      "requirements": [
        "asterisk-ami==0.1.6"
      ]
    },
    "battery_notes": {
      "documentation": "https://andrew-codechimp.github.io/HA-Battery-Notes/",
      "version": "2.3.9",
      "requirements": []
    },
    "tplink_easy_smart": {
      "documentation": "https://github.com/vmakeev/tplink_easy_smart",
      "version": "0.3.0",
      "requirements": [
        "json5==0.9.10"
      ]
    },
    "tuya_local": {
      "documentation": "https://github.com/make-all/tuya-local",
      "version": "2024.6.0",
      "requirements": [
        "tinytuya==1.14.0",
        "tuya-device-sharing-sdk==0.1.9"
      ]
    },
    "watchman": {
      "documentation": "https://github.com/dummylabs/thewatchman",
      "version": "0.6.3",
      "requirements": [
        "prettytable==3.10.0"
      ]
    },
    "browser_mod": {
      "documentation": "https://github.com/thomasloven/hass-browser_mod/blob/master/README.md",
      "version": "2.3.0",
      "requirements": []
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "mass": {
      "documentation": "https://music-assistant.io",
      "version": "2024.6.2",
      "requirements": [
        "music-assistant==2.0.6"
      ]
    },
    "midea_dehumidifier_lan": {
      "documentation": "https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/blob/main/README.md",
      "version": "0.9.4",
      "requirements": [
        "midea-beautiful-air==0.10.5"
      ]
    },
    "powercalc": {
      "documentation": "https://github.com/bramstroker/homeassistant-powercalc",
      "version": "v1.12.13",
      "requirements": [
        "numpy>=1.21.1"
      ]
    },
    "tapo_control": {
      "documentation": "https://github.com/JurajNyiri/HomeAssistant-Tapo-Control",
      "version": "5.4.26",
      "requirements": [
        "pytapo==3.3.23"
      ]
    },
    "custom_templates": {
      "documentation": "https://github.com/PiotrMachowski/Home-Assistant-custom-components-Custom-Templates",
      "version": "v1.4.0",
      "requirements": []
    },
    "presence_simulation": {
      "documentation": "https://github.com/slashback100/presence_simulation",
      "version": "4.8",
      "requirements": []
    },
    "balance_neto": {
      "documentation": "https://github.com/MiguelAngelLV/balance_neto",
      "version": "0.1.0",
      "requirements": []
    },
    "edge_tts": {
      "documentation": "https://github.com/hasscc/hass-edge-tts",
      "version": "0.0.1",
      "requirements": [
        "edge-tts==6.1.12"
      ]
    },
    "bodymiscale": {
      "documentation": "https://github.com/dckiller51/bodymiscale",
      "version": "2024.6.0",
      "requirements": [
        "cachetools==5.3.0"
      ]
    },
    "reversotts": {
      "documentation": "https://github.com/rt400/ReversoTTS-HA",
      "version": "1.0.2",
      "requirements": [
        "pyttsreverso==0.4"
      ]
    },
    "localtuya": {
      "documentation": "https://github.com/rospogrigio/localtuya/",
      "version": "5.2.1",
      "requirements": []
    },
    "tplink_deco": {
      "documentation": "https://github.com/amosyuen/ha-tplink-deco",
      "version": "3.6.2",
      "requirements": [
        "pycryptodome>=3.12.0"
      ]
    },
    "multiscrape": {
      "documentation": "https://github.com/danieldotnl/ha-multiscrape",
      "version": "7.0.0",
      "requirements": [
        "lxml>=4.9.1",
        "beautifulsoup4>=4.12.2"
      ]
    },
    "fontawesome": {
      "documentation": "https://github.com/thomasloven/hass-fontawesome",
      "version": "2.2.1",
      "requirements": []
    },
    "favicon": {
      "documentation": "https://github.com/thomasloven/hass-favicon",
      "version": "10.4",
      "requirements": []
    },
    "meross_lan": {
      "documentation": "https://github.com/krahabb/meross_lan",
      "version": "5.2.2",
      "requirements": []
    },
    "google_photos": {
      "documentation": "https://github.com/daanoz/ha-google-photos",
      "version": "v0.6.3",
      "requirements": [
        "google-api-python-client>=2.71.0",
        "pillow"
      ]
    },
    "frigate": {
      "documentation": "https://github.com/blakeblackshear/frigate",
      "version": "5.2.0",
      "requirements": [
        "pytz"
      ]
    },
    "gas_station_spain": {
      "documentation": "https://github.com/MiguelAngelLV/gas_station_spain",
      "version": "0.8.0",
      "requirements": []
    },
    "scheduler": {
      "documentation": "https://github.com/nielsfaber/scheduler-component",
      "version": "v0.0.0",
      "requirements": []
    },
    "ble_monitor": {
      "documentation": "https://github.com/custom-components/ble_monitor",
      "version": "12.12.1",
      "requirements": [
        "pycryptodomex>=3.19.1",
        "janus>=1.0.0",
        "aioblescan>=0.2.14",
        "btsocket>=0.2.0",
        "pyric>=0.1.6.3"
      ]
    },
    "tuya_ble": {
      "documentation": "https://www.home-assistant.io/integrations/tuya_ble",
      "version": "0.1.8",
      "requirements": [
        "tuya-iot-py-sdk==0.6.6",
        "pycountry>=22.3.5"
      ]
    },
    "ideenergy": {
      "documentation": "https://github.com/ldotlopez/ha-ideenergy",
      "version": "2.1.2",
      "requirements": [
        "ideenergy>=2.0.0rc1",
        "homeassistant-historical-sensor==2.0.0rc5"
      ]
    },
    "sonoff": {
      "documentation": "https://github.com/AlexxIT/SonoffLAN",
      "version": "3.7.3",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
    "chime_tts": {
      "documentation": "https://nimroddolev.github.io/chime_tts",
      "version": "v1.1.3",
      "requirements": [
        "pydub"
      ]
    },
    "wasp_sensor": {
      "documentation": "https://github.com/dlashua/hass-wasp_sensor",
      "version": "0.0.3",
      "requirements": []
    },
    "goodwe": {
      "documentation": "https://github.com/mletenay/home-assistant-goodwe-inverter",
      "version": "0.9.9.27",
      "requirements": [
        "goodwe==0.4.7"
      ]
    },
    "open_epaper_link": {
      "documentation": "https://github.com/jonasniesner/open_epaper_link_homeassistant",
      "version": "0.1.4",
      "requirements": [
        "qrcode[pil]==7.4.2",
        "requests_toolbelt==1.0.0",
        "websocket-client==1.7.0"
      ]
    }
  },
  "integration_manifest": {
    "domain": "tuya_local",
    "name": "Tuya Local",
    "codeowners": [
      "make-all"
    ],
    "config_flow": true,
    "dependencies": [],
    "documentation": "https://github.com/make-all/tuya-local",
    "integration_type": "device",
    "iot_class": "local_push",
    "issue_tracker": "https://github.com/make-all/tuya-local/issues",
    "requirements": [
      "tinytuya==1.14.0",
      "tuya-device-sharing-sdk==0.1.9"
    ],
    "version": "2024.6.0",
    "is_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 7.914700000810626e-05
    },
    "2285ed40190af80003d7e363957d39bd": {
      "wait_import_platforms": -5.404931796999989,
      "config_entry_setup": 10.013534222000004
    }
  },
  "data": {
    "name": "Enchufe lavadora",
    "type": "smartplugv2_energy",
    "device_id": "**REDACTED**",
    "device_cid": "",
    "local_key": "**REDACTED**",
    "host": "**REDACTED**",
    "protocol_version": 3.3,
    "tinytuya_version": "1.14.0",
    "api_version_set": 3.3,
    "api_version_used": 3.3,
    "api_working": true,
    "status": {},
    "cached_state": {
      "updated_at": 1720418970.4496028,
      "1": true,
      "9": 0,
      "18": 530,
      "19": 824,
      "20": 2397,
      "21": 1,
      "22": 533,
      "23": 27459,
      "24": 14742,
      "25": 1416
    },
    "pending_state": {},
    "connected": true,
    "force_dps": [],
    "home_assistant": {
      "name": "Enchufe lavadora",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "problem",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "binary_sensor.enchufe_lavadora_error",
            "state": "off",
            "attributes": {
              "device_class": "problem",
              "friendly_name": "Enchufe lavadora"
            },
            "last_changed": "2024-07-07T20:44:06.683831+00:00",
            "last_reported": "2024-07-07T20:45:00.920205+00:00",
            "last_updated": "2024-07-07T20:44:06.683831+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": "min",
          "state": {
            "entity_id": "number.enchufe_lavadora_timer",
            "state": "0.0",
            "attributes": {
              "min": 0.0,
              "max": 1440.0,
              "step": 1.0,
              "mode": "auto",
              "unit_of_measurement": "min",
              "friendly_name": "Enchufe lavadora Temporizador"
            },
            "last_changed": "2024-07-07T20:44:06.692905+00:00",
            "last_reported": "2024-07-07T20:45:00.943740+00:00",
            "last_updated": "2024-07-07T20:44:06.692905+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "outlet",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.enchufe_lavadora",
            "state": "on",
            "attributes": {
              "test_bit": 1,
              "device_class": "outlet",
              "friendly_name": "Enchufe lavadora"
            },
            "last_changed": "2024-07-07T20:44:06.683196+00:00",
            "last_reported": "2024-07-07T20:45:00.914537+00:00",
            "last_updated": "2024-07-07T20:44:06.683196+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.enchufe_lavadora_overcharge_cutoff",
            "state": "unknown",
            "attributes": {
              "icon": "mdi:battery-charging",
              "friendly_name": "Enchufe lavadora Overcharge cutoff"
            },
            "last_changed": "2024-07-07T20:44:06.683527+00:00",
            "last_reported": "2024-07-07T20:45:00.919755+00:00",
            "last_updated": "2024-07-07T20:44:06.683527+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "lock.enchufe_lavadora_child_lock",
            "state": "unknown",
            "attributes": {
              "friendly_name": "Enchufe lavadora Bloqueo infantil",
              "supported_features": 0
            },
            "last_changed": "2024-07-07T20:44:06.673063+00:00",
            "last_reported": "2024-07-07T20:45:00.910264+00:00",
            "last_updated": "2024-07-07T20:44:06.673063+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "select.enchufe_lavadora_initial_state",
            "state": "unknown",
            "attributes": {
              "options": [
                "On",
                "Off",
                "Last State"
              ],
              "icon": "mdi:toggle-switch",
              "friendly_name": "Enchufe lavadora Initial state"
            },
            "last_changed": "2024-07-07T20:44:06.673431+00:00",
            "last_reported": "2024-07-07T20:45:00.910627+00:00",
            "last_updated": "2024-07-07T20:44:06.673431+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "config",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "select.enchufe_lavadora_light",
            "state": "unknown",
            "attributes": {
              "options": [
                "State",
                "Position",
                "Off",
                "On"
              ],
              "icon": "mdi:circle-double",
              "friendly_name": "Enchufe lavadora Light"
            },
            "last_changed": "2024-07-07T20:44:06.680609+00:00",
            "last_reported": "2024-07-07T20:45:00.910892+00:00",
            "last_updated": "2024-07-07T20:44:06.680609+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "unit_of_measurement": "Wh",
          "state": {
            "entity_id": "sensor.enchufe_lavadora_energy",
            "state": "unknown",
            "attributes": {
              "calibration": 1416,
              "unit_of_measurement": "Wh",
              "friendly_name": "Enchufe lavadora Energy"
            },
            "last_changed": "2024-07-07T20:44:06.684293+00:00",
            "last_reported": "2024-07-07T20:45:00.920636+00:00",
            "last_updated": "2024-07-07T20:44:06.684293+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "current",
          "icon": null,
          "unit_of_measurement": "mA",
          "state": {
            "entity_id": "sensor.enchufe_lavadora_intensidad_de_corriente_2",
            "state": "530",
            "attributes": {
              "state_class": "measurement",
              "calibration": 27459,
              "unit_of_measurement": "mA",
              "device_class": "current",
              "friendly_name": "Enchufe lavadora"
            },
            "last_changed": "2024-07-08T06:08:01.757896+00:00",
            "last_reported": "2024-07-08T06:08:01.757896+00:00",
            "last_updated": "2024-07-08T06:08:01.757896+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "voltage",
          "icon": null,
          "unit_of_measurement": "V",
          "state": {
            "entity_id": "sensor.enchufe_lavadora_voltaje_2",
            "state": "239.7",
            "attributes": {
              "state_class": "measurement",
              "calibration": 533,
              "unit_of_measurement": "V",
              "device_class": "voltage",
              "friendly_name": "Enchufe lavadora"
            },
            "last_changed": "2024-07-08T06:07:56.752345+00:00",
            "last_reported": "2024-07-08T06:08:01.760736+00:00",
            "last_updated": "2024-07-08T06:07:56.752345+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": "diagnostic",
          "device_class": null,
          "original_device_class": "power",
          "icon": null,
          "unit_of_measurement": "W",
          "state": {
            "entity_id": "sensor.enchufe_lavadora_consumo",
            "state": "82.4",
            "attributes": {
              "state_class": "measurement",
              "calibration": 14742,
              "unit_of_measurement": "W",
              "device_class": "power",
              "friendly_name": "Enchufe lavadora"
            },
            "last_changed": "2024-07-08T06:08:01.759099+00:00",
            "last_reported": "2024-07-08T06:08:01.759099+00:00",
            "last_updated": "2024-07-08T06:08:01.759099+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "energy",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "sensor.lavadora_energy_counter",
            "state": "38.41",
            "attributes": {
              "state_class": "total_increasing",
              "status": "collecting",
              "last_period": "0",
              "last_valid_state": "38.41",
              "last_reset": "2022-12-22T06:32:26.381604+00:00",
              "unit_of_measurement": "kWh",
              "device_class": "energy",
              "friendly_name": "LAVADORA Energy Counter"
            },
            "last_changed": "2024-07-08T06:05:30.373712+00:00",
            "last_reported": "2024-07-08T06:05:30.373712+00:00",
            "last_updated": "2024-07-08T06:05:30.373712+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "energy",
          "icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "sensor.lavadora_energy",
            "state": "38.41",
            "attributes": {
              "state_class": "total",
              "source": "sensor.enchufe_lavadora_consumo",
              "unit_of_measurement": "kWh",
              "device_class": "energy",
              "friendly_name": "LAVADORA Energy"
            },
            "last_changed": "2024-07-08T06:05:30.373452+00:00",
            "last_reported": "2024-07-08T06:05:30.493219+00:00",
            "last_updated": "2024-07-08T06:05:30.373452+00:00"
          }
        }
      ]
    }
  }
}

Please check if there are messages from Tuya Local in the Home Assistant log (Settings / System / Logs), and include those too.

Detected blocking call to open with args ('/config/custom_components/tuya_local/devices/smartplugv2_energy.yaml',) inside the event loop by custom integration 'tuya_local' at custom_components/tuya_local/helpers/device_config.py, line 101: self._config = load_yaml(filename) (offender: /usr/src/homeassistant/homeassistant/util/yaml/loader.py, line 226: with open(fname, encoding="utf-8") as conf_file:), please create a bug report at https://github.com/make-all/tuya-local/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 262, in post return await super().post(request) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 77, in post return await self._post_impl(request, data) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 84, in _post_impl result = await self._flow_mgr.async_init( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 343, in async_init result = await self._async_handle_step(flow, flow.init_step, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) File "/config/custom_components/tuya_local/config_flow.py", line 548, in async_step_init return await self.async_step_user(user_input) File "/config/custom_components/tuya_local/config_flow.py", line 581, in async_step_user cfg = get_config(config[CONF_TYPE]) File "/config/custom_components/tuya_local/helpers/device_config.py", line 998, in get_config return TuyaDeviceConfig(fname) File "/config/custom_components/tuya_local/helpers/device_config.py", line 101, in __init__ self._config = load_yaml(filename) 

If applicable, add screenshots to help explain your problem.

make-all commented 4 months ago

This is a common behaviour of Tuya smart sockets, not a bug in the integration.

davefx commented 4 months ago

Maybe I don't know if this is a bug or not, but until a few days ago this was fully working (receiving local data every 5 seconds or so). And since then the automations I had with this integration became totally useless. I've had to replace my locally-controlled Tuya smart plug with another one.

make-all commented 4 months ago

Nothing changed in the integration in the past few days. Did the device's firmware update?

davefx commented 4 months ago

No. No firmware updates in the plug. If somehow I was enjoying a non-standard behaviour, that got cancelled (maybe from Tuya cloud), in that case maybe the integration could send some kind of message to the smartplug so it enters in the state to report data every X seconds...