Feeling adventurous? Something new for Shims in the works

Posted on
Wed Feb 26, 2020 2:53 pm
FlyingDiver offline
User avatar
Posts: 7216
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Feeling adventurous? Something new for Shims in the works

I've been thinking about how involved it is to set up new Shims devices, so I'm trying to do something about it. There's a new branch of the plugin on GitHub: https://github.com/FlyingDiver/Indigo-S ... /templates

This version of the plugin can create new devices (and optionally the associated Broker trigger) based on template files. The files are in YAML format, and there's a couple samples included in the plugin wrapper. There's also an external (to the plugin) directory that will also be searched for template files. You can specify the name for that directory in the plugin config.

There's two plugin menu commands - one writes the YAML for a selected plugin to the Indigo log. The other opens a dialog box for picking a template, a broker, and a UniqueID, and then creates a Shim device from that. You can pretty much copy the lines from the log directly to a template file. I think I may have done some edits, but I don't recall the details.

The format of the template file is still a work in progress. Right now, there's redundant data in there which needs to be fixed. But if you take one of the existing files and copy it, you can try to create your own. My intention is to bundle as many templates into the plugin as possible. But since my supply of MQTT generating devices is very limited, most of them will need to come from the community.

I'm probably going to have to enhance the file picker to support sub-directories of templates, as I think the template list could get out of hand otherwise.

The trigger creation code need works too. I'd like to be able to determine if there's already a trigger for this device, and get rid of the option checkbox. Not sure if that'll be possible or not.

If you want to play with this version, go ahead. Just be aware that I'm leaving at oh-dark-thirty Friday morning for almost a month, so expect long delays if you have questions about it. ;)

Also, please create GitHub issues for actual bugs or enhancement requests. I don't want them to get lost in the noise.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Feb 27, 2020 1:36 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Feeling adventurous? Something new for Shims in the work

Wow. Great work. I'll try and find some time to have a play with this.

Posted on
Thu Feb 27, 2020 9:48 am
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Feeling adventurous? Something new for Shims in the work

Cool. I was wondering when you would get around to doing something like this! :D

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Mar 22, 2020 9:37 am
FlyingDiver offline
User avatar
Posts: 7216
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Feeling adventurous? Something new for Shims in the work

Release 0.2.7 - https://github.com/FlyingDiver/Indigo-S ... /tag/0.2.7

First official release with Template support.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Mar 23, 2020 9:22 am
FlyingDiver offline
User avatar
Posts: 7216
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Feeling adventurous? Something new for Shims in the work

  1. Write out template data to log using menu command
  2. Create template file from that data, editing as necessary.
  3. Repeat for additional device types
  4. Use menu command to create new Shim devices from a template. You need to specify the unique-identifier for that particular device, and which Broker device it's associated with.
  5. The plugin will also create a trigger for the device, based on the template data, if requested and needed. If a trigger already exists for the message_type specified in the template, a new trigger will not be created.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Jun 14, 2020 9:47 am
FlyingDiver offline
User avatar
Posts: 7216
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Feeling adventurous? Something new for Shims in the work

Templates are in main plugin branch since 0.2.7.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest