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

HA not sending open or close signals at once to multiple shades #20

Open
senolsun opened this issue Aug 24, 2023 · 24 comments
Open

HA not sending open or close signals at once to multiple shades #20

senolsun opened this issue Aug 24, 2023 · 24 comments

Comments

@senolsun
Copy link

Hello.

When I set up an automation to control multiple shades at once with a single automation line, only one of the shades get the signal and the other one doesn't. ESPSomfy shows both shades as open but in reality the signal is sent to only one shade.
Ekran Resmi 2023-08-24 12 24 36

@rstrouse
Copy link
Owner

You should use the grouping functionality in ESPSomfy RTS. It is loads more efficient and the correct way to send multiple commands to the motors.

@senolsun
Copy link
Author

thanks, that worked, however it doesn't change the fact that my previous workflow fails, so this still remains as an issue in my opinion. Feel free to close it.

@ElmarJordan
Copy link

Hello

I have organized my shutters in groups. Control by group also works great. If I address the group in an automation, I can also trigger this directly and the shutters are controlled. Time-controlled, the automation is displayed as listed, but the shutters are not controlled.

@rstrouse
Copy link
Owner

@ElmarJordan what service are you calling?

@ElmarJordan
Copy link

here are two examples of open or close
image

  • id: '1695801826705'
    alias: Rolladen im Kinderzimmer Links öffnen Woche
    description: ''
    trigger:
    • platform: time
      at: 05:45:00
      condition:
    • condition: time
      weekday:
      • mon
      • tue
      • wed
      • thu
      • fri
        action:
    • service: cover.open_cover
      data: {}
      target:
      entity_id: cover.kinderzimmer_links
      mode: single

image

  • id: '1695801973334'
    alias: Rolladen im Kinderzimmer Links schließen
    description: ''
    trigger:
    • platform: sun
      event: sunset
      offset: +00:35
    • platform: time
      at: '21:15:00'
      condition: []
      action:
    • service: cover.close_cover
      data: {}
      target:
      entity_id: cover.kinderzimmer_links
      mode: single

@rstrouse
Copy link
Owner

Interesting. It appears the close_cover service is not supported by cover groups in HA. I will chase that down. Change that service to use the ESPSomfy RTS: Close Shade service. Your automation will then work.

image

alias: New Automation
description: ""
trigger:
  - platform: time
    at: "09:50:00"
condition: []
action:
  - service: espsomfy_rts.close_shade
    data: {}
    target:
      entity_id: cover.group1
mode: single

@ElmarJordan
Copy link

thank you I will try it an give you an feedback

@rstrouse
Copy link
Owner

rstrouse commented Sep 28, 2023

I figured out the reason why it does not show support for the close_cover service. This has to do with the way groups are defined in HA. Home assistant does not set up the group completely until it gets refreshed the first time. So if your click the 3 dots on the integration and press reload it with also start working even with the close_cover service.

I will have to find a way around the group initialization code to make it finish setting it up.

EDIT: It also correctly sets itself up if you restart Home Assistant.

@rstrouse
Copy link
Owner

@senolsun in v2.1.8 I have made the async process for the send the commands one at a time so your previous setup should work fine. HA was running the steps in conjunction so it was executing the services for each of the entities at the same time. The radio can only send these sequentially.

@ElmarJordan
Copy link

With the ESPSomfy RTS: Close Shade / ESPSomfy RTS: Open Shade service it works now. What I have also noticed is that if I address in two different automations with two different groups also only one works. I have separated the automations by one minute so it works. The only thing that remains is that the reception of my remote controls (Smoove 1 RTS) is very unreliable. Is this due to the remote control or the reception of the ESP32/CC1101?

@rstrouse
Copy link
Owner

rstrouse commented Oct 1, 2023

Is this due to the remote control or the reception of the ESP32/CC1101?

I have had receivers that had poor range. And another user just recently changed out their esp32 and a motor that previously wouldn’t even pair finally worked. In v2.1.8 there is a frequency scanner that you can try to see if perhaps the smoove isn’t tuned to very well. ESPSomfy RTS can be adjusted with that.

@ElmarJordan
Copy link

