azerty9971 / xtend_tuya

eXtend Tuya's integration
GNU General Public License v3.0
60 stars 6 forks source link

Regular tuya scenes disappear #96

Open MrMojoR opened 1 month ago

MrMojoR commented 1 month ago

After adding the integration with or without cloud support, the regular tuya scenes disappear. If I click reload they will come back for a few seconds, but then disappear. If I disable the xtend tuya integration the scenes come back in the regular tuya integration. What could be the issue?

azerty9971 commented 1 month ago

Hello, Are you using xtend tuya alongside the regular tuya integration?

Normally, xtend_tuya shouldn't touch the scenes if it's alongside the regular Tuya integration...

azerty9971 commented 1 month ago

sorry, I had misread your initial post, I'll investigate why this is happening, sorry for the inconvenience

MrMojoR commented 1 month ago

No problem, thank you!

azerty9971 commented 1 month ago

Hello, The latest beta fixes this issue.

Have a nice day, Azerty

MrMojoR commented 1 month ago

Thanks, I have tried the beta6, but I have received some errors:

2024-09-14 11:02:21.136 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry ******@gmail.com for xtend_tuya
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/homeassistant/config_entries.py", line 604, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xtend_tuya/__init__.py", line 46, in async_setup_entry
    await hass.async_add_executor_job(multi_manager.update_device_cache)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xtend_tuya/multi_manager/multi_manager.py", line 146, in update_device_cache
    self._merge_devices_from_multiple_sources()
  File "/config/custom_components/xtend_tuya/multi_manager/multi_manager.py", line 178, in _merge_devices_from_multiple_sources
    XTMergingManager.merge_devices(prev_device, current_device)
  File "/config/custom_components/xtend_tuya/multi_manager/shared/merging_manager.py", line 16, in merge_devices
    XTMergingManager._merge_function(device1, device2)
  File "/config/custom_components/xtend_tuya/multi_manager/shared/merging_manager.py", line 41, in _merge_function
    value1 = json.loads(device1.function[function_key].values)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

After that these errors appear:

[2024-09-14 11:02:24,216] [tuya-openmq] Unexpected disconnection.7
2024-09-14 11:02:24.216 ERROR (Thread-7 (_thread_main)) [tuya_iot] Unexpected disconnection.7

Thanks for the help!

azerty9971 commented 1 month ago

Hello, The latest beta should fix this issue :).

Don't hesitate to let me know ;)

Have a nice day, Azerty

azerty9971 commented 1 month ago

Hello, Any news?

Have a nice day, Azerty

MrMojoR commented 1 month ago

Hello, ah sorry about the late response, I still have the same error with the newest beta, which is 14. Shall I get debug logs? Thanks!

azerty9971 commented 1 month ago

Hello, Yes, please post the system logs so that I can see where things get messy ;)

Thanks in advance, Azerty

Roussesvelte commented 3 weeks ago

Same boat here, as soon as i install Xtend Tuya, all scenes from original Tuya disapear.

Removing Xtend tuya fix it. Can't find anything related in logs..

azerty9971 commented 3 weeks ago

Same boat here, as soon as i install Xtend Tuya, all scenes from original Tuya disapear.

Removing Xtend tuya fix it. Can't find anything related in logs..

Hello, Are you using the latest beta or the stable release?

Have a nice day, Azerty

Roussesvelte commented 3 weeks ago

Hello, Thanks for your fast answer. Pretty noob in HA here, i'm using the v2.0.7 installed viaHACS.

Can't tell if i'm able to use the Beta... on github i can only see Alpha branch, will give it a try.

MrMojoR commented 3 weeks ago

Hello, can I send you the debug logs in private? I think it can contain sensitive data, thanks!

azerty9971 commented 3 weeks ago

No worries,, you can send them at devun999999@gmail.com ;)

They contain your local key for the device (which you can redact if you prefer;) )

Have a nice day, Azerty

azerty9971 commented 3 weeks ago

Hello, I just posted a new BETA build to get more information on what is happening. Can you update to it and resend me your system logs?

Thanks in advance, Azerty

Roussesvelte commented 3 weeks ago

Hello, Just tried your new build (after learning how to SCP my HA) and i have all my scenes from tuya/smartlife AND all my sensors options !!! Thanks mate

azerty9971 commented 3 weeks ago

Hello, Even though that's one way of doing it there are much simpler ways to get the beta builds xD.

In HACS click the 3 dots on the line of extended tuya and select a specific version...

But learning how to use SCP is always useful so congratulations!!!

PS: Est ce que vous êtes vraiment une rousse svelte ? (je suis curieux :))

Have a nice day, Azerty

MrMojoR commented 3 weeks ago

I have tried the newest beta as well, and now it works flawlessly. Interesting, have you fixed something, not only added debug logging?

azerty9971 commented 3 weeks ago

I did indeed :)

But could you still send me the debug log so that I can understand why it failed in the first place?

Thanks in advance :) Azerty

MrMojoR commented 3 weeks ago

I have sent you the logs via email, thanks!