Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding multiple Shelly BLU TRVs to single Shelly Gateway GEN3 #498

Open
gu-stera opened this issue Oct 23, 2024 · 41 comments
Open

Adding multiple Shelly BLU TRVs to single Shelly Gateway GEN3 #498

gu-stera opened this issue Oct 23, 2024 · 41 comments

Comments

@gu-stera
Copy link

I've added a GW3 to my setup with 2 BLU TRVs connected to it. I see the GW added in MQTT, but the TRVs are not showing up.

Here is my config:

    device_ids:  # enter the list of device IDs (MQTT prefixes) here
      - LR-GW3 # This GW doesn't show the 2 TRVs that are connected to it
      - KTCN-GW3 # This GW shows the TRV that is connected to it
      - BR-GW3 # This GW shows the TRV that is connected to it

All GWs have the same configuration.

@bieniu
Copy link
Owner

bieniu commented Oct 23, 2024

Please fill up the form. I'm not able to help you without any information.

@bieniu bieniu added the needs-more-information Further information is requested label Oct 23, 2024
@gu-stera
Copy link
Author

gu-stera commented Oct 23, 2024

Describe the bug

If there are more than 1 TRVs on the same GW Gen3, none of them are showing up in HA.

Expected behavior
All devices that are added to a single GW Gen3 should show up in HA

Versions:

  • Home Assistant: Home Assistant OS 13.2, supervisor-2024.10.2, core-2024.10.3
  • Shellies Discovery GEN2: 3.2.0
  • Shelly device firmware: 20241021-140344/1.4.99-blugwg3prod4-g110402b
  • 20241011-050134/v1.0.1@ed260994

Shellies Discovery GEN2 automations:

 - id: shellies_announce_gen2
  alias: "Shellies Announce Gen2"
  triggers:
    - platform: homeassistant
      event: start
  variables:
    get_config_payload: "{{ {'id': 1, 'src': 'shellies_discovery', 'method': 'Shelly.GetConfig'} | to_json }}"
    get_components_payload: "{{ {'id': 1, 'src': 'shellies_discovery', 'method':'Shelly.GetComponents'} | to_json }}"
    device_ids:  # enter the list of device IDs (MQTT prefixes) here
      - LR-GW3
      - KTCN-GW3
      - BR-GW3
  actions:
    - repeat:
        for_each: "{{ device_ids }}"
        sequence:
          - action: mqtt.publish
            data:
              topic: "{{ repeat.item }}/rpc"
              payload: "{{ get_config_payload }}"
          - service: mqtt.publish
            data:
              topic: "{{ repeat.item }}/rpc"
              payload: "{{ get_components_payload }}"
- id: shellies_discovery_gen2
  alias: "Shellies Discovery Gen2"
  mode: queued
  max: 999
  triggers:
    - platform: mqtt
      topic: shellies_discovery/rpc
  actions:
    - action: python_script.shellies_discovery_gen2
      data:
        id: "{{ trigger.payload_json.src }}"
        device_config: "{{ trigger.payload_json.result }}"
    - condition: template
      value_template: "{{ 'mqtt' in trigger.payload_json.result }}"
    - service: mqtt.publish
      data:
        topic: "{{ trigger.payload_json.result.mqtt.topic_prefix }}/command"
        payload: "status_update"

@bieniu
Copy link
Owner

bieniu commented Oct 23, 2024

Debug log?

@gu-stera
Copy link
Author

@bieniu
Copy link
Owner

bieniu commented Oct 23, 2024

Nothing in the log related to LR-GW3.

@gu-stera
Copy link
Author

home-assistant_2024-10-23T19-19-14.157Z.log
this is weird.... please check this log, there are some records on LR-GW3 in it.

@bieniu
Copy link
Owner

bieniu commented Oct 23, 2024

The response to Shelly.GetComponent is paginated and does not contain information about the MQTT component, which makes it impossible to configure devices. This is a limitation of the Shelly firmware and at the moment I have no idea how to solve it.

@bieniu bieniu removed the needs-more-information Further information is requested label Oct 23, 2024
@gu-stera
Copy link
Author

so i guess the workaround until\if Shelly will fix this in their FW is to have 1 TRV per GW, which is nonsense in case there is good coverage of the GW, as it is in my case.

