JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
957 stars 80 forks source link

Service not found (tap action switch.privacy) #491

Closed ciclocaffe closed 6 months ago

ciclocaffe commented 6 months ago

Description

Hi, I get a "service not found error" when I try to execture tap_action to switch privacy on/off. The code is copied from "custom stack in card lovelace examples .

Reproduction Steps

Full lovelace stack in card code

`type: custom:stack-in-card cards:

Expected behavior

privacy should turn on or off when switch is pressed

If applicable, add error logs.

No response

Device Firmware

1.3.11 Build 231117

Integration Version

latest

Using stream component

Yes

Does camera work via official integrations?

Yes

Camera has all attributes filled out in developer tools

Yes

HASS Environment

Rpi4

Search for similar issues

Yes

Additional information

No response

JurajNyiri commented 6 months ago

You have entity_id there twice with incorrect entity, that is not the way how it is in the docs. Docs work.

ciclocaffe commented 6 months ago

Hi, sorry I don't understand then., In your examples you are using scripts which I'm not using. In the integration I found the entity switch.camera3_privacy and I just need to trigger that on tap_action. I don't see an example using that and I'm not understanding where the mistake is..? thanks

JurajNyiri commented 6 months ago
Screenshot 2024-01-04 at 14 21 23

You have entity_id there twice which is incorrect, there is no button.press service on camera entity.

As for switch services, see https://www.home-assistant.io/integrations/switch/ .

ciclocaffe commented 6 months ago

I see that's the same in the card stack in example:

`type: custom:stack-in-card cards:

also these buttons are working fine. I managed to get the switch working somehow:

- type: button icon: mdi:eye-off-outline tap_action: action: call-service service: switch.toggle service_data: entity_id: switch.camera3_privacy entity_id: camera.camera3_hd_stream

thanks

JurajNyiri commented 6 months ago

There are 2 entities there but the padding matters, it got lost in your code/message since it was not formatted properly.

Screenshot 2024-01-04 at 14 50 41

Glad you got it working!