rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.84k stars 545 forks source link

Component error: localtuya - Integration 'localtuya' not found. #109

Closed snowgumrd closed 3 years ago

snowgumrd commented 3 years ago

I just upgraded to 3.0.3 in HACS and I got this error message "Component error: localtuya - Integration 'localtuya' not found."

It was working for my switch before but not my light (which I've raised another issue for).

I've commented it out of my configuration.yaml for now. Am I the only one seeing this?

postlund commented 3 years ago

Stick with 3.0.1.

snowgumrd commented 3 years ago

Stick with 3.0.1.

Ok. I'll roll it back.

snowgumrd commented 3 years ago

Unfortunately, even after rolling it back, 'Check Config' keeps protesting that the integration cannot be found. I then commented out my configuration.yaml and that stopped the error message appearing.

I've uninstalled it for now, which is sad because the energy monitoring part of it was working great. I'll watch this with great interest until it's safe to try again.

postlund commented 3 years ago

I hope that we should have this sorted out soon, but 3.0.1 should really work. Remember that you have to restart Home Assistant after rolling back, otherwise "Check Config" will continue to complain because integrations are only loaded during start up. So simply rolling back without restarting is not enough.

@rospogrigio What's left to solve this? I feel that I kinda looked the other way a bit when the shit hit the fan when working on other things...

rospogrigio commented 3 years ago

@rospogrigio What's left to solve this? I feel that I kinda looked the other way a bit when the shit hit the fan when working on other things...

Well, first of all I didnt' have this feeling so don't worry 😉 It's unclear to me, now all the checks at https://github.com/hacs/default/pull/662 are passed (apart from the Optional "fork" one), but need 3 reviewers to approve it in order to merge. And at the beginning it was clearly written to not being pushy otherwise the PR would be deleted. I also left a message a couple of days ago asking whether I should do something else but I guess we just have to wait, unless you have other proposals. Maybe we should produce a 3.0.4 reverting to 3.0.1? But I'm afraid it would break these checks...

postlund commented 3 years ago

Well, first of all I didnt' have this feeling so don't worry 😉 It's unclear to me, now all the checks at hacs/default#662 are passed (apart from the Optional "fork" one), but need 3 reviewers to approve it in order to merge. And at the beginning it was clearly written to not being pushy otherwise the PR would be deleted. I also left a message a couple of days ago asking whether I should do something else but I guess we just have to wait, unless you have other proposals. Maybe we should produce a 3.0.4 reverting to 3.0.1? But I'm afraid it would break these checks...

Right, then we should probably just sit tight for now and hope for the best. I know that there usually are a PR race, having a bunch of PRs merged to at once. So hopefully this will happen soon. We should probably not do a 3.0.4 for now, better to wait.

Would be really good if you could have a look at #100 btw, so we can merge that. Hopefully we can rebase #97 after that and have that merged too.

snowgumrd commented 3 years ago

I'm happy to help if I can with logs, etc. I did restart after the roll back but the check config still came up.

Unfortunately, even after rolling it back, 'Check Config' keeps protesting that the integration cannot be found. I then commented out my configuration.yaml and that stopped the error message appearing.

I've uninstalled it for now, which is sad because the energy monitoring part of it was working great. I'll watch this with great interest until it's safe to try again.

I hope that we should have this sorted out soon, but 3.0.1 should really work. Remember that you have to restart Home Assistant after rolling back, otherwise "Check Config" will continue to complain because integrations are only loaded during start up. So simply rolling back without restarting is not enough.

@rospogrigio What's left to solve this? I feel that I kinda looked the other way a bit when the shit hit the fan when working on other things...

snowgumrd commented 3 years ago

If it helps, I realised that even after commenting out the config.yaml, the integration persists and was visible under configuration/integrations. I tried deleting it to see if I can restore to 3.0.1

postlund commented 3 years ago

Try this:

  1. Leave config in configuration.yaml and start/restart Home Assistant
  2. Go to Integrations and remove all integrations for localtuya
  3. Remove from configuration.yaml
  4. Restart Home Assistant
  5. Downgrade to 3.0.1
  6. Restart
  7. Hopefully profit
snowgumrd commented 3 years ago

Try this:

  1. Leave config in configuration.yaml and start/restart Home Assistant
  2. Go to Integrations and remove all integrations for localtuya
  3. Remove from configuration.yaml
  4. Restart Home Assistant
  5. Downgrade to 3.0.1
  6. Restart
  7. Hopefully profit

ok. I got it back. I commented out the integration in configuration.yaml, and removed it from the configuration interface as well, restarted a couple of times for good measure, then tried installing 3.0.1 on HACS, and added the (known to be working) switch back via Yaml (using the interface to set it up resulted in errors*).

*Logs from the error above are below. I tried using protocol 3.1 and 3.3 with no luck either way.

Protocol 3.3 Logger: custom_components.localtuya.config_flow Source: custom_components/localtuya/pytuya/init.py:429 Integration: LocalTuya (documentation) First occurred: 8:33:24 AM (1 occurrences) Last logged: 8:33:24 AM

Unexpected exception Traceback (most recent call last): File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/config_flow.py", line 238, in async_step_basic_info self.dps_strings = await validate_input(self.hass, user_input) File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/config_flow.py", line 173, in validate_input detected_dps = await interface.detect_available_dps() File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/pytuya/init.py", line 466, in detect_available_dps data = await self.status() File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/pytuya/init.py", line 429, in status if "dps" in status: TypeError: argument of type 'NoneType' is not iterable

Protocol 3.1 Unexpected exception Traceback (most recent call last): File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/config_flow.py", line 238, in async_step_basic_info self.dps_strings = await validate_input(self.hass, user_input) File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/config_flow.py", line 173, in validate_input detected_dps = await interface.detect_available_dps() File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/pytuya/init.py", line 466, in detect_available_dps data = await self.status() File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/pytuya/init.py", line 428, in status status = await self.exchange(STATUS) File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/pytuya/init.py", line 407, in exchange msg = await self.dispatcher.wait_for(seqno) File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/pytuya/init.py", line 206, in wait_for await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout) File "/opt/Home-Assistant/lib/python3.8/asyncio/tasks.py", line 490, in wait_for raise exceptions.TimeoutError() asyncio.exceptions.TimeoutError

