Tasmota: Feature Request: Add device config via loadable template specific file

Created on 9 Feb 2019  路  57Comments  路  Source: arendst/Tasmota

Have you look for this feature in other issues and in the wiki?
Yes
Is your feature request related to a problem? Please describe.

Since the growing amount of devices not all devices can be added to Tasmota code
Describe the solution you'd like

Possibility to load a config file (template) which can be loaded via webfrontend to config Tasmota.
So everyone could share working device config templates for easy setting up his device

awaiting feedback enhancement

Most helpful comment

Will add GUI upload too as suggested by @Jason2866

All 57 comments

As the voice of the average user I wholeheartedly support this feature and it would relieve a lot of stress on the support team (github and discord) as well as making wiki entries a simple image of the device and a link to the config file

Considering.

How about a command like this:

Template {"Name":"Sonoff Basic","Gpio":[17,255,255,255,255,0,0,0,21,56,255,0,0],"Flag":0x00}

With a name up to 14 characters, GPIO numbers as presented by the GPIO command and an optional flag as currently available in sonoff_template.h. The number 255 represents a user selectable configurable GPIO just as in sonoff_template.h.

No fancy upload process needed. Just a command.

Nice, for advanced users!
We have in Discord Chat many users with beginner skill. So we have to explain how to handle this command. What do you think about implementing this now and let us make some experience with.
If this isnt end user friendly enough, doing it additional/alternative via file upload?

Working on it. Might be ready by tomorrow.

Awesome! It will definitely help with the flood of the new devices from Tuya convert. This is a great combination with the recent addition power monitoring pin selection via the GUI ! Easy to cover most of these plugs with Generic now and a simple Wiki page.

Takes some more time for testing as there are major changes needed to satisfy future user requests (I had a vision...).

Anyway I have it functional and am testing the final changes.

Give it a chance.

Command Template usage:

Template - Show current user template
Template 0 - Copy current module to user template
Template <module number> - Copy module to user template
Template {"NAME":"GenericTheo","GPIO":[17,243,29,244,7,201,255,255,138,255,139,255,255],"FLAG":0,"BASE":18} - Set a template. Any JSON field is optional.

Choose user template using command module 0 or use web GUI and select top module name

Usage:

  • Load default Generic module config to user template by executing command template 18
  • Using GUI select user module and Save
  • Using GUI and make your GPIO choices and save
  • To export template just execute command template and copy text to distribute.

Open for any minor changes suggestion.

Looks good @arendst :)

@jziolkowski feature request for Tasmota Device Manager - drop downs to push the JSON? :)

Looks great, but if I get it correctly you use this template with template jsonstring, but after you set a pin you cannot change it, because it wont be a user settable pin (USER_GPIO) anymore.

Did you try it?

@arendst Hope i will find time tomorrow to try!

@arendst Yes, I tried it, but now I found out the problem was on my side, I used Blitzwolf SHP as a base, because that was the only device in reach, with Generic device as base it can be changed.

I did a quick test setting a POW to generic and then template 6 - Should it behave like a POW after that?

Either that or I missed some step because its not showing the pin configs in the web ui...

Ah no I did something wrong... so false alarm :)

image

{"NAME":"Sonoff Pow","GPIO":[17,0,0,0,0,130,0,0,21,132,133,52,0],"FLAG":0,"BASE":6}

image

Works as designed. :-) Big Thx Real cool new feature!
If i had a wish ;-). Could you add Template loading and activating via "Upgrade by file upload" ?
Would be easiest way to share and activate ready made Templates (from the big Tasmota community)
for users with all skill levels. -> Hosting ready made Templates on a "central place" (Community will do!)
Once again thank you for this great "next big thing"

09:22:40 CMD: Template
09:22:40 MQT: stat/sonoff-D4533B3B/RESULT = {"NAME":"BlitzWolf SHP","GPIO":[57,255,56,255,0,134,0,0,131,17,132,21,0],"FLAG":0,"BASE":45}

image
image

Will add GUI upload too as suggested by @Jason2866

See https://github.com/arendst/Sonoff-Tasmota/blob/development/TEMPLATE.md for background information. Ready to be wikified by someone...

@andrethomas

@jziolkowski feature request for Tasmota Device Manager - drop downs to push the JSON? :)

Definitely. I'm polling the firmware for available modules and gpios, so JSON Template output is easy-peasy.

@arendst Thx!
@jziolkowski @andrethomas @blakadder @digiblur Let us discuss in Discord how we can collect, provide templates and get the info to the users.

I am following the addition of this new feature with great interest. I saw the TEMPLATE.md page... but I did not find what links to this page.

In the meantime, I added a page to outline a procedure for determining the GPIO configuration for a "new" device. I tried to put @digiblur's video tutorial into a step-by-step procedure. Please review/edit and let me know if it should link to the TEMPLATE instructions or vice versa. Right now I link to the procedure from the Initial Configuration page.

Regards.

Mike

@meingraham TEMPLATE.md outlines the implementation of https://github.com/arendst/Sonoff-Tasmota/issues/5177#issuecomment-462439713

@andrethomas,

Yes, I am aware - this topic.

But as templates are related to configurations, it is also likely that this TEMPLATE feature will be used in conjunction with retrieving or loading the configuration of Generic modules. I thought that perhaps it would make sense for the configuration procedure page I added ought make note of this TEMPLATE feature.

Will Template be just another Command and thus a link to TEMPLATE.md needs to be added to the Commands wiki? Give the word and I am happy to make the update to the Commands page. I just did not know where this new feature should be surfaced.

Regards.

Mike

Ah I understand your question better now.

I think the best approach would be to add the template command to the commands page but reference it to a new entry in the wiki at https://github.com/arendst/Sonoff-Tasmota/wiki/Templates and add it to the bottom like we have links to Commands and Rules in the footer like

image

Just a suggestion as its likely to become more complex in the not so distant future.

OK. Let's let others weigh in as well.

I definitely see that a repository of templates will be a handy addition - a page with manufacturer, device name, photo (link), model, rev level, ESP8266/8285,Tuya module etc. along with it's template. I was thinking of a table... but that formatting could get messy.

I'm making this up - just for example...

Sonoff | Basic | R1 | ESP8266 | \