Hello,
I’m currently using Shelly official integration for HA. I have installed a Shelly EM to measure consumption at my home. However I see on the shelly app the update interval is a bit quicker while on HA I’m getting new readings every 30 seconds.
I’ve taken a look at the integration help page but it seems no way to change that update interval, say to 2 or 5 seconds instead of 30. Also on the Shelly web interface for the device there’s no interval configuration either.
Any ideas if something can be done using the official Shelly integration?
I’m only just getting started with these. I’ve not found if the frequency can be increased on the official integration.
MQTT seems to report instantly on state changes.
You can also manipulate the frequency that the Shelly reports it’s status to the MQTT broker too. A little more config to setup some sensor devices to hold the status, but looks like it will work fine.I’ve not set it up yet though but there looks to be plenty of examples to follow here on the forum.
I can report back on my progress if you are interested.
Place it in the \config\custom_components\shelly
folder of your HA installation.
Modifiy the const.py file, in my case (Shelly 3EM) changing line 68 UPDATE_PERIOD_MULTIPLIER: Final = 2.2
to UPDATE_PERIOD_MULTIPLIER: Final = 0.22
did the trick.
Modify the manifest.json file by adding a “version”, otherwise the custom integration won’t be loaded
Don’t forget the “,” after "loggers": ["aioshelly"],
UPDATE:
I got rarely timeouts from the polling, so I also changed line 52 to a 10th of the value POLLING_TIMEOUT_SEC: Final = 1.8
I will report if it didn’t work.
I amb using the official shelly integration from HA, since it worked perfect from first day I didn’t bother to try other alternatives.
The only change I did in the shellys is adding HA_SERVER_IP:5683 in the CoIoT config, there was mcast by default. Not sure if this helps with the update interval.
Thanks for your reply!
10 seconds updating would be fine for me. I am using the same settings but with port 8123 (I don’t know why, it’s some time I integrated the shellys).
I tried port 5683 and that works for me (updates in intervals between 1 and 15 seconds)! Thank you very much @tonicb !
Maybe another approach to this:
Fixed it with configuring mqtt to my homeassistant instance, even tho I’m not using the data from mqtt but the standard integration as mentioned. Seems to work perfectly this way
Shelly integration is does not pull devices. Instead the device is pushing updates upon changes.
Polling is only used when push updates are not working as a backup, please do not modify the polling interval, you are overloading HA and the device. Please make sure you have setup unicast correctly and if updates are still slow create an issue.
I found this thread after searching for a way to change the sample rate of a Shelly Plus Plug S v2 device.
I have been using one of these just to detect a sudden increase in the power supply by using a Trend binary sensor. This used to work just fine until I updated its firmware to it latest version, which now seems to have changed the sample rate to 6 seconds (I could swear it used to be as short as 2 seconds or so).
So, by analysing the evolution of the gradient attribute of that sensor, I can tell that it gets no where to what I used to have. The sensor was set to a min gradient of 35 (meaning a 70W increase in two seconds), but now it gets as much as 9 or 10 (I guess due to the new interval between samples).
So, did anyone notice the same thing with your Shelly Plus Plug S? Had I known better, I wouldn’t have upgraded it and now I can’t find a way to downgrade it back to where it was.