TheFes commented 3 years ago

I have a similar problem. LocalTuya does not show up in my Integrations panel. It did before, but I didn't put any effort in getting the keys at that time, so I was not able to add a light/switch. So I cancelled the installation, and the integration was not showing up op the page, but it was still possible to add it using the dropdown.

The the upgrades to 3.02 and 3.03 came, and since I kinda hate notifications nagging me about updates, I installed them. Apparantly that broke the integration.

I have been spending some hours on it now, but I can not get it back in the integrations dropdown. I have downgraded to 3.01 and restarted I have removed it completely, restarted, installed 3.01 and again restarted I have removed it again, restarted over 3 times, reinstalled it, restarted again for at least 3 times

But no LocalTuya in the dropdown anymore.

I then tried adding it manually, which did not trigger the error described in the post above. After a reboot, the entity was visible (but unavailable) but that is probably a fault in my config.

The integration now does show up on the integration page, but states I can not edit options since I use the yaml files. After removing the config in the yaml file, and a reboot, the device and corresponding entity still show on the integrations page though.

I then removed the integration, and when I try to add it using the + and the dropdown, it doesn't show in the list.

How can I use this install method?

postlund commented 3 years ago

Try this:

  1. Leave config in configuration.yaml and start/restart Home Assistant
  2. Go to Integrations and remove all integrations for localtuya
  3. Remove from configuration.yaml
  4. Restart Home Assistant
  5. Downgrade to 3.0.1
  6. Restart
  7. Hopefully profit

ok. I got it back. I commented out the integration in configuration.yaml, and removed it from the configuration interface as well, restarted a couple of times for good measure, then tried installing 3.0.1 on HACS, and added the (known to be working) switch back via Yaml (using the interface to set it up resulted in errors*).

*Logs from the error above are below. I tried using protocol 3.1 and 3.3 with no luck either way.

Protocol 3.3 Logger: custom_components.localtuya.config_flow Source: custom_components/localtuya/pytuya/init.py:429 Integration: LocalTuya (documentation) First occurred: 8:33:24 AM (1 occurrences) Last logged: 8:33:24 AM

