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

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…

Why do you have two logs? And no diagnostic file?
You can simply drag and drop the file into the post.


This is what I got with drag and drop…
I’m going to cut and paste the small diagnostic file (the two log files would fill many screens…):
{“home_assistant”:{“installation_type”:“Home Assistant OS”,“version”:“2024.5.1”,“dev”:false,“hassio”:true,“virtualenv”:false,“python_version”:“3.12.2”,“docker”:true,“arch”:“x86_64”,“timezone”:“Europe/Lisbon”,“os_name”:“Linux”,“os_version”:“6.6.25-haos”,“supervisor”:“2024.04.4”,“host_os”:“Home Assistant OS 12.2”,“docker_version”:“25.0.5”,“chassis”:“vm”,“run_as_root”:true},“custom_components”:{“hacs”:{“documentation”:“https://hacs.xyz/docs/configuration/start",“version”:“1.34.0”,“requirements”:[“aiogithubapi\u003E=22.10.1”]},“ble_monitor”:{“documentation”:“https://github.com/custom-components/ble_monitor”,“version”:“12.10.4”,“requirements”:[“pycryptodomex\u003E=3.18.0”,“janus\u003E=1.0.0”,“aioblescan\u003E=0.2.14”,“btsocket\u003E=0.2.0”,“pyric\u003E=0.1.6.3”]}},“integration_manifest”:{“domain”:“shelly”,“name”:“Shelly”,“codeowners”:[“@balloob”,“@bieniu”,“@thecode”,“@chemelli74”,“@bdraco”],“config_flow”:true,“dependencies”:[“bluetooth”,“http”,“network”],“documentation”:“https://www.home-assistant.io/integrations/shelly”,“integration_type”:“device”,“iot_class”:“local_push”,“loggers”:[“aioshelly”],“quality_scale”:“platinum”,“requirements”:[“aioshelly==9.0.0”],“zeroconf”:[{“type”:“_http._tcp.local.”,“name”:“shelly*”}],“is_built_in”:true},“data”:{“entry”:{“entry_id”:“974ed2fc8f3753b7d716b0d7c324ff9b”,“version”:1,“minor_version”:2,“domain”:“shelly”,“title”:“Shelly_PlusHT”,“data”:{“host”:“192.168.107.35”,“sleep_period”:600,“model”:“SNSN-0013A”,“gen”:2},“options”:{},“pref_disable_new_entities”:false,“pref_disable_polling”:false,“source”:“zeroconf”,“unique_id”:“FCB467265130”,“disabled_by”:null},“device_info”:{“name”:“Shelly_PlusHT”,“model”:“SNSN-0013A”,“sw_version”:“”},“device_settings”:"not initialized”,“device_status”:“not initialized”,“bluetooth”:“not initialized”}}

Post it on hastebin or pastebin and copy the link here.

Thank you Francis, but didn’t work…maximum pastebin is 512Kb :frowning:

This the diagnostic file I was able to post, the HA log file is way too big for pastebin or hastebin…

Okay, I scrolled through the enormous debug file and noticed that the HT sensor only appear in the initial part of the log. I was only able to pastebin the first few pages due to the size of the full log, but may be the rest of it won’t be needed since it keeps referring to my two shellyminig3 until the end…nothing about the Shelly HT Plus

Here is the link:

Hello Bieniu, no time to look at my files yet? I’m afraid they might disappear from Pastebin/Hastebin after a few days…

Both the log and the diagnostics file indicate that the device does not send data to the HA server. I’m pretty sure your WebSocket outbound configuration is incorrect.

Dear Bieniu, thank you again to wasting your time trying to help me.
in regard to the configuration of the outbound websocket, there are only to settings to configure (connection type and the server) and I basically tried all possible options for both.
I tried Default TLS, User TLS and No validation for the connection type and in the server field I tried using both the local IP address and the FQDN address…
wss://192.xxx.xxx.xx:8123/api/shelly/ws or https://xxxxxxxx.duckdns.org:8123/api/shelly/ws

I also tried ws:// instead of wss…
What am I doing wrong?

You should use ws:// or wss:// not https://

obraz

You can check which address is correct using curl:

curl https://192.xxx.xxx.xx:8123
curl https://xxxxx.duckdns.org:8123

Hello Bieniu, in the websocket server field I’m using wss (the https was a cut and paste typo to this post, my mistake). In the connection type field, I’m using Default TLS.
I tried the curl command as you advised, in the HA Terminal. Both with the local HA server IP and with the FQDN. The result was similar, there’s something wrong with the certificate:

Did you read this? Problem with Shelly new ht plus sensor - #138 by almiho

Yes I did, but I will read it again. Thank you.