Shelly integration (MQTT faster than CoIoT)

Hey there,

Last week I decided to rebuild my Home Assistant configuration. In my old configuration I’ve used Shell4Hass 3th party integration to control my Shelly devices and wanted to switch over to Home Assistant’s Shelly integration.

This comes with some issues, as Home Assistant’s Shelly integration uses CoIoT instead of MQTT. It seems that reporting the state of devices is a lot slower with CoIoT than MQTT. I’ve been running nc -ulp 5683 and next to it a MQTT Analyzer that subscribed to a topic that reports the state. The MQTT Analyzer reported far more events than CoIoT.

For some automation/triggers I do need a fast update interval as some of my devices uses 2000 watt for 5 seconds, which MQTT did catch really well.

I came up with a possible solution/workaround for my problem by turning on MQTT on all my Shelly devices and create triggers on the MQTT that will listen for those updates and overwrite’s the Shelly integration device values to update them faster.

Are there any other solutions or workarounds for this issue (which is better than my initial idea)?

Had same problem, because of this I have created mqtt sensors:

  • name: “Meterkast Power Usage”
    state_topic: “shellies/shelly-meterkast/relay/0/power”
    unit_of_measurement: “Wh”
    icon: mdi:flash
    device_class: energy

Below you can see a higher frequency on update via MQTT

this is based on shelly integration:

this is based on shelly mqtt:

I’m running into the same issue, in my case with weird power consumption graphs as a result (positive and negative spikes that shouldn’t be there).

There’s a template sensor that does some math involving the power sensors from the ShellyPlugs and the smart electricity meter from the power company.

The ShellyPlugs spit out data at seemingly random times (but 15s max), while the electricity meter spits out data once a second continuously. When the meter shows lower consumption, while the Shelly’s haven’t done that, the graphs show spikes and not sure how to fix this without replacing everything with MQTT.

I’m curious if there’s any way to have the values coming in through MQTT (once I set that up) linked to the pre-existing sensors from the Shelly integration. Is there any way to do that? As in add (not sum) all values coming in through MQTT to the power sensors from the Shelly integration?