New Shelly TRV BLU integration

Looks great, but somehow I don’t get it to work. Any Ideas ?
I did the following:

  1. replaced the ID’s in your sample config and added it to the end of my configuration.yaml. Check ok and Reboot HA.
  2. MQTT Server already running in HA and configured in BLU TRV Server-IP, Port, User.PW + Enable MQTT. Rebooted BLU TRV.

In the MQTT Log I can see the connection and no errors, but the Thermostat don’t appear in the “Overview” Tab:
MQTT Log:
2024-10-15 21:59:36: New connection from ::1:44968 on port 1883.
2024-10-15 21:59:36: Client disconnected due to protocol error.
[21:59:36] INFO: Successfully send discovery information to Home Assistant.
[21:59:36] INFO: Successfully send service information to the Supervisor.
2024-10-15 22:03:04: New connection from 172.30.32.2:36952 on port 1883.
2024-10-15 22:03:04: Client closed its connection.
2024-10-15 22:05:04: New connection from 172.30.32.2:38066 on port 1883.
2024-10-15 22:05:04: Client closed its connection.
2024-10-15 22:07:04: New connection from 172.30.32.2:58452 on port 1883.
2024-10-15 22:07:04: Client closed its connection.

UPDATE: Now I got an Error in HA:
Error: length of value must be at least 2 @ data[‘device’][‘connections’][0].

The device part in my MQTT Config looks like this, what is wrong with that ???

device:
  connections:
  - - bluetooth
  - 5c:dc:fc:47:68:28
  name: Shelly BLU TRV
  model: Shelly BLU TRV
  model_id: SBTR-EU867E
  manufacturer: Allterco Robotics

Missing indentation

obraz

Hello,

I have a similar issue, also with Shelly BLU TRV on Home assistant. In my setup I followed the steps described above and added your file with adapted IDs for the Gateway and the Shelly BLU TRV in my configuration.yaml. I see that MQTT connection is established and communication is partially working. However, I only receive partial information from the Shelly side.

In my MQTT logs I did not receive any data from:
shellyblugwg3-34cdb0786ee4/status/mqtt
shellyblugwg3-34cdb0786ee4/status/bthomesensor:202 and
shellyblugwg3-34cdb0786ee4/status/bthomesensor:203

Consequently, I can only see the entity, but not the current temperature, target temperature etc.

Bildschirmfoto vom 2024-10-17 08-52-36

Any Idea what could be the reason?

Here my configuration.yaml information:

#Shelly BLU TRV
mqtt:
  - climate:
      name: "Kinderzimmer 2"
      unique_id: "28:db:a7:b5:d2:1a"
      current_temperature_topic: "shellyblugwg3-34cdb0786ee4/status/bthomesensor:203"
      current_temperature_template: "{{ value_json.value }}"
      max_temp: 30
      min_temp: 4
      precision: 0.1
      temp_step: 0.1
      temperature_state_topic: "shellyblugwg3-34cdb0786ee4/status/bthomesensor:202"
      temperature_state_template: "{{ value_json.value }}"
      temperature_command_template: "{{ {'id': 0, 'src': 'homeassistant', 'method': 'BluTRV.Call', 'params': {'id': 200, 'method': 'TRV.SetTarget', 'params': {'id': 0, 'target_C': value | round(1)}}} | to_json }}"
      temperature_command_topic: "shellyblugwg3-34cdb0786ee4/rpc"
      mode_state_topic: "shellyblugwg3-34cdb0786ee4/status/bthomesensor:202"
      mode_state_template: "{{ 'off' if value_json.value == 4 else 'heat' }}"
      modes: ["heat", "off"]
      mode_command_topic: "shellyblugwg3-34cdb0786ee4/rpc"
      mode_command_template: "{% set target = 4 if value == 'off' else 21 %}{{ {'id': 0, 'src': 'homeassistant', 'method': 'BluTRV.Call', 'params': {'id': 200, 'method': 'TRV.SetTarget', 'params': {'id': 0, 'target_C': target}}} | to_json }}"
      availability:
        - topic: "shellyblugwg3-34cdb0786ee4/online"
          payload_available: "true"
          payload_not_available: "false"
        - topic: "shellyblugwg3-34cdb0786ee4/status/mqtt"
          value_template: "{% if value_json.connected %}online{%else%}offline{%endif%}"
      device:
        connections:
          - - bluetooth
            - 28:db:a7:b5:d2:1a
        name: Heizung
        model: Shelly BLU TRV
        model_id: SBTR-EUD21A
        manufacturer: Allterco Robotics

Shellies Discovery Gen2 supports Shelly BLU TRV.

Check MQTT configuration. Should look like this

obraz

Thank you for the fast feedback and good hint. I forgot to enable the generic status update over MQTT. Now it is working as intended.

1 Like

Thanks for the tip, the MQTT Config Error is gone.

I got now the thermostat, but status stays “unavailable”

For my understanding:
I assumed that the Shelly TRV should initiate the communicaten with the MQTT Server ?
I enabled MQTT in the TRV and configured the MQTT-Server IP:Port + User/PW to connect to the MQTT Server (runs on the HA).
Is that correct ?

Or does the HA or MQTT Server connect to the TRV and polls for the data ?

Any tips how to troubleshoot that ?
FYI: I configured the .yaml according to the sample above and not using the mentioned script.
“Generic status update over MQTT”. is enabled in the TRV.

  • Shelly BLU TRV Thermostat (climate.shelly_blu_trv_thermostat)
    MQTT discovery data:
    • Topic: ``
    • Payload
      Subscribed topics:
    • shellyblugwg3-34CDB077B38C/online

0 most recently received message(s)

  • shellyblugwg3-34CDB077B38C/status/mqtt

0 most recently received message(s)

  • shellyblugwg3-34CDB077B38C/status/bthomesensor:202

0 most recently received message(s)

  • shellyblugwg3-34CDB077B38C/status/bthomesensor:203

0 most recently received message(s)
Transmitted messages:

BLU TRV is not able to connect to MQTT broker because it doesn’t support WiFi. BLU TRV is sendind data to the BLU Gateway via BT and BLU Gateway is forwarding this data to MQTT broker.
It seems that BLU Gateway doesn’t send data to the MQTT broker. Probably, BLU Gateway configuration for MQTT is wrong.

Thanks for the clarification. I found the problem.

I copied the shellyblugwg3 Gateway ID from the bottom of the Shelly GW Webinterface into the configuration.yaml.
Unfortunately the ID-Part is uppercase on the Webinterface, but in the MQTT-config the ID-Part ist lowercase.
After changing the BLU Gateway ID to lowercase in the .YAML it worked.

Thankyou very much

@Bieniu thanks a lot! Works like charm!

Any chance to get an option to change the presets(schedules) of the TRV on this card and a button for the boost option?

BTW with no modification of your code, I get only 1 button with 2 options - HEAT and OFF. How can i change it to look like yours?

No, not supported by firmware for MQTT. Boost will be implemented in GitHub - bieniu/ha-shellies-discovery-gen2: Script that adds MQTT discovery support for Shellies Gen2 devices

Use thermostat card.

Boost as a button entity is implemented Release Version 3.1.1 · bieniu/ha-shellies-discovery-gen2 · GitHub

Perfect! Many thanks for your time and work!

For the TRVs, that are connected to their own gateways all is clear. However, if i try to add a GW with 2 TRVs connected to it, it is not detecting none of them. Am I doing something wrong?

I don’t know. Please open an issue here.

And how can I add a second blu trv with the same gateway?
Is that possible or do I need separate gateways foreach blu trv?

I ask because my second blu trv shows the same temperatures, because I have the same topics…

You have to change topics in the configuration.

I can’t find that option in the shelly webinterface. I use two gateways to achive what I want in the moment. Are you shure that I can define the used topics via the shelly webinterface of the gateway? I think the are predefined, but I’m no MQTT-Pro…

I meant changing topics in the climate entity configuration, not in the device configuration.

I tried that, but it doesn’t work. ( Used :204 instead of :202 and :205 instead of :203)

I’m pretty shure that the topics that are used must be defined in the blu gateway gen3, but there is no option. I is just possible to change one prefix and not add another one.

I’d be happy if anyone can tell me that it is possible with one gateway and 2, 3 or maybe 5 thermostates.

Thank you for your help!

Yes, you can pair 3 thermostats with one gateway.