Skip to content
Aaron edited this page Jan 9, 2023 · 3 revisions

Shelly to Plugin Communication

How does a device propagate its state into Indigo through the plugin?

sequenceDiagram
    autonumber
    participant device as Shelly Device
    participant broker as MQTT Broker
    participant indigo as Indigo
    participant connector as MQTTConnector (Plugin)
    participant plugin as ShellyNGMQTT (Plugin)
    device->>broker: Turned on
    broker-->>connector: Message received
    connector->>indigo: Queue message
    loop Check message queue
        plugin-->>indigo: Process message
    end
Loading
  1. The device is manually turned on (any device-originated change) and a message is sent to the MQTT Broker.
  2. MQTTConnector receives this message through the properly configured topic subscription.
  3. MQTTConnector queues the message for dispatch through Indigo's inter-plugin communication bus.
  4. ShellyNGMQTT continually polls Indigo for queued messages and processes them.

Plugin to Shelly Communication

How does an Indigo action propagate to the device?

sequenceDiagram
    autonumber
    participant device as Shelly Device
    participant broker as MQTT Broker
    participant indigo as Indigo
    participant connector as MQTTConnector (Plugin)
    participant plugin as ShellyNGMQTT (Plugin)
    indigo->>plugin: Turn on
    plugin->>connector: Publish message
    connector->>broker: Publish message
    broker-->>device: Message received
Loading
  1. The device is turned on through the Indigo UI.
  2. Indigo notified ShellyNGMQTT of the action and the plugin generates and publishes a message through MQTTConnector.
  3. MQTTConnector publishes the message to the broker.
  4. The device receives the message through the MQTT topic subscription.
Clone this wiki locally