bieniu / ha-shellies-discovery-gen2

Script that adds MQTT discovery support for Shellies Gen2 devices
Apache License 2.0
103 stars 18 forks source link

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

Open gu-stera opened 2 hours ago

gu-stera commented 2 hours ago

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 commented 2 hours ago

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

gu-stera commented 54 minutes ago

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:

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 commented 53 minutes ago

Debug log?

gu-stera commented 22 minutes ago

home-assistant_2024-10-23T14-02-10.478Z.log