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

Switch service call order not guaranteed? #66

Open
bezenson opened this issue Dec 19, 2022 · 3 comments
Open

Switch service call order not guaranteed? #66

bezenson opened this issue Dec 19, 2022 · 3 comments

Comments

@bezenson
Copy link

While we don't know real status of RF devices in some automations I call "switch off" first and then "switch on" (because actually my RF lights controller works in "toggle" mode. But I found that light can be turned on and then turned off. It looks like RF call order is random.

Maybe it is an issue. Or maybe it is something specific, I don't know.

@markvader
Copy link
Owner

I don't know the answer offhand but am wondering what delay you place between commands?

@markvader
Copy link
Owner

As your lights work in toggle mode, is the controller not fussy about differentiating between on and off codes, i.e. it accepts either code as on, and either code as off?

@bezenson
Copy link
Author

bezenson commented Dec 19, 2022

I'll try to explain. I have a light controller with 3 channels - "A", "B", "C" buttons. And also there is "Off" button which turns off all channels. I've added that buttons as switches into home assistant config where "On" command is A, B or C. And "Off" command is always as "Off" button.

For example in my automation I expect that only "A" channel will be turned on. But while I don't know about status of other channels - first I call "Switch OFF" on all channels (Off button on controller) and then "Switch On" on "A" channel.

And very often I'm catching that situation that light turns on (because "A" turns on) and then very fast turns off (I guess because off action stuck and called after in some reasons).

I also tried to add delay, but this not fixes a problem.

action:
  - service: switch.turn_off
    target:
      entity_id: switch.living_room_light
    data: {}
  - delay:
      seconds: 1
  - service: switch.turn_on
    target:
      entity_id: switch.living_room_light_a
    data: {}

image

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