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)
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.