Shelly 1 Gen3 taucht in MQTT nicht auf

Hallo,

ich versuche den Shelly 1 Gen 3 via MQTT einzubinden. Der Shelly hat sich mit dem Mosquito verbunden laut LOG im MQTT Explorer ist er auch drin. Nur taucht er nicht im HA unter MQTT auf. Egal, ob ich Script Shellies Discover nutze, oder das Script von Shelly im 1 Gen 3 direkt

Wo liegt mein Fehler?

Danke

Ich möchte micht deine strategie in HA beeinflussen aber:

Warum nimmt Du nicht die Shelly Integration funktioniert “super” für die Shellys!
Viel komfortabler als mit MQTT

Weil ich gerne sehen würde, das dass Tor zu ist. Das wird in der Shelly App nicht angezeigt.

Auch in einer frischen Installation ist es nicht zu finden. MQTT Explorer ist das Shelly da, HA MQTT erkennt es nicht

Erstelle Dir doch einfach das MQTT Gerät mit den notwendigen Entitäten manuell.

Gruß Osorkon

So, das Shelly Discovery Script habe ich mit HACS installiert, es taucht auf im Explorer auf, aber kein Eintrag im MQTT

Das ist die automations.yaml

- id: shellies_announce_gen2
  alias: “Shellies Announce Gen2”
  triggers:

  - trigger: homeassistant
    event: start
    variables:
    get_config_payload: “{{ {‘id’: 1, ‘src’: ‘shellies_discovery’, ‘method’: ‘Shelly.GetConfig’} | to_json }}”
    device_ids:  # enter the list of device IDs (MQTT prefixes) here
    - shelly1g3-Garage
    - custom-prefix/shelly-Garage
      actions:
  - repeat:
    for_each: “{{ device_ids }}”
    sequence:
    - action: mqtt.publish
    data:
    topic: “{{ repeat.item }}/rpc”
    payload: “{{ get_config_payload }}”
    - action: script.shellies_components_gen2
    data:
    device_topic: “{{ repeat.item }}”

- id: shellies_discovery_gen2
  alias: “Shellies Discovery Gen2”
  mode: queued
  max: 50
  triggers:

  - trigger: mqtt
    topic: shellies_discovery/rpc
    actions:
  - condition: template
    value_template: “{{ ‘components’ not in (trigger.payload_json.result | default({})) }}”
  - 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 }}”
  - action: mqtt.publish
    data:
    topic: “{{ trigger.payload_json.result.mqtt.topic_prefix }}/command”
    payload: “status_update”

Das ist die Scripts.yaml

shellies_components_gen2:
alias: Shellies Components Gen2
mode: queued
max: 50
fields:
device_topic:
description: MQTT topic prefix for the device, e.g. shellies/shelly-1-gen4-abc123
required: true
discovery_prefix:
description: MQTT discovery prefix
default: homeassistant
sequence:
- variables:
device_name: “{{ device_topic.split(‘/’) | last }}”
src: shellies_discovery/{{ device_topic.split(‘/’) | last }}
response_topic: shellies_discovery/{{ device_topic.split(‘/’) | last }}/rpc
all_pages: [ ]
offset: 0
total: 1
device_id: “{{ device_topic.split(‘/’) | last }}”
- repeat:
while:
- condition: template
value_template: “{{ offset < total }}”
sequence:
- action: mqtt.publish
data:
topic: “{{ device_topic }}/rpc”
payload: “{{ {‘id’: 1, ‘src’: src, ‘method’: ‘Shelly.GetComponents’, ‘params’: {‘include’: \[‘config’\], ‘offset’: offset}} | to_json }}”
- wait_for_trigger:
- trigger: mqtt
topic: “{{ response_topic }}”
timeout: “00:00:30”
- if:
- condition: template
value_template: “{{ wait.trigger is none }}”
then:
- stop: Timeout waiting for Shelly.GetComponents from {{ device_topic }}
- variables:
page: “{{ wait.trigger.payload_json.result }}”
device_id: “{{ wait.trigger.payload_json.src }}”
- variables:
all_pages: “{{ all_pages + \[page\] }}”
offset: “{{ page.offset + (page.components | length) }}”
total: “{{ page.total }}”
- action: python_script.shellies_discovery_gen2
data:
id: “{{ device_id }}”
device_config:
components: “{{ all_pages }}”
discovery_prefix: “{{ discovery_prefix | default(‘homeassistant’) }}”
- variables:
all_components: “{{ all_pages | map(attribute=‘components’) | list | flatten }}”
- variables:
mqtt_comp: “{{ all_components | selectattr(‘key’, ‘equalto’, ‘mqtt’) | list | first | default(none) }}”
- condition: template
value_template: “{{ mqtt_comp is not none }}”
- action: mqtt.publish
data:
topic: “{{ mqtt_comp.config.topic_prefix }}/command”
payload: status_update

:crayon:by HarryP: Code-/Logzeilen formatiert (bitte immer in </> einbinden)
s.a.: (Neues Update & Features - Hier in der Community 🫶)

Ich rede nicht von der App sondern der HA Integration. Und da sieht man den Status!
Von was für einem Tor redest du?

Was genau willst du machen?

Garagentor?

Ich steuere mein Garagen Tor mit einem ESP + Reed kontakt für den Status. ESPHOME

Das ganze geht natürlich auch mit dem Shelly 1 und für den Status den Shelly Plus auf den Shelly 1 gesteckt!

Deinen Automation und script viel zu kompliziert!
Hast Du das mit KI ertsellen lassen?

Gruss

Gibt es auf github für Ha.

Im Shelly ist alles aktiviert was Mqtt betrifft ?
Hat der Shelly das Script von ha bekommen und ist es dort gelaufen?

Was meinst Du…?

Das Script zum Auto Discovery.

https://github.com/bieniu/ha-shellies-discovery-gen2

Hallo,

Nein, hat der Shelly nicht bekommen. Im MQTT Explorer sind beide Shellys zu sehen, in den Shellys selbst steht das sie mit dem MQTT Server verbunden sind.

Irgendwo hakt das script noch.