Official Shelly Integration not working with battery powered devices, that enter sleep mode

Hello, for almost a year now, I’ve had an issue with the Shelly integration, for which I’ve requested help on discord multiple times, to no avail.

Basically, the official Shelly integration will not work with any Shelly device that spends most of its time in sleep mode (the Shelly H&T, H&T plus and the magnetic door sensor).

If I manually wake up such a device, the Shelly integration works perfectly and data is continually collected.
However, once they enter sleep mode, no data will ever be sent again to the integration, no matter how long I wait.
The devices work as they should, they wake up, connect to wifi, send data and then go back to sleep, but the Shelly integration will never again see them and will never get this data.

This is especially evident with the Shelly H&T Plus, which has a screen that shows you when it collects data and flashes a symbol when it connects to wifi to send that data.
I’ve checked the router and the sensors do connect to wifi for a moment, before going dark again, as they should.

3 Likes

I have the same issue with Shelly TRV. That’s also a battery-powered device.

The only thing in the logs is this, I guess it confirms that the device is just sleeping:

2022-10-09 14:16:29.002 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shellytrv-8CF68108A5CD data: Sleeping device did not update within 3600 seconds interval

It’s unfortunate. The device is working perfectly on its own.

Any luck with solving it @MMMMmmmmmm?

1 Like

I no longer have any gen 1 devices, but the issue remains unfixed for the gen 2s that weren’t working.

1 Like

I have the same problem with a shelly TRV. I use CoIoT with unicast configured but the device is unavailable after some hours after waking it up manually. It is really annoying because I can basically not use any automation with that behavior.

This is the case with my “Morning” routine where I want to set the bathroom to be ready for the family. I have now put all settings in a script that I then start from my automation. Not the normal “call” a script, because that will then just also fail. I use the Script Tun On service. That starts the script in parallel to the automation sequence. The sequence then waits. This Script Turn On is captured in a while loop that checks is a certain boolean is set. That boolean is set as the last step in the script. So if the script fails, this boolean does not get set - and the whole sequence is tried again. So far it is always ready to rock with the second run through the script – so it is possibly some time-out in the Shelly integration that is too short.

automation:

alias: Activate Climate Morning
description: ""
trigger:
  - platform: time
    at: "05:30:00"
condition: []
action:
  - service: input_boolean.turn_on
    target:
      entity_id:
        - input_boolean.climate_scene_morning_on
    data: {}
  - repeat:
      until:
        - condition: and
          conditions:
            - condition: state
              entity_id: input_boolean.climate_scene_day_on
              state: "off"
            - condition: state
              entity_id: input_boolean.climate_scene_evening_on
              state: "off"
            - condition: state
              entity_id: input_boolean.climate_scene_night_on
              state: "off"
      sequence:
        - service: script.turn_on
          data: {}
          target:
            entity_id: script.set_morning_climate
        - delay:
            hours: 0
            minutes: 3
            seconds: 0
            milliseconds: 0
mode: single

and the relevant part of the script:

alias: Set Morning Climate
mode: single
sequence:
  - service: climate.set_temperature
    data:
      temperature: 24
      hvac_mode: heat
    target:
      entity_id: climate.thermostatic_valve_bathroom
  - service: input_boolean.turn_off
    target:
      entity_id:
        - input_boolean.climate_scene_evening_on
        - input_boolean.climate_scene_day_on
        - input_boolean.climate_scene_night_on
    data: {}

I think that is not cause by integration. Almost 3 months it worked correctly to me, but now I have the same problem. I did not change anything special and all the time I have set coIot in the same way.
That is pitty that is so unpredictable and cannot be solve anyway.