fishbigger / HomeAssistant-Tapo-P100-Control

A custom integration for home assistant to control the Tapo P100 plugs
MIT License
208 stars 69 forks source link

HA only finds one instead of multiple P100 plugs #14

Closed H4R81 closed 3 years ago

H4R81 commented 3 years ago

Hi there, I'm pretty new to HA, but I manged that one TAPO P100 plug is shown within the enteties. So, in fact I have 5 plugs, which should be shown within the enteties. How should the config entries look alike.

I tried the following versions, but none of them worked out.

Version 01:

P100 or P105 Plug

switch: platform: tapo_p100_control ip_address: 192.168.xxx.xxx email: @. password:

P100 or P105 Plug

switch: platform: tapo_p100_control ip_address: 192.168.xxx.xxx email: @. password:

Version 02:

P100 or P105 Plug

switch: platform: tapo_p100_control ip_address: 192.168.xxx.xxx email: @. password:

 platform: tapo_p100_control
 ip_address: 192.168.xxx.xxx
 email: ***@***.**
 password: **
richard-scott commented 3 years ago

As long as your indentation is correct, that looks pretty good Yaml. Are all the 5 devices linked to your Tapo App on your phone? Once you have named them all in the App, they use those names on HA when it starts up. If the devices are offline when HA starts they won't show up.

H4R81 commented 3 years ago

Thanks for your response, but what do you mean with indentation. All of the devices are linked to my Tapo App.

richard-scott commented 3 years ago

The indentation is the yaml formatting. It wasn't clear from your original post that you'd created the content like this:

#P100 or P105 Plug
switch:
  platform: tapo_p100_control
  ip_address: 192.168.xxx.xxx
  email: @.**
  password: **

Also, add some logging to your configuration.yaml to see what errors it produces:

logger:
  logs:
    custom_components.tapo_p100_control: DEBUG

After restarting Home Assistant there should be sometihng in there regarding the p100 module.

H4R81 commented 3 years ago

Ok, the logs says that I have duplicate keys for "switch". 2021-03-22 11:42:00 WARNING (SyncWorker_0) [homeassistant.util.yaml.loader] YAML file /config/configuration.yaml contains duplicate key "switch". Check lines 14 and 21

I'm using the following code:

P100 or P105 Plug

switch: platform: tapo_p100_control ip_address: 192.168.xxx.xxx email: @. password:

P100 or P105 Plug

switch: platform: tapo_p100_control ip_address: 192.168.xxx.xxx email: @. password:

After the restart I only find the last device from the config in HA as entity.

richard-scott commented 3 years ago

Merge the code:

switch:
  #P100 or P105 Plug
  - platform: tapo_p100_control
    ip_address: 192.168.xxx.xxx
    email: @.**
    password: **

  #P100 or P105 Plug
  - platform: tapo_p100_control
    ip_address: 192.168.xxx.xxx
    email: @.**
    password: **
H4R81 commented 3 years ago

I already tried the merge, but then I've received same duplicate error with the parameters ("platform", "ip_adress", ...)

But actually I've solved the problem. The following code worked out.

P100 or P105 Plug

switch 1: platform: tapo_p100_control ip_address: 192.168.xxx.xxx email: @. password:

P100 or P105 Plug

switch 2: platform: tapo_p100_control ip_address: 192.168.xxx.xxx email: @. password:

Thanks for your help.

H4R81 commented 3 years ago

Just reopened, if someone has a similar issue.

richard-scott commented 3 years ago

It's ok to close it. people can search closed issues for help if they need it :-)