@bieniu many thanks for your quick and excellent support!!

@bieniu
Copy link
Owner

bieniu commented Oct 24, 2024

Unfortunately Shelly won't change the approach. Maybe I can find a workaround. At the moment the only solution is to use one gateway per one TRV.

@Spartacus68
Copy link

Hi all,

multiple BLU H&T are also not working with a single GW, so I guess it is the same issue as it is with the 1TRV

@bieniu
Copy link
Owner

bieniu commented Oct 29, 2024

so I guess it is the same issue as it is with the 1TRV

Life is too short for guessing, show me the log and I'll answer you

@Spartacus68
Copy link

Spartacus68 commented Oct 30, 2024

Hi Maciej,

ja, you´re right! If you want to bring this forward, you need support! Attached you can find the log.

Once the second device is attached to the Shelly device, the first BLU H&T (in my case wk) is also not working anymore in Homassistant. Both BLU H&T (wk and ha) deliver data, as you can see in the screenshot from the mqtt explorer.

image
image

home-assistant_2024-10-30T07-20-02.456Z.log

If you need more details, pls. let me know!
Thanks for support!

@bieniu
Copy link
Owner

bieniu commented Oct 30, 2024

@Spartacus68 Sorry, I commented too quickly. This is actually the same problem. Pagination of response for Shelly.GetComponents.

But I can see that bthomedevice:201 (WK) is configured correctly.

2024-10-30 08:11:57.397 DEBUG (SyncWorker_23) [homeassistant.components.python_script.shellies_discovery_gen2.py] Sending to MQTT broker: homeassistant/sensor/shelly1minig3-5432045e0d14-7cc6b6652bd9-206-temperature/config {"name": "Temperature", "en": "true", "uniq_id": "shelly1minig3-5432045e0d14-7cc6b6652bd9-206-temperature", "qos": 0, "dev": {"cns": [["bluetooth", "7c:c6:b6:65:2b:d9"]], "ids": ["7c:c6:b6:65:2b:d9"], "name": "wk", "mdl": "Shelly BLU H&T", "mdl_id": "SBHT-003C", "mf": "Allterco Robotics", "via_device": "54:32:04:5e:0d:14"}, "o": {"name": "Shellies Discovery Gen2", "sw": "3.3.0", "url": "https://github.com/bieniu/ha-shellies-discovery-gen2"}, "~": "KG_WK_K02/", "avty": [{"t": "~online", "pl_avail": "true", "pl_not_avail": "false"}, {"t": "~status/rpc", "val_tpl": "{%if value_json.mqtt.connected%}online{%else%}offline{%endif%}"}], "val_tpl": "{{value_json.value}}", "stat_t": "~status/bthomesensor:206", "unit_of_meas": "°C", "dev_cla": "temperature", "stat_cla": "measurement", "sug_dsp_prc": 1}
2024-10-30 08:11:57.660 DEBUG (SyncWorker_23) [homeassistant.components.python_script.shellies_discovery_gen2.py] Sending to MQTT broker: homeassistant/sensor/shelly1minig3-5432045e0d14-7cc6b6652bd9-205-humidity/config {"name": "Humidity", "en": "true", "uniq_id": "shelly1minig3-5432045e0d14-7cc6b6652bd9-205-humidity", "qos": 0, "dev": {"cns": [["bluetooth", "7c:c6:b6:65:2b:d9"]], "ids": ["7c:c6:b6:65:2b:d9"], "name": "wk", "mdl": "Shelly BLU H&T", "mdl_id": "SBHT-003C", "mf": "Allterco Robotics", "via_device": "54:32:04:5e:0d:14"}, "o": {"name": "Shellies Discovery Gen2", "sw": "3.3.0", "url": "https://github.com/bieniu/ha-shellies-discovery-gen2"}, "~": "KG_WK_K02/", "avty": [{"t": "~online", "pl_avail": "true", "pl_not_avail": "false"}, {"t": "~status/rpc", "val_tpl": "{%if value_json.mqtt.connected%}online{%else%}offline{%endif%}"}], "val_tpl": "{{value_json.value}}", "stat_t": "~status/bthomesensor:205", "unit_of_meas": "%", "dev_cla": "humidity", "stat_cla": "measurement", "sug_dsp_prc": 1}
2024-10-30 08:11:57.686 DEBUG (SyncWorker_23) [homeassistant.components.python_script.shellies_discovery_gen2.py] Sending to MQTT broker: homeassistant/sensor/shelly1minig3-5432045e0d14-7cc6b6652bd9-201-signal_strength/config {"name": "Signal strength", "en": "true", "uniq_id": "shelly1minig3-5432045e0d14-7cc6b6652bd9-201-signal_strength", "qos": 0, "dev": {"cns": [["bluetooth", "7c:c6:b6:65:2b:d9"]], "ids": ["7c:c6:b6:65:2b:d9"], "name": "wk", "mdl": "Shelly BLU H&T", "mdl_id": "SBHT-003C", "mf": "Allterco Robotics", "via_device": "54:32:04:5e:0d:14"}, "o": {"name": "Shellies Discovery Gen2", "sw": "3.3.0", "url": "https://github.com/bieniu/ha-shellies-discovery-gen2"}, "~": "KG_WK_K02/", "avty": [{"t": "~online", "pl_avail": "true", "pl_not_avail": "false"}, {"t": "~status/rpc", "val_tpl": "{%if value_json.mqtt.connected%}online{%else%}offline{%endif%}"}], "val_tpl": "{{value_json.rssi}}", "stat_t": "~status/bthomedevice:201", "unit_of_meas": "dBm", "dev_cla": "signal_strength", "ent_cat": "diagnostic", "stat_cla": "measurement"}
2024-10-30 08:11:57.705 DEBUG (SyncWorker_23) [homeassistant.components.python_script.shellies_discovery_gen2.py] Sending to MQTT broker: homeassistant/sensor/shelly1minig3-5432045e0d14-7cc6b6652bd9-201-battery/config {"name": "Battery", "en": "true", "uniq_id": "shelly1minig3-5432045e0d14-7cc6b6652bd9-201-battery", "qos": 0, "dev": {"cns": [["bluetooth", "7c:c6:b6:65:2b:d9"]], "ids": ["7c:c6:b6:65:2b:d9"], "name": "wk", "mdl": "Shelly BLU H&T", "mdl_id": "SBHT-003C", "mf": "Allterco Robotics", "via_device": "54:32:04:5e:0d:14"}, "o": {"name": "Shellies Discovery Gen2", "sw": "3.3.0", "url": "https://github.com/bieniu/ha-shellies-discovery-gen2"}, "~": "KG_WK_K02/", "avty": [{"t": "~online", "pl_avail": "true", "pl_not_avail": "false"}, {"t": "~status/rpc", "val_tpl": "{%if value_json.mqtt.connected%}online{%else%}offline{%endif%}"}], "val_tpl": "{{value_json.battery}}", "stat_t": "~status/bthomedevice:201", "unit_of_meas": "%", "dev_cla": "battery", "ent_cat": "diagnostic"}

@Spartacus68
Copy link

ok, then I will not open a new topic. Please. let me know if you need additional support.

The wk is correctley configured, but will not update data anymore.
image
when I remove the BLU H&T from HA, it will also not reconfigured anymore.

@bieniu
Copy link
Owner

bieniu commented Oct 30, 2024

The frequency of data updates has nothing to do with Shellies Discovery. If the MQTT device configuration is correct, then Shellies Discovery has completed its work successfully. The rest is on the Shelly devices side.

when I remove the BLU H&T from HA, it will also not reconfigured anymore.

Show me the log.

@Spartacus68
Copy link

Hi Maciej,

please believe me! HomeAssitant receives no data from the BLU H&T devices if more than one BLU H&T is configured on the shelly. I checked this by pressing the button on the BLU H&T. In the mqtt Explorer, I can see, that the data are sent out when I press the button on the BLU H&T. But in HA still the outdoated data are avaulable. HA does not receive it.

If I remove all BLU H&T from the shelly and if I reconfigure only one BLU H&T on the shelly device, HA receives the data.

@bieniu
Copy link
Owner

bieniu commented Oct 30, 2024

I believe you but I will repeat it once again Shellies Discovery has nothing to do with data transfer between the device and HA. The device itself, BLU gateway, MQTT broker and MQTT integration are responsible for this. The log shows the correct device configuration that matches what is in your MQTT broker so from my point of view the script works.

This issue concerns the inability to configure more than one BLU device for one gateway and let's stay on this topic. Discussing other issues here is pointless.

@bieniu
Copy link
Owner

bieniu commented Nov 11, 2024

Could someone with multiple BLU TRV paired with one gateway show me the response to:

http://GATEWAY_IP/rpc/Shelly.GetComponents?include=["config"]

@Spartacus68
Copy link

Hi,
is this what you need? This Shelly works with two BLU H&T Devices with the shelly integration. At the moment I do not have two BLU H&T with you mqtt integration. If this is needed, pls. let me know.

{
    "components": [
        {
            "key": "ble",
            "config": {
                "enable": true,
                "rpc": {
                    "enable": true
                },
                "observer": {
                    "enable": true
                }
            }
        },
        {
            "key": "bthome",
            "config": {}
        },
        {
            "key": "bthomedevice:200",
            "config": {
                "id": 200,
                "addr": "38:39:8f:7c:de:4a",
                "name": "GH_out",
                "key": null,
                "meta": {
                    "ui": {
                        "view": "regular",
                        "local_name": "SBHT-003C",
                        "icon": null
                    }
                }
            }
        },
        {
            "key": "bthomedevice:201",
            "config": {
                "id": 201,
                "addr": "b0:c7:de:04:22:0e",
                "name": "GH_in",
                "key": null,
                "meta": {
                    "ui": {
                        "view": "regular",
                        "local_name": "SBHT-003C",
                        "icon": ""
                    }
                }
            }
        },
        {
            "key": "bthomesensor:200",
            "config": {
                "id": 200,
                "addr": "38:39:8f:7c:de:4a",
                "name": "bat",
                "obj_id": 1,
                "idx": 0,
                "meta": {
                    "ui": {
                        "icon": ""
                    }
                }
            }
        },
        {
            "key": "bthomesensor:201",
            "config": {
                "id": 201,
                "addr": "38:39:8f:7c:de:4a",
                "name": "h",
                "obj_id": 46,
                "idx": 0,
                "meta": {
                    "ui": {
                        "icon": null
                    }
                }
            }
        },
        {
            "key": "bthomesensor:202",
            "config": {
                "id": 202,
                "addr": "38:39:8f:7c:de:4a",
                "name": "t",
                "obj_id": 69,
                "idx": 0,
                "meta": {
                    "ui": {
                        "icon": ""
                    }
                }
            }
        },
        {
            "key": "bthomesensor:203",
            "config": {
                "id": 203,
                "addr": "b0:c7:de:04:22:0e",
                "name": "bat",
                "obj_id": 1,
                "idx": 0,
                "meta": {
                    "ui": {
                        "icon": null
                    }
                }
            }
        },
        {
            "key": "bthomesensor:204",
            "config": {
                "id": 204,
                "addr": "b0:c7:de:04:22:0e",
                "name": "h",
                "obj_id": 46,
                "idx": 0,
                "meta": {
                    "ui": {
                        "icon": null
                    }
                }
            }
        },
        {
            "key": "bthomesensor:205",
            "config": {
                "id": 205,
                "addr": "b0:c7:de:04:22:0e",
                "name": "t",
                "obj_id": 69,
                "idx": 0,
                "meta": {
                    "ui": {
                        "icon": null
                    }
                }
            }
        },
        {
            "key": "cloud",
            "config": {
                "enable": false,
                "server": "iot.shelly.cloud:6012/jrpc"
            }
        },
        {
            "key": "input:0",
            "config": {
                "id": 0,
                "name": "E0",
                "type": "switch",
                "enable": true,
                "invert": false,
                "factory_reset": true
            }
        },
        {
            "key": "knx",
            "config": {
                "enable": false,
                "ia": "15.15.255",
                "routing": {
                    "addr": "224.0.23.12:3671"
                }
            }
        },
        {
            "key": "mqtt",
            "config": {
                "enable": false,
                "server": "mosquitto.home.schettner.de:8883",
                "client_id": "GH_K01",
                "user": "mqttService",
                "ssl_ca": "user_ca.pem",
                "topic_prefix": "GH_K01",
                "rpc_ntf": true,
                "status_ntf": true,
                "use_client_cert": false,
                "enable_rpc": true,
                "enable_control": true
            }
        },
        {
            "key": "script:1",
            "config": {
                "id": 1,
                "name": "shellies_discovery_gen2_script_20240216",
                "enable": false
            }
        },
        {
            "key": "script:3",
            "config": {
                "id": 3,
                "name": "BLU2MQTT",
                "enable": false
            }
        },
        {
            "key": "script:2",
            "config": {
                "id": 2,
                "name": "aioshelly_ble_integration",
                "enable": false
            }
        }
    ],
    "cfg_rev": 60,
    "offset": 0,
    "total": 21
}

@bieniu
Copy link
Owner

bieniu commented Nov 11, 2024

Could you also show me the output for:

http://GATEWAY_IP/rpc/Shelly.GetComponents

@Spartacus68
Copy link

{
    "components": [
        {
            "key": "ble",
            "status": {},
            "config": {
                "enable": true,
                "rpc": {
                    "enable": true
                },
                "observer": {
                    "enable": true
                }
            }
        },
        {
            "key": "bthome",
            "status": {},
            "config": {}
        },
        {
            "key": "bthomedevice:200",
            "status": {
                "id": 200,
                "rssi": -87,
                "battery": 100,
                "packet_id": 4,
                "last_updated_ts": 1731320375
            },
            "config": {
                "id": 200,
                "addr": "38:39:8f:7c:de:4a",
                "name": "GH_out",
                "key": null,
                "meta": {
                    "ui": {
                        "view": "regular",
                        "local_name": "SBHT-003C",
                        "icon": null
                    }
                }
            }
        },
        {
            "key": "bthomedevice:201",
            "status": {
                "id": 201,
                "rssi": -43,
                "battery": 100,
                "packet_id": 11,
                "last_updated_ts": 1731320390
            },
            "config": {
                "id": 201,
                "addr": "b0:c7:de:04:22:0e",
                "name": "GH_in",
                "key": null,
                "meta": {
                    "ui": {
                        "view": "regular",
                        "local_name": "SBHT-003C",
                        "icon": ""
                    }
                }
            }
        },
        {
            "key": "bthomesensor:200",
            "status": {
                "id": 200,
                "value": 100,
                "last_updated_ts": 1731320375
            },
            "config": {
                "id": 200,
                "addr": "38:39:8f:7c:de:4a",
                "name": "bat",
                "obj_id": 1,
                "idx": 0,
                "meta": {
                    "ui": {
                        "icon": ""
                    }
                }
            }
        },
        {
            "key": "bthomesensor:201",
            "status": {
                "id": 201,
                "value": 98,
                "last_updated_ts": 1731320375
            },
            "config": {
                "id": 201,
                "addr": "38:39:8f:7c:de:4a",
                "name": "h",
                "obj_id": 46,
                "idx": 0,
                "meta": {
                    "ui": {
                        "icon": null
                    }
                }
            }
        },
        {
            "key": "bthomesensor:202",
            "status": {
                "id": 202,
                "value": 8.7,
                "last_updated_ts": 1731320375
            },
            "config": {
                "id": 202,
                "addr": "38:39:8f:7c:de:4a",
                "name": "t",
                "obj_id": 69,
                "idx": 0,
                "meta": {
                    "ui": {
                        "icon": ""
                    }
                }
            }
        },
        {
            "key": "bthomesensor:203",
            "status": {
                "id": 203,
                "value": 100,
                "last_updated_ts": 1731320390
            },
            "config": {
                "id": 203,
                "addr": "b0:c7:de:04:22:0e",
                "name": "bat",
                "obj_id": 1,
                "idx": 0,
                "meta": {
                    "ui": {
                        "icon": null
                    }
                }
            }
        },
        {
            "key": "bthomesensor:204",
            "status": {
                "id": 204,
                "value": 80,
                "last_updated_ts": 1731320390
            },
            "config": {
                "id": 204,
                "addr": "b0:c7:de:04:22:0e",
                "name": "h",
                "obj_id": 46,
                "idx": 0,
                "meta": {
                    "ui": {
                        "icon": null
                    }
                }
            }
        },
        {
            "key": "bthomesensor:205",
            "status": {
                "id": 205,
                "value": 11.2,
                "last_updated_ts": 1731320390
            },
            "config": {
                "id": 205,
                "addr": "b0:c7:de:04:22:0e",
                "name": "t",
                "obj_id": 69,
                "idx": 0,
                "meta": {
                    "ui": {
                        "icon": null
                    }
                }
            }
        },
        {
            "key": "cloud",
            "status": {
                "connected": false
            },
            "config": {
                "enable": false,
                "server": "iot.shelly.cloud:6012/jrpc"
            }
        },
        {
            "key": "input:0",
            "status": {
                "id": 0,
                "state": false
            },
            "config": {
                "id": 0,
                "name": "E0",
                "type": "switch",
                "enable": true,
                "invert": false,
                "factory_reset": true
            }
        }
    ],
    "cfg_rev": 60,
    "offset": 0,
    "total": 21
}

@bieniu
Copy link
Owner

bieniu commented Nov 12, 2024

Please test new shellies_announce_gen2 automation:

# automations.yaml file
- id: shellies_announce_gen2
  alias: "Shellies Announce Gen2"
  triggers:
    - platform: homeassistant
      event: start
  variables:
    get_config_payload: "{{ {'id': 1, 'src': 'shellies_discovery', 'method': 'Shelly.GetConfig'} | to_json }}"
    get_components_payload: "{{ {'id': 1, 'src': 'shellies_discovery', 'method':'Shelly.GetComponents', 'params': {'include': ['config']}} | to_json }}"
    device_ids:  # enter the list of device IDs (MQTT prefixes) here
      - shellyplus2pm-485519a1ff8c
      - custom-prefix/shelly-kitchen
  actions:
    - repeat:
        for_each: "{{ device_ids }}"
        sequence:
          - action: mqtt.publish
            data:
              topic: "{{ repeat.item }}/rpc"
              payload: "{{ get_config_payload }}"
          - service: mqtt.publish
            data:
              topic: "{{ repeat.item }}/rpc"
              payload: "{{ get_components_payload }}"

@Spartacus68
Copy link

Hi Maciej,

here the setup of the shelly:
image

I can see now the second BLU H&T (ha) in Homeassistant, but it is connected to the first BLU H&T (wk) and not direkcly under the device.
image
image
image

@bieniu
Copy link
Owner

bieniu commented Nov 12, 2024

Debug log please.

@Spartacus68
Copy link

@bieniu
Copy link
Owner

bieniu commented Nov 12, 2024

but it is connected to the first BLU H&T (wk) and not direkcly under the device

Fixed in 3.5.2.

@Spartacus68
Copy link

thank you very much for your support! I am looking forward to download the new version.

@lantuin

This comment was marked as spam.

@pkoutny
Copy link

pkoutny commented Dec 8, 2024

Please test new shellies_announce_gen2 automation:

# automations.yaml file
- id: shellies_announce_gen2
  alias: "Shellies Announce Gen2"
  triggers:
    - platform: homeassistant
      event: start
  variables:
    get_config_payload: "{{ {'id': 1, 'src': 'shellies_discovery', 'method': 'Shelly.GetConfig'} | to_json }}"
    get_components_payload: "{{ {'id': 1, 'src': 'shellies_discovery', 'method':'Shelly.GetComponents', 'params': {'include': ['config']}} | to_json }}"
    device_ids:  # enter the list of device IDs (MQTT prefixes) here
      - shellyplus2pm-485519a1ff8c
      - custom-prefix/shelly-kitchen
  actions:
    - repeat:
        for_each: "{{ device_ids }}"
        sequence:
          - action: mqtt.publish
            data:
              topic: "{{ repeat.item }}/rpc"
              payload: "{{ get_config_payload }}"
          - service: mqtt.publish
            data:
              topic: "{{ repeat.item }}/rpc"
              payload: "{{ get_components_payload }}"

I've tested that (seems to be also the version in Readme). It added second TRV from the same gateway, but third TRV is still nowhere (I've two gateways with 3 TRVs each).

@vantech14
Copy link

I am experiencing the same issue - cannot add a 3rd TRV using the script.

Any update on this?

Many Thanks!

@lantuin
Copy link

lantuin commented Dec 20, 2024

Please test new shellies_announce_gen2 automation:

# automations.yaml file
- id: shellies_announce_gen2
  alias: "Shellies Announce Gen2"
  triggers:
    - platform: homeassistant
      event: start
  variables:
    get_config_payload: "{{ {'id': 1, 'src': 'shellies_discovery', 'method': 'Shelly.GetConfig'} | to_json }}"
    get_components_payload: "{{ {'id': 1, 'src': 'shellies_discovery', 'method':'Shelly.GetComponents', 'params': {'include': ['config']}} | to_json }}"
    device_ids:  # enter the list of device IDs (MQTT prefixes) here
      - shellyplus2pm-485519a1ff8c
      - custom-prefix/shelly-kitchen
  actions:
    - repeat:
        for_each: "{{ device_ids }}"
        sequence:
          - action: mqtt.publish
            data:
              topic: "{{ repeat.item }}/rpc"
              payload: "{{ get_config_payload }}"
          - service: mqtt.publish
            data:
              topic: "{{ repeat.item }}/rpc"
              payload: "{{ get_components_payload }}"

I've tested that (seems to be also the version in Readme). It added second TRV from the same gateway, but third TRV is still nowhere (I've two gateways with 3 TRVs each).

I cannot add the 2nd TRV. I don't know what I do wrong

@vantech14
Copy link

@lantuin this does not work for me, I am already using this automation Gen2.

@bieniu
Copy link
Owner

bieniu commented Dec 20, 2024

That's right, the problem still exists, that's why this issue is open. I have no idea how to solve the problem yet, so there's nothing I can do about it.

@AndyBowden

This comment has been minimized.

@bieniu
Copy link
Owner

bieniu commented Jan 17, 2025

@AndyBowden This is not a right place to ask for support. You can ask here https://community.home-assistant.io/t/shellies-discovery-gen2-script/384479 and I'll help you.

@yny0
Copy link

yny0 commented Jan 19, 2025

Hello Bieniu
I have been working on getting my TRV's to work with Homeassistant for several weeks now, I have tried several options.
I installed the script a couple weeks ago, but I couldn't get it to work on the first try and I haven't worked on it for 2 weeks now. I saw this problem and thought it was never going to work. I ordered these multipacks from Shelly, so I didn't even get one gateway per TRV. But I thought I'd try your script again, and it's working perfectly fine for me now with 2 TRV's. I'll install the third one today and then check again to see if it works. I don't know if this has something to do with the last update or if I just got lucky.
If you need more information, feel free to ask me.

@bieniu
Copy link
Owner

bieniu commented Jan 19, 2025

Yes, two TRVs for one gateway should work, more than two (probably) won't. And honestly they probably never will because I still have no idea how to address this problem and Shelly won't change its API.

@Spartacus68

This comment has been minimized.

@bieniu
Copy link
Owner

bieniu commented Jan 19, 2025

Guys, please do not spam this thread.

@SinafdeGiraf
Copy link

I just connected three TRVs. It's a bit messy, but I connected the first then ran the announce automation. After it got added to Home Assistant I paired the next two and deleted the first one. I ran the automation and then paired the first TRV again. It got the same id from the gateway (200) as before and they all work.

@yny0
Copy link

yny0 commented Feb 9, 2025

Shelly recently released a beta update for Gateway Gen 3 which should now support TRV's via the standard Shelly integration, as well as temperature H&T, bulbs etc. Unfortunately the post is in German, so you will need to translate it into English or your native language: https://shelly-forum.com/thread/28503-blu-trv-unterst%C3%BCtzung-in-homeassistant-2025-2-in-shelly-integration/
This is for your information. I have already done these steps and the first impression is good. I also looked at the changelog for the beta update: https://shelly-api-docs.shelly.cloud/gen2/changelog/ it says “Add blutrv.temperature_change and blutrv.position_change webhook types to BluTRV component” so I'm pretty confident that it works now or will work soon. I wanted to tell you that I never thought it wouldn't be fixed or added by Shelly, as Shelly recently added HA support for the wall displays and that's a big deal. I guess one of Shelly's biggest communities overlaps with the HA community. Had I done deeper research on this topic, I would not have purchased these TRV's without HA integration and I don't think I'm the only one.

EDIT: Unfortunately there is no boost available yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants