Shelly H&T unavailable data

Hi all,

I am trying to integrate Shelly H&T in Home assistant. I have followed the steps listed in https://www.home-assistant.io/integrations/shelly/ and the sensor was easily added.
My issue is to show the temperature on a lovelace card, since it only shows the temperature while the sensor is on (need to open it and press the button to start the internal webserver), and I don’t want to have it always on to save power (not even sure if there is an option for that).
Since the sensor is only reporting the temperature on change or every X hours, this becomes quite useless.
I am sure I am missing something… Is is possible to always show the last received readings? Or is there any way to show that information?

If I move to the MQTT integration: Shellies Discovery Script would it help?

Can someone please guide me as I am new to HA / integrations.

3 Likes

Please read the Shelly integration documentation. The battery powered devices are not supported.
Shellies Discovery script supports battery powered devices but requires MQTT.

Having exact same issue. The discovery works fine and the adding of the card to lovelace is perfect. Only issue is that i would like to display last temperature instead of “unavailable” while the device is sleeping

1 Like

thank you for you reply. I’m trying to set up MQTT and test your script to overcome this “unavailable” issue.

1 Like

it would be fine if only instead of “unavailable” the entity would report the last valid read value. At the end this is exactly what the Shelly Cloud interface is doing…

/nevermind read the script and guess this is exactly what is doing. Thanks for it!

I don’t get it. I read the documentation for the shelly integration and I don’t see it mentioning anywhere that battery devices are not supported. Hence two questions:

  • Is the info that battery devices are not supported still current?
  • If battery devices are supported, what could be the reason I’m not getting any updates (Shelly H&T 1.9.0, HA 2021.3.1)?
    Do I need to configure an action for the Shelly H&T?
    Do I need to enable cloud even though the integration documentation says the connection is local?

I guess I don’t understand how the Shelly H&T would know where the HA instance is running so it can send updates.

1 Like

Battery powered devices are supported after 2021.3.0 release.

2 Likes

I’m on 2021.3.3 and have a Shelly H&T connected. It still only connects when I first set it up and then it becomes unavailable. This is the same thing that happened before 2021.3.0, so it either doesn’t work or I’m doing something wrong (probably this one).

2 Likes

Please show debug log for Shelly integration.

1 Like

Here’s the log. Let me know if there’s something more that you are looking for.

2021-03-09 23:50:38 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update

Logger: homeassistant.components.shelly
Source: helpers/update_coordinator.py:173
Integration: Shelly (documentation, issues)
First occurred: March 9, 2021, 11:50:38 PM (1 occurrences)
Last logged: March 9, 2021, 11:50:38 PM

Error fetching shelly-h&t data: Sleeping device did not update

edit: Here’s some system information in case it helps. I’m using docker compose. The Shelly H&T is also plugged in using the micro-USB attachment instead of a battery.

version: core-2021.3.3
installation_type: Home Assistant Container
dev: false
hassio: false
docker: true
virtualenv: false
python_version: 3.8.7
os_name: Linux
os_version: 5.8.0-1016-raspi
arch: aarch64

Please show debug log for Shelly integration. Probably you have multicast issue in your network. You can use Shelly firmware 1.10 RC4 and enable unicast.

This might be a dumb question, but how do I generate logs for Shelly integration? I’ve looked but can’t seem to find anything. Thanks!

Add those lines to your configuration.yaml file:

logger:
  default: warning
  logs:
    homeassistant.components.shelly: debug

and restart HA.

Thanks! I removed the Shelly integration/device, added the debug setup to my configuration.yaml, restarted HA, and set up the Shelly integration again. Here’s what I got.

2021-03-11 10:05:36 DEBUG (MainThread) [homeassistant.components.shelly] Setting up offline device shelly-h&t
2021-03-11 10:10:00 DEBUG (MainThread) [homeassistant.components.shelly] Setup for device shelly-h&t will resume when device is online
2021-03-11 10:10:00 DEBUG (MainThread) [homeassistant.components.shelly] Device shelly-h&t is online, resuming setup
2021-03-11 10:22:00 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-11 10:22:00 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-11 10:34:00 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds

The device showed the humidity when I set it up and it was still online. Currently, it shows this on my dashboard (as of 2021-03-11 10:45:00):

shelly-h&t External Temperature Unavailable
shelly-h&t Humidity Unavailable

Let me know if you want me to try anything else and provide more logs. Thanks again for the help.

It seems to me you have multicast issue in your local network. You can try to use firmware 1.10 rc4, it supports unicast so it may resolv your issue http://repo.shelly.cloud/firmware/test/

I think we’re making some progress. HA picks up a reading about every 10 minutes now, which is what I would expect since the Shelly H&T is plugged in via USB. Before, it was only picking up a reading right when it was connected and then never again.

However, I can only see the reading if I click on the entity on the card and look at the graph. The dashboard itself still shows “Unavailable” most of the time, although numbers will show up sometimes. I’m using the default Overview dashboard.

Here’s the debug log from overnight.

2021-03-11 21:01:31 DEBUG (MainThread) [homeassistant.components.shelly] Setting up offline device shelly-h&t
2021-03-11 21:13:31 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-11 21:13:31 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-11 21:25:31 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds
2021-03-11 21:30:27 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-11 21:30:27 DEBUG (MainThread) [homeassistant.components.shelly.entity] Entity shelly-h&t External Temperature attached to block
2021-03-11 21:30:27 DEBUG (MainThread) [homeassistant.components.shelly.entity] Entity shelly-h&t Humidity attached to block
2021-03-11 21:42:27 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-11 21:42:27 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-11 21:54:27 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds
2021-03-11 22:06:27 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds
2021-03-11 22:18:27 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds
2021-03-11 22:20:20 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-11 22:32:20 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-11 22:32:20 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-11 22:44:20 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds
2021-03-11 22:54:31 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-11 23:05:03 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-11 23:17:03 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-11 23:17:03 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-11 23:26:22 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-11 23:38:22 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-11 23:38:22 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-11 23:50:22 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds
2021-03-11 23:56:48 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 00:08:48 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 00:08:48 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 00:14:26 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 00:23:59 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 00:33:32 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 00:45:32 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 00:45:32 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 00:57:32 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds
2021-03-12 01:07:46 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 01:17:46 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 01:29:46 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 01:29:46 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 01:41:46 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds
2021-03-12 01:53:46 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds
2021-03-12 02:05:36 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 02:17:36 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 02:17:36 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 02:25:40 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 02:35:42 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 02:45:45 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 02:57:45 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 02:57:45 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 03:01:08 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 03:10:09 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 03:15:19 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 03:25:42 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 03:37:42 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 03:37:42 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 03:40:58 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 03:46:10 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 03:51:20 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 03:56:59 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 04:08:59 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 04:08:59 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 04:12:21 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 04:22:22 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 04:28:07 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 04:33:17 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 04:43:18 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 04:55:18 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 04:55:18 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 05:07:18 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds
2021-03-12 05:08:54 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 05:19:12 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 05:24:25 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 05:34:47 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 05:46:47 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 05:46:47 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 05:47:08 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 05:56:12 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 06:08:12 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 06:08:12 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 06:20:12 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds
2021-03-12 06:32:12 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds
2021-03-12 06:32:33 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 06:42:34 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 06:48:43 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 06:54:54 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 07:00:07 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 07:05:15 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 07:17:15 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 07:17:15 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 07:26:08 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 07:38:08 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 07:38:08 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 07:44:45 DEBUG (MainThread) [homeassistant.components.shelly] Manually updated shelly-h&t data
2021-03-12 07:56:45 ERROR (MainThread) [homeassistant.components.shelly] Error fetching shelly-h&t data: Sleeping device did not update
2021-03-12 07:56:45 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.001 seconds
2021-03-12 08:08:45 DEBUG (MainThread) [homeassistant.components.shelly] Finished fetching shelly-h&t data in 0.000 seconds

For anyone else reading this that’s having the same problem, you can use this URL to rollback your device.

http://<your device IP>/ota?url=http://repo.shelly.cloud/firmware/test/SHHT-1.zip

The Shelly site shows how to do this here, https://archive.shelly-tools.de/, but it doesn’t seem to have that specific release, so you can grab it from here http://repo.shelly.cloud/firmware/test/. You can can also find some documentation on the API here https://shelly-api-docs.shelly.cloud/#ota.

1 Like

This Error fetching shelly-h&t data: Sleeping device did not update means that your HA doesn’t get data from H&T. Do you use firmware 1.10 rc4? Do you configure CoIoT peer correctly?

Do you use firmware 1.10 rc4?

I believe so, here’s what my device says under Settings > Firmware Update

Current version: 20210311-141308/v1.10.0-rc4-20-ge7f7737d6

Do you configure CoIoT peer correctly?

Nope. This was set to mcast on my device. I didn’t realize I needed to change it. I updated it to <My Device IP>:5683, but unfortunately the dashboard still often says Unavailable.

image

I tried removing the integration and including the port when adding it back, but HA does not let me include the port. It just says “Failed to connect.” So I just reconnected it with its IP.

Is there something here I am doing wrong?

edit 1: Is the CoIoT address supposed to be the Shelly H&T IP or the Home Assistant IP?

edit 2: Everything seems to be working after changing the CoIoT IP to my Home Assistant IP. Are you able to tell if this is an issue with my network that I should look into separately? Or is it a limitation of Shelly’s firmware?

1 Like

NB: Ihave the same issues for "unavailable"for the HA H&T sensors. I have mDNS setup on my unify network but it does not pick up any more than the 1st connection on rebooting HA.

So, as recommended I’ve flashed the V1.10 .0-rc4 but I cannot find the menu item for “Advanced - Developer Settings”?

Any further guidance will be much appreciated!

I get there by going to my device’s IP and selecting Internet & Security > Advanced - Developer Settings. I don’t think CoIoT was there at all before going back to 1.10 rc4, so make sure you do that first.