Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuya device status not being reflected in home assisant GUI #65099

Closed
fOmey opened this issue Jan 28, 2022 · 14 comments
Closed

Tuya device status not being reflected in home assisant GUI #65099

fOmey opened this issue Jan 28, 2022 · 14 comments

Comments

@fOmey
Copy link
Contributor

fOmey commented Jan 28, 2022

The problem

I've recently noticed that my tuya device status are not being updated in the home assistant GUI.

However intermitentally they do update which is very odd.. they fail to update most of the time tho.

Lamp : RGB plug diagnostics:

{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2022.2.0b1",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.9.7",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Australia/Sydney",
    "os_name": "Linux",
    "os_version": "4.9.277-meson64",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "version": "1.19.3",
      "requirements": [
        "aiogithubapi>=21.11.0"
      ]
    }
  },
  "integration_manifest": {
    "domain": "tuya",
    "name": "Tuya",
    "documentation": "https://www.home-assistant.io/integrations/tuya",
    "requirements": [
      "tuya-iot-py-sdk==0.6.6"
    ],
    "dependencies": [
      "ffmpeg"
    ],
    "codeowners": [
      "@Tuya",
      "@zlinoliver",
      "@METISU",
      "@frenck"
    ],
    "config_flow": true,
    "iot_class": "cloud_push",
    "dhcp": [
      {
        "macaddress": "105A17*"
      },
      {
        "macaddress": "10D561*"
      },
      {
        "macaddress": "1869D8*"
      },
      {
        "macaddress": "381F8D*"
      },
      {
        "macaddress": "508A06*"
      },
      {
        "macaddress": "68572D*"
      },
      {
        "macaddress": "708976*"
      },
      {
        "macaddress": "7CF666*"
      },
      {
        "macaddress": "84E342*"
      },
      {
        "macaddress": "D4A651*"
      },
      {
        "macaddress": "D81F12*"
      }
    ],
    "is_built_in": true
  },
  "data": {
    "endpoint": "https://openapi.tuyaeu.com",
    "auth_type": 0,
    "country_code": "44",
    "app_type": "tuyaSmart",
    "mqtt_connected": true,
    "disabled_by": null,
    "disabled_polling": false,
    "name": "Lamp",
    "model": "HYS-01-101",
    "category": "dj",
    "product_id": "iB4a3SpWMr4AcWEx",
    "product_name": "RGB Smart Plug",
    "online": true,
    "sub": false,
    "time_zone": "+10:00",
    "active_time": "2022-01-23T20:26:45+00:00",
    "create_time": "2021-10-04T07:00:28+00:00",
    "update_time": "2022-01-23T20:26:56+00:00",
    "function": {
      "switch_led": {
        "type": "Boolean",
        "value": {}
      },
      "bright_value": {
        "type": "Integer",
        "value": {
          "min": 25,
          "scale": 0,
          "unit": "",
          "max": 255,
          "step": 1
        }
      },
      "work_mode": {
        "type": "Enum",
        "value": {
          "range": [
            "white",
            "colour",
            "scene",
            "scene_1",
            "scene_2",
            "scene_3",
            "scene_4"
          ]
        }
      },
      "colour_data": {
        "type": "Json",
        "value": {
          "h": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "scene_data": {
        "type": "Json",
        "value": {
          "h": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "flash_scene_1": {
        "type": "Json",
        "value": {
          "h": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "flash_scene_2": {
        "type": "Json",
        "value": {
          "h": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "flash_scene_3": {
        "type": "Json",
        "value": {
          "h": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "flash_scene_4": {
        "type": "Json",
        "value": {
          "h": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "switch": {
        "type": "Boolean",
        "value": {}
      },
      "countdown_1": {
        "type": "Integer",
        "value": {
          "unit": "s",
          "min": 0,
          "max": 86400,
          "scale": 0,
          "step": 1
        }
      }
    },
    "status_range": {
      "switch_led": {
        "type": "Boolean",
        "value": {}
      },
      "work_mode": {
        "type": "Enum",
        "value": {
          "range": [
            "white",
            "colour",
            "scene",
            "scene_1",
            "scene_2",
            "scene_3",
            "scene_4"
          ]
        }
      },
      "bright_value": {
        "type": "Integer",
        "value": {
          "min": 25,
          "scale": 0,
          "unit": "",
          "max": 255,
          "step": 1
        }
      },
      "colour_data": {
        "type": "Json",
        "value": {
          "h": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "scene_data": {
        "type": "Json",
        "value": {
          "h": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "flash_scene_1": {
        "type": "Json",
        "value": {
          "h": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "flash_scene_2": {
        "type": "Json",
        "value": {
          "h": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "flash_scene_3": {
        "type": "Json",
        "value": {
          "h": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "flash_scene_4": {
        "type": "Json",
        "value": {
          "h": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 360,
            "step": 1
          },
          "s": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          },
          "v": {
            "min": 1,
            "scale": 0,
            "unit": "",
            "max": 255,
            "step": 1
          }
        }
      },
      "switch": {
        "type": "Boolean",
        "value": {}
      },
      "countdown_1": {
        "type": "Integer",
        "value": {
          "unit": "s",
          "min": 0,
          "max": 86400,
          "scale": 0,
          "step": 1
        }
      }
    },
    "status": {
      "switch_led": false,
      "work_mode": "colour",
      "bright_value": 180,
      "colour_data": {
        "h": 233.0,
        "s": 255.0,
        "v": 255.0
      },
      "scene_data": {
        "h": 0.0,
        "s": 0.0,
        "v": 0.0
      },
      "flash_scene_1": {
        "bright": 255,
        "frequency": 80,
        "hsv": [
          {
            "h": 120.0,
            "s": 255.0,
            "v": 255.0
          }
        ],
        "temperature": 255
      },
      "flash_scene_2": {
        "bright": 255,
        "frequency": 128,
        "hsv": [
          {
            "h": 0.0,
            "s": 255.0,
            "v": 255.0
          },
          {
            "h": 120.0,
            "s": 255.0,
            "v": 255.0
          },
          {
            "h": 240.0,
            "s": 255.0,
            "v": 255.0
          },
          {
            "h": 0.0,
            "s": 0.0,
            "v": 0.0
          },
          {
            "h": 0.0,
            "s": 0.0,
            "v": 0.0
          },
          {
            "h": 0.0,
            "s": 0.0,
            "v": 0.0
          }
        ],
        "temperature": 255
      },
      "flash_scene_3": {
        "bright": 255,
        "frequency": 80,
        "hsv": [
          {
            "h": 0.0,
            "s": 255.0,
            "v": 255.0
          }
        ],
        "temperature": 255
      },
      "flash_scene_4": {
        "bright": 255,
        "frequency": 5,
        "hsv": [
          {
            "h": 0.0,
            "s": 255.0,
            "v": 255.0
          },
          {
            "h": 120.0,
            "s": 255.0,
            "v": 255.0
          },
          {
            "h": 60.0,
            "s": 255.0,
            "v": 255.0
          },
          {
            "h": 300.0,
            "s": 255.0,
            "v": 255.0
          },
          {
            "h": 240.0,
            "s": 255.0,
            "v": 255.0
          },
          {
            "h": 0.0,
            "s": 0.0,
            "v": 0.0
          }
        ],
        "temperature": 255
      },
      "switch": false,
      "countdown_1": 0
    },
    "home_assistant": {
      "name": "Lamp",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "original_icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "light.lamp",
            "state": "off",
            "attributes": {
              "supported_color_modes": [
                "brightness",
                "hs",
                "onoff"
              ],
              "friendly_name": "Lamp",
              "supported_features": 0
            },
            "last_changed": "2022-01-28T02:24:05.316652+00:00",
            "last_updated": "2022-01-28T02:24:05.316652+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "original_icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "switch.lamp_plug",
            "state": "off",
            "attributes": {
              "friendly_name": "Lamp Plug"
            },
            "last_changed": "2022-01-28T02:24:05.325048+00:00",
            "last_updated": "2022-01-28T02:24:05.325048+00:00"
          }
        }
      ]
    }
  }
}

Fan:

{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2022.2.0b0",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.9.7",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Australia/Sydney",
    "os_name": "Linux",
    "os_version": "4.9.277-meson64",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "version": "1.19.3",
      "requirements": [
        "aiogithubapi>=21.11.0"
      ]
    }
  },
  "integration_manifest": {
    "domain": "tuya",
    "name": "Tuya",
    "documentation": "https://www.home-assistant.io/integrations/tuya",
    "requirements": [
      "tuya-iot-py-sdk==0.6.6"
    ],
    "dependencies": [
      "ffmpeg"
    ],
    "codeowners": [
      "@Tuya",
      "@zlinoliver",
      "@METISU",
      "@frenck"
    ],
    "config_flow": true,
    "iot_class": "cloud_push",
    "dhcp": [
      {
        "macaddress": "105A17*"
      },
      {
        "macaddress": "10D561*"
      },
      {
        "macaddress": "1869D8*"
      },
      {
        "macaddress": "381F8D*"
      },
      {
        "macaddress": "508A06*"
      },
      {
        "macaddress": "68572D*"
      },
      {
        "macaddress": "708976*"
      },
      {
        "macaddress": "7CF666*"
      },
      {
        "macaddress": "84E342*"
      },
      {
        "macaddress": "D4A651*"
      },
      {
        "macaddress": "D81F12*"
      }
    ],
    "is_built_in": true
  },
  "data": {
    "endpoint": "https://openapi.tuyaeu.com",
    "auth_type": 0,
    "country_code": "44",
    "app_type": "tuyaSmart",
    "mqtt_connected": true,
    "disabled_by": null,
    "disabled_polling": false,
    "name": "Fan",
    "model": "MZ-DCFAN",
    "category": "fs",
    "product_id": "agyqzsfpafsvkrl9",
    "product_name": "DC\u540a\u6247",
    "online": true,
    "sub": false,
    "time_zone": "+11:00",
    "active_time": "2022-01-23T20:31:46+00:00",
    "create_time": "2022-01-23T10:47:03+00:00",
    "update_time": "2022-01-24T09:52:52+00:00",
    "function": {
      "switch": {
        "type": "Boolean",
        "value": {}
      },
      "fan_speed_percent": {
        "type": "Integer",
        "value": {
          "min": "1",
          "max": "6",
          "scale": "0",
          "step": "1"
        }
      },
      "light": {
        "type": "Boolean",
        "value": {}
      },
      "bright_value": {
        "type": "Integer",
        "value": {
          "min": "10",
          "max": "1000",
          "scale": "0",
          "step": "1"
        }
      },
      "temp_value": {
        "type": "Integer",
        "value": {
          "min": "0",
          "max": "1000",
          "scale": "0",
          "step": "1"
        }
      }
    },
    "status_range": {
      "switch": {
        "type": "Boolean",
        "value": {}
      },
      "fan_speed_percent": {
        "type": "Integer",
        "value": {
          "min": "1",
          "max": "6",
          "scale": "0",
          "step": "1"
        }
      },
      "light": {
        "type": "Boolean",
        "value": {}
      },
      "bright_value": {
        "type": "Integer",
        "value": {
          "min": "10",
          "max": "1000",
          "scale": "0",
          "step": "1"
        }
      },
      "temp_value": {
        "type": "Integer",
        "value": {
          "min": "0",
          "max": "1000",
          "scale": "0",
          "step": "1"
        }
      }
    },
    "status": {
      "switch": false,
      "fan_speed_percent": 6,
      "light": false,
      "bright_value": 1000,
      "temp_value": 550
    },
    "home_assistant": {
      "name": "Fan",
      "name_by_user": null,
      "disabled": false,
      "disabled_by": null,
      "entities": [
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "original_icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "fan.fan",
            "state": "unavailable",
            "attributes": {
              "restored": true,
              "speed_list": [
                "off",
                "low",
                "medium",
                "high"
              ],
              "preset_modes": [],
              "friendly_name": "Fan",
              "supported_features": 1
            },
            "last_changed": "2022-01-26T20:58:44.052097+00:00",
            "last_updated": "2022-01-26T20:58:44.052097+00:00"
          }
        },
        {
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": null,
          "icon": null,
          "original_icon": null,
          "unit_of_measurement": null,
          "state": {
            "entity_id": "light.fan",
            "state": "off",
            "attributes": {
              "min_mireds": 153,
              "max_mireds": 500,
              "supported_color_modes": [
                "brightness",
                "color_temp",
                "onoff"
              ],
              "friendly_name": "Fan",
              "supported_features": 0
            },
            "last_changed": "2022-01-26T20:58:28.465042+00:00",
            "last_updated": "2022-01-26T20:58:28.465042+00:00"
          }
        }
      ]
    }
  }
}

What version of Home Assistant Core has the issue?

core-2022.2.0b1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Tuya

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tuya/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@probot-home-assistant
Copy link

tuya documentation
tuya source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @tuya, @zlinoliver, @METISU, @frenck, mind taking a look at this issue as it has been labeled with an integration (tuya) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@fOmey
Copy link
Contributor Author

fOmey commented Jan 29, 2022

Issue may be related to tuya cloud?

It appears its behaving as expected at the moment, I will monitor it and reopen if need be.

Edit: issue is back

I don't think this is related to the tuya cloud, i've been monitoring tuya iot when modifying settings and I can see they are updating:

2022-01-30 10:36:32 Report Wind Speed Level 4 device itself  
2022-01-30 10:36:31 Publish Wind Speed Level 4 unknown  
2022-01-30 10:36:31 publish by cloud api publish by cloud api success open api cloud2cloud
2022-01-30 10:35:29 Report Wind Speed Level 5 device itself  
2022-01-30 10:35:28 Publish Wind Speed Level 5 unknown  
2022-01-30 10:35:28 publish by cloud api publish by cloud api success open api cloud2cloud
2022-01-30 10:31:33 Report Wind Speed Level 4 device itself  
2022-01-30 10:31:33 Publish Wind Speed Level 4 unknown  

@fOmey fOmey closed this as completed Jan 29, 2022
@fOmey fOmey reopened this Jan 29, 2022
@frenck
Copy link
Member

frenck commented Jan 31, 2022

I don't think this is related to the tuya cloud, i've been monitoring tuya iot when modifying settings and I can see they are updating:

That is a log from the Tuya IoT application, which does not reflect what is being communicated back over the Cloud API.

In order to see the communications flowing back, enable debug logging for this integration:

logger:
  default: warning
  logs:
    homeassistant.components.tuya: debug

@fOmey
Copy link
Contributor Author

fOmey commented Feb 2, 2022

I don't think this is related to the tuya cloud, i've been monitoring tuya iot when modifying settings and I can see they are updating:

That is a log from the Tuya IoT application, which does not reflect what is being communicated back over the Cloud API.

In order to see the communications flowing back, enable debug logging for this integration:

logger:
  default: warning
  logs:
    homeassistant.components.tuya: debug

I was actually using this already, doesnt reveal much tho unfortunately.. maybe it does..

Toggling status of plugs:

2022-02-03 10:45:28 DEBUG (SyncWorker_5) [homeassistant.components.tuya] Sending commands for device 84800438483fda1c2bf0: [{'code': <DPCode.SWITCH: 'switch'>, 'value': True}]
2022-02-03 10:45:45 DEBUG (SyncWorker_8) [homeassistant.components.tuya] Sending commands for device 84800438483fda1c2bf0: [{'code': <DPCode.SWITCH: 'switch'>, 'value': True}]
2022-02-03 10:45:54 DEBUG (SyncWorker_4) [homeassistant.components.tuya] Sending commands for device 84800438483fda1c2bf0: [{'code': <DPCode.SWITCH: 'switch'>, 'value': True}]

The toggle button in home assistant UI displays a on state briefly and then reverts back to off. This is only happening on the home assistant UI, the plug itself remains on. Note the three consecutive on commands in the logs.

Edit:

Interesting.. a new log entry appears!

2022-02-03 10:45:28 DEBUG (SyncWorker_5) [homeassistant.components.tuya] Sending commands for device 84800438483fda1c2bf0: [{'code': <DPCode.SWITCH: 'switch'>, 'value': True}]
2022-02-03 10:45:45 DEBUG (SyncWorker_8) [homeassistant.components.tuya] Sending commands for device 84800438483fda1c2bf0: [{'code': <DPCode.SWITCH: 'switch'>, 'value': True}]
2022-02-03 10:45:54 DEBUG (SyncWorker_4) [homeassistant.components.tuya] Sending commands for device 84800438483fda1c2bf0: [{'code': <DPCode.SWITCH: 'switch'>, 'value': True}]
2022-02-03 10:45:55 DEBUG (SyncWorker_7) [homeassistant.components.tuya] Sending commands for device 84800438483fda1c2bf0: [{'code': <DPCode.SWITCH: 'switch'>, 'value': False}]
2022-02-03 10:46:33 DEBUG (SyncWorker_0) [homeassistant.components.tuya] Sending commands for device 84800438483fda1c2bf0: [{'code': <DPCode.SWITCH: 'switch'>, 'value': True}]
2022-02-03 11:01:40 DEBUG (SyncWorker_8) [homeassistant.components.tuya] Sending commands for device 84800438483fda1c2bf0: [{'code': <DPCode.SWITCH: 'switch'>, 'value': True}]
2022-02-03 11:01:41 DEBUG (SyncWorker_4) [homeassistant.components.tuya] Sending commands for device 84800438483fda1c2bf0: [{'code': <DPCode.SWITCH: 'switch'>, 'value': False}]
2022-02-03 11:01:42 DEBUG (Thread-13) [homeassistant.components.tuya] Received update for device 84800438483fda1c2bf0: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 255, 'colour_data': '{"h":243.0,"s":255.0,"v":255.0}', 'scene_data': '{"h":0.0,"s":0.0,"v":0.0}', 'flash_scene_1': '{"bright":255,"frequency":80,"hsv":[{"h":120.0,"s":255.0,"v":255.0}],"temperature":255}', 'flash_scene_2': '{"bright":255,"frequency":128,"hsv":[{"h":0.0,"s":255.0,"v":255.0},{"h":120.0,"s":255.0,"v":255.0},{"h":240.0,"s":255.0,"v":255.0},{"h":0.0,"s":0.0,"v":0.0},{"h":0.0,"s":0.0,"v":0.0},{"h":0.0,"s":0.0,"v":0.0}],"temperature":255}', 'flash_scene_3': '{"bright":255,"frequency":80,"hsv":[{"h":0.0,"s":255.0,"v":255.0}],"temperature":255}', 'flash_scene_4': '{"bright":255,"frequency":5,"hsv":[{"h":0.0,"s":255.0,"v":255.0},{"h":120.0,"s":255.0,"v":255.0},{"h":60.0,"s":255.0,"v":255.0},{"h":300.0,"s":255.0,"v":255.0},{"h":240.0,"s":255.0,"v":255.0},{"h":0.0,"s":0.0,"v":0.0}],"temperature":255}', 'switch': False, 'countdown_1': 0}

I received an update for the device! I'm assuming this is what is causing the UI to revert back to off.. the lack of updates? E.T finally phoning home?

@sumur1au
Copy link

sumur1au commented Feb 3, 2022

@fOmey

I have the same problem with my fans as well. Reloading the plugin is the only method to reflect the correct status of the fans.

Also, thank you for raising other issues regarding fan speed updates and etc.
Regards,
Sam

@PeterKiwi
Copy link

Same problem here. The status of light switches of various types are not updating in HA if I press the switch rather than changing through HA. I also have the same problem as others where if I then change it in HA it will revert back to previous state in Lovelace after about a second. Running 2022.2.1. As with others, restarting the integration updates the states.

@LordShelmchen
Copy link

I have the same problem. Switch and sockets are switched, but the switch in HA moves back to the initial position. All values of the entities are not updated. However, when I look at Tuya IOT, the values are updated continuously.
Only a restart of the integration sometimes brings current values.
If debug information is needed, please let me know. Especially how they are activated ;-)

Thanks for fixing and taking care!

@paulski999
Copy link

+1 issue with Light Card Configuration with Tuya Lights, initially works in Lovelace (i.e. switch on light) wait 5 seconds switch if off and the Lovelace Icon remains on but light does go off, a subsequent click on light icon, the light comes on, but does not reflect in Lovelace, so the status of the Tuya device is not being updated in Lovelace, issue exists both for actual Tuya lights or Tuya plugs, have updated to latest version of Home Assistant i.e. core-2022.2.3, using either Alexa app or Tuya Smart App lights and plugs work as expected.

@fOmey
Copy link
Contributor Author

fOmey commented Feb 20, 2022

I seem to be recieving device updates consistently at the moment on the latest beta, everything seems to be functioning as expected:

2022-02-21 08:52:14 DEBUG (SyncWorker_9) [homeassistant.components.tuya] Sending commands for device 84800438483fda1c2bf0: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2022-02-21 08:52:16 DEBUG (Thread-12) [homeassistant.components.tuya] Received update for device 84800438483fda1c2bf0: {'switch_led': True, 'work_mode': 'colour', 'bright_value': 255, 'colour_data': '{"h":243.0,"s":255.0,"v":255.0}', 'scene_data': '{"h":0.0,"s":0.0,"v":0.0}', 'flash_scene_1': '{"bright":255,"frequency":80,"hsv":[{"h":120.0,"s":255.0,"v":255.0}],"temperature":255}', 'flash_scene_2': '{"bright":255,"frequency":128,"hsv":[{"h":0.0,"s":255.0,"v":255.0},{"h":120.0,"s":255.0,"v":255.0},{"h":240.0,"s":255.0,"v":255.0},{"h":0.0,"s":0.0,"v":0.0},{"h":0.0,"s":0.0,"v":0.0},{"h":0.0,"s":0.0,"v":0.0}],"temperature":255}', 'flash_scene_3': '{"bright":255,"frequency":80,"hsv":[{"h":0.0,"s":255.0,"v":255.0}],"temperature":255}', 'flash_scene_4': '{"bright":255,"frequency":5,"hsv":[{"h":0.0,"s":255.0,"v":255.0},{"h":120.0,"s":255.0,"v":255.0},{"h":60.0,"s":255.0,"v":255.0},{"h":300.0,"s":255.0,"v":255.0},{"h":240.0,"s":255.0,"v":255.0},{"h":0.0,"s":0.0,"v":0.0}],"temperature":255}', 'switch': False, 'countdown_1': 0}
2022-02-21 08:52:20 DEBUG (SyncWorker_3) [homeassistant.components.tuya] Sending commands for device bf645c91669b5005aaa5ot: [{'code': <DPCode.SWITCH: 'switch'>, 'value': True}]
2022-02-21 08:52:21 DEBUG (Thread-12) [homeassistant.components.tuya] Received update for device bf645c91669b5005aaa5ot: {'switch': True, 'fan_speed_percent': 4, 'light': False, 'bright_value': 725, 'temp_value': 550}
2022-02-21 08:52:38 DEBUG (SyncWorker_0) [homeassistant.components.tuya] Sending commands for device bf645c91669b5005aaa5ot: [{'code': <DPCode.SWITCH: 'switch'>, 'value': False}]
2022-02-21 08:52:38 DEBUG (SyncWorker_4) [homeassistant.components.tuya] Sending commands for device 84800438483fda1c2bf0: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2022-02-21 08:52:39 DEBUG (Thread-12) [homeassistant.components.tuya] Received update for device bf645c91669b5005aaa5ot: {'switch': False, 'fan_speed_percent': 4, 'light': False, 'bright_value': 725, 'temp_value': 550}
2022-02-21 08:52:39 DEBUG (Thread-12) [homeassistant.components.tuya] Received update for device 84800438483fda1c2bf0: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 255, 'colour_data': '{"h":243.0,"s":255.0,"v":255.0}', 'scene_data': '{"h":0.0,"s":0.0,"v":0.0}', 'flash_scene_1': '{"bright":255,"frequency":80,"hsv":[{"h":120.0,"s":255.0,"v":255.0}],"temperature":255}', 'flash_scene_2': '{"bright":255,"frequency":128,"hsv":[{"h":0.0,"s":255.0,"v":255.0},{"h":120.0,"s":255.0,"v":255.0},{"h":240.0,"s":255.0,"v":255.0},{"h":0.0,"s":0.0,"v":0.0},{"h":0.0,"s":0.0,"v":0.0},{"h":0.0,"s":0.0,"v":0.0}],"temperature":255}', 'flash_scene_3': '{"bright":255,"frequency":80,"hsv":[{"h":0.0,"s":255.0,"v":255.0}],"temperature":255}', 'flash_scene_4': '{"bright":255,"frequency":5,"hsv":[{"h":0.0,"s":255.0,"v":255.0},{"h":120.0,"s":255.0,"v":255.0},{"h":60.0,"s":255.0,"v":255.0},{"h":300.0,"s":255.0,"v":255.0},{"h":240.0,"s":255.0,"v":255.0},{"h":0.0,"s":0.0,"v":0.0}],"temperature":255}', 'switch': False, 'countdown_1': 0}

@sumur1au
Copy link

@fOmey are you referring to core-2022.2.9 ? Mine seems to be working after this release as well. Do you what has changed ?

@fOmey
Copy link
Contributor Author

fOmey commented Feb 22, 2022

@fOmey are you referring to core-2022.2.9 ? Mine seems to be working after this release as well. Do you what has changed ?

Honestly don't know, My best guess would be something has changed on the cloud side perhaps? I can't notice any obvious commits that would have changed anything on home assistant side.

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label May 23, 2022
@fOmey
Copy link
Contributor Author

fOmey commented May 23, 2022

I've recently reconfigured my home network, setup a dedicated 2.4ghz wifi access point for my smart devices and I've had no issues since.. if your using a hybrid 2.4/5.0ghz wifi ap.. I suggest splitting them to see if it resolves your issues.

@fOmey fOmey closed this as completed May 23, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants