Shelly Plus 1 PM power refresh interval

Hi guys,

I’m fairly new with HA and, I’m trying to see how HA can help me to automate and monitor some devices in my home.
One issue or question that I have, is with a Shelly device (plus 1pm), that I’m using to monitor power usage on my HeatPump. I’ve added it in HA via Shelly integration, which seems to be working, but…I’m disappointed that the power data refresh interval is way to high. For ex, when I’m checking the power data on the senzor, sometimes is shows even “20mins ago” data.

How can I make it to capture and show the consumption like ever 1 sec or, at least to a couple of seconds, not minutes.

With regards to HA, I have 2 integrations that I’ve build so far (for testing), one via a Synology NAS with Docker and one inside a VM. (both have same result though)

Thank you.

Did you get an answer for this?

Got a new Shelly Plus 1pm and indeed; refresh time is very different to my other Shelly’s.

My 1pm (not plus) refreshed every 15s and so does the a 3EM.

Hello, I just experienced the same issue.
I solved it by defining an additional REST sensor in yaml that polls the local Shelly Gen 2 Device API every second:

rest:
  - resource: "http://<local ip of your shelly>/rpc/Switch.GetStatus?id=0"
    scan_interval: 1
    timeout: 1
    sensor:
      - name: "Shelly Power"
        value_template: "{{ value_json.apower | round(0) }}"
        device_class: "power"
        unit_of_measurement: "W"
        icon: "mdi:solar-power"
        unique_id: "put something here to be able to customize the entity via UI"
        # force_update: true

I round the value provided by the Shelly to prevent negligible changes to be stored in the database. I don’t care about fractions of Watts and besides that I don’t think a Shelly measures that accurate at all.

I used force_update to test if it works and disabled it to prevent unchanged values being written to the database.

During my experiments I experienced that reloading REST or even all YAML configuration did not reload this sensor. Maybe because I defined it in packages. HA restart applied the YAML changes though.

1 Like

Thanks for that, works like it should.

thanks a lot also from my side…

here you can see the good result

I just noticed the same issue with Shelly Plus Plug S’s and PM Mini gen3’s after updating these from 1.4.2 to 1.4.4.

Is there any way to use your solution to update the existing sensors (instead of creating new ones) so that I do not have to recreate the sankey chart that tracks power consumption of all the Shelly’s I’ve got?

You could rename the sensor entities of the Shelly integration and then define the rest sensor names to match the original names used in your chart.

Hmm, that’s an idea :slight_smile:

Also:
" I used force_update to test if it works and disabled it to prevent unchanged values being written to the database."

So unchanged values are not written by default? I was already thinking of adding an if-statement to only process new values if they are not equal to the last one.

Not sure if this will do it but have you setup and enabled RPC? Arcticle here: Shelly - Home Assistant

Tuxinator94 Uhm, I didn’t have to, Home Assistant picked the devices up without problems and gets values, just suddenly a whole lot less often since a firmware update.

I suggested it to see if the data updates for frequently using RPC protocol.

Ah okay :slight_smile: , enabled it and set ws:/HASS-IP:8123/api/shelly/ws (later tried wss://), followed by rebooting the plug. After startup it sends data, then it goes quiet for long periods of time again, especially compared to gen1’s.

So no change.

1 Like