Problem with Shelly new ht plus sensor

@Schimmelreiter To resolve this specific error you mention, you should update the firmware on the device’s own direct webpage in your browser. In the Shelly app (browser or mobile up shelly will tell you that there is no update available!, but there is!)

Update is a necessay step, but after updating the problem will not be solved. See here : websocket will not connect.

Eureka: I found a workaround for me after all:

defaults:
  - 8.8.8.8
  - 8.8.4.4
forwards: []
hosts:
  - host: myhost.duckdns.org
    ip: 192.168.1.99
services: []
cnames: [] 
  • ISP DNS deactivated in the router and the IP address of the HA node entered as DNS
  • Shelly Plus H&T Outbound Websocket changed back to Fully Qualified Domain Name (FQDN)
{
enable: true,
server: "wss://myhost.duckdns.org:8123/api/shelly/ws",
ssl_ca: "ca.pem"
}
  • x-check on my PC with nslookup myhost.duckdns.org; answered with correct local IP 192.168.1.99

Result: Shelly Integration shows now up with 1 Device with 4 Entities in Home Assistant

Hope this solution will survive, even Shelly FW and/or HA Aioshelly Lib is going to be updated. :wink:

1 Like

@cipo Congrats! However I do not consider this as a Royal solution. The ‘normal’ HT and the Motion 2 sensors do not need workarounds. They work conform specifications. So should the Plus HT.

I would like to urge everyone to file a ticket at Shelly, so the issue can be properly fixed.

Nonetheless, what an endurance @cipo !

Thank you @loovanloon.

Just to make sure it’s clear what problem I was having that could be worked around with Dnsmasq, here’s a summary of how I understand it:

  • I am using DuckDNS.org to access my HA instance on the road.
  • This means that not only the “http:” traffic, but also the “ws:” traffic is switched to secure, i.e. to “https:” or “wss:”.
  • If the server URL is now specified using FQDN in the Shelly device, HA will receive the public IP, which is different from the internal IP specified in the payload, and thus HA currently will not be able to process the information. (State: connected, no data).
  • If the server URL is specified on the Shelly Plus H&T using the internal IP address, a certificate error occurs. (state: not connected)
  • Disabling certificate checking is not possible with the current FW of Shelly Plus H&T. (Supposedly this was possible with earlier versions).

Hence the approach with Dnsmasq as a quickfix, simply to deliver HA as expected with data packets with the internal IP.

How other Shelly Gen.2 devices behave, I don’t know, because I don’t have another Shelly Gen.2 device (yet).

In any case, from the user’s point of view, this is anything but pleasant. Just thinking about how much time passed until I understood the cause of the problem. (Sorry guys, didn’t get it sooner. :wink: )

I agree that in terms of frustration reduction, a fundamental solution is needed. However, I am not sure conceptually if this is to be provided by either Shelly or HA. Or perhaps by both together?

1 Like

This work’s for me too (I’m also using SSL/***duckdns for my HA).
Crazy, that in this case only the local IP works!

Thank you! That helped. I thought I already had that set up (using a pi-hole with dns masking and resolving) but apparently it didn’t pick it up correctly. I’ve reconfigured the HTPlus to use the pihole dns server statically and it pops up.

Thank to all your input I was able to integrate my Shelly H&T Plus into Home Assistant. I have a device now and also the sensors. But I cant assign the device to any room? What am I missing? How can I add the H&T Plus to the room where it physically is?

Thx,
Chris

looks like something’s broken since 2022.12.7 If I update it stops working, roll back and it’s good again.

1 Like

@spoonflower That’s interesting. Have you commit a bug report?

I haven’t. I need to do a tiny bit more testing as I also issued a reboot from Shelly cloud… classic mistake of changing two things.

1 Like

Hi Cipo,
Could you pls explain how to disable DNS on the router?
My setup is as follows:
The router (a German FRITZ!Box) has a port forwarding for port 80 and 443 to the HA server. There I have an NGINX reverse proxy mapping the duckdns server to the HA server with port 8123.
I now have configured the HT+ Shelly as you described, set up the masq dns server, but still no clue how to get it showing the entities…
Any help would be greatly appreciated.
Cheers,
Hauke

Hi, here is another solution which might be easier.
Situation: Using DuckDNS, seeing the sensor but no entities.

Solution:

  • Use NGINX home assistant SSL proxy
  • Follow the ‘How to use instruction’
    • in the config the domain is your duckdns domain
    • in the config.yaml remove the certificates (ssl_certificate and ssl_key) and add stuff mentioned in the NGINX documentation point (3)
  • Configure the port allocation to use external the 8123 and internal the 433 or the port you configured in NGINX

outbound websocket in the shelly
enabled, ca.pem, ws://internal_HA_IP:8123/api/shelly/ws

From external you are using now https and internal http

Hope this is understandable and helps.

Great! This worked for me… but the instructions aren’t totally clear. What do you mean with configure the port allocation? (Your last bullet)

My Shelly ht now connects through port 443.

This configuration work fine

mqtt:
  sensor:

    - name: "HT_Temperature"
      state_topic: "shellies/PlusHT/events/rpc"
      unit_of_measurement: "°C"
      payload_available: "online"
      payload_not_available: "offline"
      value_template: "{{ value_json.params['temperature:0'].tC }}"
      expire_after : 10800 #3 hours
      device_class: temperature

    - name: "HT_Humidity"
      state_topic: "shellies/PlusHT/events/rpc"
      unit_of_measurement: "%"
      payload_available: "online"
      payload_not_available: "offline"
      value_template: "{{ value_json.params['humidity:0'].rh }}"
      expire_after : 10800 #3 hours
      device_class: humidity
1 Like

Hi Chris,

in my Fritzbox I configured the port allocation:
Protocol TCP
Device port 443 to 443
external port 8123

My Fritzbox speaks Gerrman, so my translation might not be correct. :slight_smile:

1 Like

My H&T plus has been not working for 3-4 months and I have noticed many of the “workarounds” seem to to related to getting ssl working on HA.

I recently started working on getting letsencrypt working on a some of my apps and I did the same for HA

So today I tried changing my H&T to use outbound websocket = ws://internal_HA_IP:8123/api/shelly/ws

This still did not work, I changed it to use wss://FQDN:8123/api/shelly/ws and used ca.pem

It nows works and continues to work for about 2-3 hours now.

Note I do have my own internal DNS so I have an FQDN that resolves to a local IP

1 Like

Confirmend!

1 Like

Hi guys. Quite new into this HA world…
For these Shelly HT Plus, I am suffering a bit…tried all the above, but could not have it to work. Would you have any further suggestions or debug ideias?

Did you read the docs and configure outbound websocket? Shelly - Home Assistant

I have the same issues and was not able to solve it with the points above. I have no vlans or tls aktivated. I did not get any entities. Is this a bug in the shelly integration? i have a lot of shelly devices, the normal h&t (not the plus) work without any problems and it was not necessary to configure anything like a websocket on the device.