-
-
Notifications
You must be signed in to change notification settings - Fork 33.4k
2025.4.0 Shelly Integration connection problems due to script size #142190
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
Comments
Hey there @balloob, @bieniu, @thecode, @chemelli74, @bdraco, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) shelly documentation |
Please enable debug logging for the Shelly integration, restart HA, wait 10 minutes, disable debug logging, and attach the log file here. |
I had the same problem with one shelly product shelly pro EM 50 with an fixed ip adress on eth. I have restored the last version I'll wait until this problem will be fix for upgrade for the new one. good luck, 05/04 with you |
I had the same issue with 2025.4.0. Only one out of seven Shellys were connected. |
This comment has been minimized.
This comment has been minimized.
@ThomasL1973 Your devices don't respond to Script.GetCode. Could you please remove all scripts on the devices, restart HA and catch the debug log again? |
@bieniu I apology I'm back on 2025.3.4 I can't do it for you :( maybe an information, I have 25 shelly devices only 1 had problems on 2025.4 and this only one have scripts |
Hello I had this very same issue as well. My Shelly pro 1 was working but it does not work anymore. Shelly firmware id is 20250318-152129/1.5.1-g01dd7ff (1.5.1) home-assistant_shelly_2025-04-04T14-13-58.677Z.log |
Have the issue also on 4 Shellys which are connected with heating and light for a terrarium. But if I disable the scripts, the animals get wrong temperatures because the script has the purpose to keep the temperature right! If HA can't access the shellys, no harm will be done, but disabling scripts is just a bad idea. I even checked Firmware both 1.4.4 and 1.5.1beta on the Shelly Plus2PM. |
Can you please clarify which is the issue of your shelly and what the script does ? |
Just have a look at https://codeberg.org/tag/Shelly-Terrariensteuerung.git The error is device communication error. Only the 4 PlusPM which have the terrarium script show the error, the blinds Shelly devices (a lot more, mostly Plus2PM, some 2.5) and all Shellys of other type (Dimmer, 1pm, 1pm mini etc.) are working fine. But if I stop the script, the situation does not improve. The existence of the script on the Shelly seems to cause the problem. This was one of my considerations, why I decided not to let Home Assistant handle these critical things. The Shelly scripts do the regulation of the temperature, and it is important that they run completely independent of Home Assistant. |
I can also confirm that after update to 2025.4 Shelly integration stop working. I use Shelly Pro 1PM with FW 1.5.1 Does integration in 2025.4 download also scripts from shelly? Is this new feature? Maybe have issue with script size? Im make some testing and delete big script_1 and integration start working... Disabling/Enabling script do not help. Only deleting big script help. So maybe big scripts produce issues for integration in latest version... |
I took a quick look at the repo readme and saw, for example, that it suggests creating a sensor to get the script state. This is redundant, since the integration already exposes such sensors. |
Thank you for the hint, will do for sure! Of course I usually try to use existing mechanisms and I wouldn't have created an extra sensor if I'd seen an existing one. |
This issue is a side effect of #135979 and home-assistant-libs/aioshelly#800 We are working on a fix. For those affected, please run this command (few times) for devices with large scripts installed and paste the result here.
CC: @wjtje |
OK ... for my devices the first request takes between 3 and 4 seconds, afterwards it is fast. [core-ssh ~]$ curl -o /dev/null -s -w "Total time: %{time_total}\n" http://terrarium-regel1/rpc/Script.GetCode?id=1 Total time: 3.004770 [core-ssh ~]$ curl -o /dev/null -s -w "Total time: %{time_total}\n" http://terrarium-regel1/rpc/Script.GetCode?id=1 Total time: 0.002051 [core-ssh ~]$ curl -o /dev/null -s -w "Total time: %{time_total}\n" http://terrarium-regel1/rpc/Script.GetCode?id=1 Total time: 0.002232 [core-ssh ~]$ curl -o /dev/null -s -w "Total time: %{time_total}\n" http://terrarium-regel2/rpc/Script.GetCode?id=1 Total time: 3.004514 [core-ssh ~]$ curl -o /dev/null -s -w "Total time: %{time_total}\n" http://terrarium-regel2/rpc/Script.GetCode?id=1 Total time: 0.001956 [core-ssh ~]$ curl -o /dev/null -s -w "Total time: %{time_total}\n" http://terrarium-regel2/rpc/Script.GetCode?id=1 Total time: 0.002595 [core-ssh ~]$ curl -o /dev/null -s -w "Total time: %{time_total}\n" http://terrarium-regel3/rpc/Script.GetCode?id=1 Total time: 3.004166 [core-ssh ~]$ curl -o /dev/null -s -w "Total time: %{time_total}\n" http://terrarium-regel3/rpc/Script.GetCode?id=1 Total time: 0.001753 [core-ssh ~]$ curl -o /dev/null -s -w "Total time: %{time_total}\n" http://terrarium-regel3/rpc/Script.GetCode?id=1 Total time: 0.002177 [core-ssh ~]$ curl -o /dev/null -s -w "Total time: %{time_total}\n" http://terrarium-regel4/rpc/Script.GetCode?id=1 Total time: 3.281378 [core-ssh ~]$ curl -o /dev/null -s -w "Total time: %{time_total}\n" http://terrarium-regel4/rpc/Script.GetCode?id=1 Total time: 0.001888 [core-ssh ~]$ curl -o /dev/null -s -w "Total time: %{time_total}\n" http://terrarium-regel4/rpc/Script.GetCode?id=1 Total time: 0.001512 Edit: It takes 3 seconds again if I wait about 3 seconds or more between the requests. |
One more request, please test this as a custom components (unzip |
With this custom component the Shelly 2 PlusPM with scripts are fine, but now the Dimmer 2 give that error that they can't be initialized. |
This change is not related to gen1 devices. |
This comment has been minimized.
This comment has been minimized.
Let's focus on the main problem. We need to gather as much information as possible whether the custom component solves the problem with large scripts for Gen2+ devices. |
After some simple testing on a Shelly Plus2PM I found the following things:
I think that the best solution is to modify how we get the script from the device by reading in 1024 byte chunks to mimic the web interface of the device. |
Is this "reading script" new "feature" in 2025.4.0 ? Im asking this because same Shelly with same script has work without issues for around 2 years... Only changes which has been made in 2 years has been shelly firmwares and HA updates... |
Yes, although part of it was already at |
|
Shelly 1 PM Running 3 Scripts: Shelly Plus PM Mini - Running 1 Script |
Looks to me the answer time does not matter. All devices do not work since 2025.4.0 (including 2025.4.1). Shelly plus 1PM with two scripts, both deactivated: Plus plug S with no script at all works fine: And all times vary very much, depending on when the device was last accessed... |
The custom component fixed the Shelly integration for all my tested devices. Looks good to me. |
Fixed all Probs |
@thecode But is necessary that HA read script content? Im not sure if someone will use it to read/edit content of script... All this RPC calls work without issues on my device with "big" script which HA 2025.4.X have problems to read them... |
The problem
Shelly 1 PM + Shelly Plus PM Mini don't work anymore with 2025.4.0
They throw communication errors
Shelly 1 Mini Gen3 is working
What version of Home Assistant Core has the issue?
core-2025.4.0
What was the last working version of Home Assistant Core?
core-2025.3.4
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Shelly
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: