Unable to get Shelly Plus H&T sensor to send Temperature & Humidity info to Home Assistant

Hello all,
I started with HA recently and integrated only a few things to start experimenting automations. Bought 2 Tapo plugs, 2 Shelly mini G3 relays and 1 Shelly Plus H&T, and you guessed - the one I’m having trouble with is the H&T sensor.
Configuration: HA installed on a VM running in Windows10 - HA OS version 12.2, HA core 2024.4.3.
Although I know little or nothing about code, with input from the community I was able to make HA available from outside my LAN, after adding HACS, DuckDNS, DNSmasq, Advanced SSH & Web Terminal, etc.
I was actually able to get H&T info in HA initially, but after the changes that I made with duckdns and dnsmask, I lost that, now the Shelly integration shows no devices or entities in HA.
I’ve spent many days reading comments and suggestions about this problem from people with the same difficulties, and tried many fixes like adding an S in the websocket server configuration: wss://192.168.xxx.xxx:8123/api/shelly/ws, with no success.
I also tried changing this user setting:


(although I’m not sure what it should be)
Also installed MQTT and mosquitto broker and played with their configurations, as well as the MQTT settings, RPC over UDP, etc, trying to guess what could make things right…but still no clue.
The sensor is okay, it send info to the Shelly app in my smartphone, and HA actually discovers it, but after clicking Configure and it responds with “success”, it shows “no devices or entities”…so I cannot use its info for automations.
Please help, tell me what kind of debug files or other stuff that I can provide for you to help me.
Thank you!

Use your FQDN in the websocket setting (instead of 192…) and then reboot your whole system.

Good luck.

Thank you David, I’ve tried that before, but I just retried again now, rebooted the device and HA also, just in case…still showing no devices or entities…what would you suggest as the Connection Type settings in the Websocket configuration? User TLS, Default TLS or TLN no validation? I think I’ve tried everyone of the 3 options, but…

Use default TLS.

Also I note in your screen shot you have an error in your address, you have a double slash after your port number.

Thank you again, David. I appreciate your help and followed you guidance. I erased one of the slashes and changed to Default TLS…rebooted the sensor and HA too…unfortunately, still no devices or entities.

Just double checking that you have the full link

:8123/api/shelly/ws

I did check David, it’s complete…thanks again. The mystery still remains.
Perhaps it’s some error in my HA configuration? (created by my lack of knowledge, obviously)
Or could it be some bad configuration of my Shelly H&T Plus MQTT settings?
In the server address I tried both the local HA IP and its FQDN:

There are also TLS settings that I did not try (Shelly H&T Plus settings):

Hello, anyone else wants to help me with this problem? thank you all!

Did you install a MQTT broker ? And the MQTT integration ?
You will still need to provide an Username and Password for your MQTT broker

and run the Shellies discovery script

First of all, you are confusing two ways of integrating a device here. Core Shelly integration does not use MQTT. For core integration, the outbound websocket must be properly configured.

Thank you Maciek,
I don’t know what else to to in what concerns the configuration of the outbound web socket, I’ve tried to follow different advices from this community, with no success.
If you have any advice on how to configure the Websocket correctly, please help.
Thank you again.
Luis

Thank you Francis, yes, I added the MQTT integration and the Mosquitto broker, but I don’t think I have created user/password for that. I’ll try to see how to do that and how to follow your other advices, such as using the Shellies Discovery Script:
I’m not sure if I have the knowledge to do that, tough…

Hello guys,
I’m still looking for a solution to this problem, if someone has any other clues, please help…

Any one able to help here?
Thank you

I think that no one will help you until you describe exactly what plan you have (what you want to achieve) and at what stage you are implementing this plan, what works, what does not work.

Thank you Maciek (should I call you Bieniu?)
Besides all the screen shots included above, what else can I add so you can help me?
The plan was adding the Shelly plus H&T sensor to the HA so I can create an automation to turn on and off an air conditioner depending on the temperature of the room. I initially integrated the Shelly sensor and I could see the temp and humidity info in HA. But the I followed some video showing how to make HA available outside my LAN, using Duckdns and dnsmasq and I achieved that, but at the same time I lost the H&T info in HA. I still see the device itself, but no entities, so the temperature and humidity info cannot be used for the desired automation.
As you can see from the above I’ve tried many things and followed many advices, from websocket configurations to the use of MQTT and mosquitto, even tried to include some scripts like the one suggested (shellies discovery).
My problem is that I don’t know nothing about scripts, code or programming…now I have an expensive sensor that works well in its own proprieatary app (Shelly app) but what I wanted was doing the referred automation in HA.
I probably have done many mistakes already, like copying scripts from github into my HA configuration…to the wrong places or wrong code. Don’t know what else to do…

Tried to insert this script, did not work:

It’s up to you, Maciek is my name, Bieniu is my nickname.

IMO you have tried too much.

I guess you want to configure the device and you don’t care how. For this reason, I would recommend giving up Shellies Discovery because this way is definitely more advanced way. If you use DuckDNS it seems to me (I have never used this addon so I’m not sure) that your HA instance is available at the local IP address and port 8123 and uses SSL. So you need to properly configure WebSocket outbound on your Shelly device using wss:// and set up your device with Shelly core integration. Everything is written in the docs Shelly - Home Assistant

Hello Maciek, as mentioned previously, I also tried to configure the outbound websocket, both by reading the documentation over and over again and trying to follow the advices of those who tried to help me. My trials are documented with screen shots that I’ve published in this post.
I’m completely clueless and lost, after trying so many ways to correctly integrate the Shelly Plus H&T sensor…why wasn’t it easy like the two other shelly devices I installed?

Because this is a sleeping device, it is offline most of the time.

You wrote earlier that HT worked and the entities were visible, then according to some random tutorial you did something and the device does not work. This is a good lesson, if you don’t know what you’re doing, it means you shouldn’t do it because you might break something.

My suggestion is, remove all configurations related to Shellies Discovery, restart HA, set proper websocket outbound on the device, enable debug for Shelly integration, restart HA, configure the device via core integration, wait 10 mins, push button on the device to wake it up, wait 10 mins. After that, attach the HA log files and the diagnostic file here (whole files, not their fragments!).

1 Like

Thank you once more Maciek.
I think I did all your suggestions correctly. I’m trying to upload the two log files I was able to get (hope this was what you were referring to) but I do not know how…should I just cut and paste all the text here? It’s really big…almost 5Mb of text…