Unexpected exception Traceback (most recent call last): File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/config_flow.py", line 238, in async_step_basic_info self.dps_strings = await validate_input(self.hass, user_input) File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/config_flow.py", line 173, in validate_input detected_dps = await interface.detect_available_dps() File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/pytuya/init.py", line 466, in detect_available_dps data = await self.status() File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/pytuya/init.py", line 429, in status if "dps" in status: TypeError: argument of type 'NoneType' is not iterable

Protocol 3.1 Unexpected exception Traceback (most recent call last): File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/config_flow.py", line 238, in async_step_basic_info self.dps_strings = await validate_input(self.hass, user_input) File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/config_flow.py", line 173, in validate_input detected_dps = await interface.detect_available_dps() File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/pytuya/init.py", line 466, in detect_available_dps data = await self.status() File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/pytuya/init.py", line 428, in status status = await self.exchange(STATUS) File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/pytuya/init.py", line 407, in exchange msg = await self.dispatcher.wait_for(seqno) File "/share/CACHEDEV1_DATA/.qpkg/Home-Assistant/CONFIG_DIR/custom_components/localtuya/pytuya/init.py", line 206, in wait_for await asyncio.wait_for(self.listeners[seqno].acquire(), timeout=timeout) File "/opt/Home-Assistant/lib/python3.8/asyncio/tasks.py", line 490, in wait_for raise exceptions.TimeoutError() asyncio.exceptions.TimeoutError

This bug is probably fixed on master. I hope we can get the HACS PR merged soon.

postlund commented 3 years ago

I have a similar problem. LocalTuya does not show up in my Integrations panel. It did before, but I didn't put any effort in getting the keys at that time, so I was not able to add a light/switch. So I cancelled the installation, and the integration was not showing up op the page, but it was still possible to add it using the dropdown.

The the upgrades to 3.02 and 3.03 came, and since I kinda hate notifications nagging me about updates, I installed them. Apparantly that broke the integration.

I have been spending some hours on it now, but I can not get it back in the integrations dropdown. I have downgraded to 3.01 and restarted I have removed it completely, restarted, installed 3.01 and again restarted I have removed it again, restarted over 3 times, reinstalled it, restarted again for at least 3 times

But no LocalTuya in the dropdown anymore.

I then tried adding it manually, which did not trigger the error described in the post above. After a reboot, the entity was visible (but unavailable) but that is probably a fault in my config.

The integration now does show up on the integration page, but states I can not edit options since I use the yaml files. After removing the config in the yaml file, and a reboot, the device and corresponding entity still show on the integrations page though.

I then removed the integration, and when I try to add it using the + and the dropdown, it doesn't show in the list.

How can I use this install method?

The config in YAML basically create (or update an existing) config entry. Removing from YAML will not remove the config entry, so it will still be listed under Integrations. You will have to manually remove it. If you have a loaded integration but it's not listed in the Integrations list I suspect a caching error. Try forcing a browser refresh.

linkmaks commented 3 years ago

Hi, I just wanted to say that I faced the same problem as @TheFes did. Hope it'll be fixed soon, because nothing helps now

TheFes commented 3 years ago

For me it appeared to be a caching issue like @postlund mentioned. On another system it did work.

snowgumrd commented 3 years ago

So if it helps @linkmaks and @TheFes , what I did was comment out the config in the configuration.yaml file AND remove the integration from the Configuration / Integration page. Then along the way, I might've restarted HA a couple of times (my NAS was getting updated). Shortly after, I wasn't seeing the error any more. Then I reinstalled using 3.0.1 and that seems to have at least restored my switch.

rospogrigio commented 3 years ago

@postlund I see you reviewed https://github.com/hacs/default/pull/662 ... how have you done? We still need 2 reviewers, do you think we can ask for a review in the Conversation?

postlund commented 3 years ago

@rospogrigio Once you get something merged you can join the team and for instance do reviews. Maybe, I have honestly not read all the rules thoroughly. Would be great to have it merged soon though...

rospogrigio commented 3 years ago

@postlund yes, I see that there are older PRs still waiting but the queue is getting a bit long... hope they'll merge it soon.

stanwebber commented 3 years ago

so if I just wait this will fix itself in the next hacs release? I'm on 3.0.3 and now have this issue, but given the directions to downgrade and lose my config I'd rather just wait even if it takes awhile.

postlund commented 3 years ago

Should be fixed now.