Shelly Script - MQTT Discovery

I’ve updated this Shelly script, adding support for Shelly Plus Addon, x-sensors (Shelly analog inputs allow defining custom formulas and units) and following Shelly components:

  • cover (incl. position and slat if enabled)
  • humidity
  • voltmeter (incl. custom formula and units)
  • input, binary and analog (incl. custom formula and units)

Now the script triggers Discovery not only on script start, but also on MQTT connect event as well as some Shelly configuration changes (i.e., change to device or channel name).

With the growing number of supported Shelly components, the script was taking more and more memory. Simply put, it deserved refactoring, which cut another 5kB :slight_smile:

1 Like