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

how to turn_off/turn_on switches? #682

Closed
kumarunster opened this issue Jan 16, 2025 · 2 comments
Closed

how to turn_off/turn_on switches? #682

kumarunster opened this issue Jan 16, 2025 · 2 comments

Comments

@kumarunster
Copy link

Hi, trying to turn_off/turn_on switches like


service.call('switch', 'turn_off', entity_id='switch.sonoff_10018af19d_1')
switch.turn_off(entity_id='switch.sonoff_10018af19d_1')

but nothing works. But calling the service from home assistant developer -> actions with

action: switch.turn_off
target:
  entity_id: switch.sonoff_10018af19d_1
data: {}

works as expected. Any hint, how to achieve the same with pyscript?

@craigbarratt
Copy link
Member

Are you sure that code is being executed? It would be good to turn on debug logging to see if it is being executed.

@kumarunster
Copy link
Author

my bad
was connected to wrong remote Home Assistant instance
closing that issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants