Shelly H&T unavailable data

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.

hmmm how are you directly connecting to a device that is mainly asleep?! Or are you resetting the device back to wireless AP mode 1st?

Edit - Ok I’ve got it working. I have the unit with a permanent USB power but its much easier to pop the battery back in and have it next to the PC and press the reset button to wake it up. As a side note I find the USB power base connections are a bit ‘flaky’ IE sometimes when you twist the base to the to it fails to make a connection. Maybe a little gentle bending of the contacts is required!

1 Like

I just got 2 of these the firmware recommended here does not seem to be on their site anymore, The current posted version is 20210315-135153/v1.10.0-rc5-6-g799f3e98f at Shelly firmware page.

Will this version work properly with HA?

through mqtt - yes, always.
BTW RC5 is release candidate. it’s not final version. I have my HTs with 1.7.3 and 1.9.x. I had no single problem with them and mqtt