Thanks the function I had already found and experimented with the frequencies. But unfortunately did not bring any improvement, the default frequency 433.420 is the best.

@Nickduino
Copy link

@senolsun in v2.1.8 I have made the async process for the send the commands one at a time so your previous setup should work fine. HA was running the steps in conjunction so it was executing the services for each of the entities at the same time. The radio can only send these sequentially.

Shouldn't that be managed by the ESP32 (when it receives N commands, it sends them 1 by 1 with a 0.5 s delay for instance)? That way, it would work with all integrations.

Is this due to the remote control or the reception of the ESP32/CC1101?

Radio hams tend to say that there is more to gain with a good reception than with a the transmission. And there's the law (you can emit high power without a ham licence). And there's the fact you can't really improve the transmission power of your Somfy remote. So moving your ESPSomfy and/or changing its antenna is your best bet.

@rstrouse
Copy link
Owner

Shouldn't that be managed by the ESP32 (when it receives N commands, it sends them 1 by 1 with a 0.5 s delay for instance)? That way, it would work with all integrations.

Not really as the radio wasn't the overall issue. HA was firing off the http requests all at once (near parallel) and the ESP32 is not fast enough to negotiate a closed connection and respond before HA sent the command for the next motor so it would fail because the api was being interrupted before it could say 200.

The await ensures it does not start a new http request before the old one is negotiated. This shouldn't be an issue anymore since the radio serializes faster than the aio can deliver. The timing is around 170ms per repeat and cannot be shortened over the interframe silence anyway.

The only way to make all the shades move at the same time is to send the grouped shade command which amounts to a single frame (or repeated). But the coverGroup in HA is wonky when you want to set a position on the group. Up/Down/My have all been optimized to send only one frame. With a position target HA will fire these off for each motor on separate threads. While the position will be accurate there may be a very small subsecond delay between motors at the start.

@Nickduino
Copy link

Not really as the radio wasn't the overall issue.

I had misunderstood, my bad.

@Baseje
Copy link

Baseje commented Jan 31, 2024

I experience the same issue;
When i've created an group in ESPSomfy and push the button to down/up for the group both motors go instantly and together on the same time. But when i push the group (which is automatically created by the integration) in Home Assistant, there is an short delay of 1/2 seconds between both motors.
Its looks like the intergration didn't use the same action in ESPSomfy as the button on the webinterface.
Any idea?

@rstrouse
Copy link
Owner

rstrouse commented Feb 1, 2024

The up,down, and my buttons should send only 1 command from the plug-in. This is true for me. Setting a target position is another story though as HA breaks it down into individual commands. Since the transceiver can only send one command at a time, it takes at least 170ms plus 170ms times the number of repeats.

@daviss57
Copy link

I've had the following issue when grouping shades. When I set the position to say 50% the blinds all go to different positions. It seems like it averages the movement of all to add up to a 50% movement. One bond may have moved 10mm and another might have moved 500mm. Had to go back to sending individual commands with 1 second. delay

@rstrouse
Copy link
Owner

That's new. Which HA version are you running. It would really be stupid if the covergroup started issuing stop commands.

@daviss57
Copy link

That's new. Which HA version are you running. It would really be stupid if the covergroup started issuing stop commands.

2024.4.2

@daviss57
Copy link

Screenshot_20240410_235326_Chrome

Is it related to this section in the notes?

@rstrouse
Copy link
Owner

Nope the HA cover group entity is a different animal that seems to have gotten some attention lately. ESPSomfy RTS is issuing a single command for up/down/my when any of those buttons are pressed but when the covergroup position is set from within HA all bets are off and it attempts to seek the position itself. I wish it wouldn't.

@Nickduino
Copy link

Does HA need to know the group is a grouped command?

@daviss57
Copy link

Nope the HA cover group entity is a different animal that seems to have gotten some attention lately. ESPSomfy RTS is issuing a single command for up/down/my when any of those buttons are pressed but when the covergroup position is set from within HA all bets are off and it attempts to seek the position itself. I wish it wouldn't.

That may explain it so. When I use the up down command from HA, all works OK. It's only when I give the set position command that it goes haywire.
Anyway, I've reverted to using the individual command for each shade.
Great project. Thanks.

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

6 participants