-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Add device config via loadable template specific file #5177
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:
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! |
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. |
6.4.1.16 20190211 * Initial support for online template change using command Template (#5177)
Give it a chance. Command Template usage:
Choose user template using command Usage:
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 |
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... |
Works as designed. :-) Big Thx Real cool new feature!
|
Will add GUI upload too as suggested by @Jason2866 |
Initial support for online template change using command Template or GUI Configure Other (#5177)
See https://github.com/arendst/Sonoff-Tasmota/blob/development/TEMPLATE.md for background information. Ready to be wikified by someone... |
Definitely. I'm polling the firmware for available modules and gpios, so JSON Template output is easy-peasy. |
@arendst Thx! |
Isn't this basically already the case? The maker community has been adding new devices to the wiki without issue. Some have made their case for adding them to the official list of templates. But many have just added a new device page and then added a link in the right-hand menu bar. It goes beyond that. For example, with the advent of Tuya OTA, many new devices are flooding in. Since those methods are using TASMOTA as the custom firmware of choice (at least for the initial OTA), there are many in the user base that are providing their configurations for others to leverage. Of course it can all be abused. But my sense is that users are honorable and want to be helpful in providing their configurations. I think they will view adding templates in the same light.
Who is we? With the volume of ESP based devices coming to market almost by the minute, it would be nigh impossible to have templates be moderated and yet keep up with new devices. If templates cannot be kept "up to date", the Regards. Mike |
I like the suggestion from @andrethomas in compliance with the notes from @meingraham |
As I implied this would be an optional thing, by default the manual setup is always available, if the device is connected to the internet this should display as an additional field, where the user could select the template to use, if needed I could make a proof of concept solution on the weekend. Not related to this, I suggest to make a base profile where IO pins are not settable and use that as base profile for any power meter device (As I saw the point of closing my ticket #5134), of course the users still can change the base profile to general, but it should discourage the use of those pins for those who lacks the basic understanding of the firmware. |
@netpok PoC would be cool. Important point!
|
As templates can be uploaded using serial, http, mqtt and even GUI I see no reason to add overhead for a webpage allowing to upload a template. The current version provides enough hooks for external tools like TasmoAdmin to change the template just like any other setting. |
Oh and the already present templates will stay as removing any will defeat backward compatibility and some templates still need extra coding anyway. I like to stop adding templates that are just a deviation of the already available templates like many energy monitoring ones. They will need to use the new template feature. I agree with @meingraham and @andrethomas to have an open repository of templates as there is just no possibility to test them all. Let the user decide what works best. The proposed layout is fine but it doesn't look good in a webpage I guess. Adding a picture will add a lot of space between single entries making the list a very long webpage. |
My idea of the repository includes an interface to add new devices with two features:
|
@arendst The main goal of my proposal is to not add overhead to the project (okay there is a minimal overhead of including it like 25-50 characters in the html code), it should use already existing endpoints and any required elements are loaded externally, if there are network connection available on the browser, the "sonoff" doesn't even need to have access to the internet. |
@netpok You'll get 52 bytes of code space ;-) |
I was proposing a link to a photo, not an img... because I agree that the page would get unruly quickly... Although this suggestion from @blakadder looks "tidy". Nevertheless, once you get dozens of devices, it'll probably be too unruly. Mike |
@arendst minor detail: can the JSON reply for the command "template" have a less ambiguous name? I'd suggest "TemplateName" instead of "NAME". Makes it easier for developers of external tools ;) |
Is this being considered? Would be good to know before a lot of documentation is made! |
I want to keep it as small as possible so for now I won't change it. |
TplName? :) |
Kind questions: What is the need for this name change? When is it a problem it is called NAME instead of TPLNAME? |
Ok, meanwhile @blakadder over discord pointed me to template.md. I see that the keywords have meaning, so now it makes sense. As long as there will be no other /RESULT reply with JSON key NAME inside, then it's fine I guess. I'm just used to other key names in Tasmota to be more self-explanatory, that's all. |
You can change the /RESULT with |
It makes, yes. But doesn't solve my "issue" because I assume 99% of users will have it the standard way. But ok, it's all clear now, thx. |
As promised I created a proof of concept implementation of the device database integration. As it is not meant to be merged I did not create a pull request from it, should I? It is currently available at my fork: https://github.com/netpok/Sonoff-Tasmota/tree/online-device-database Currently it doesn't have any fancy features like searchable selects and the database behind it, but it has two device configs for testing based on the blitzwolf SHP smartplugs. And last but not least it currently does not comply with the 52 byte code limit, but it's managable I think. |
As POC I see you managed to integrate a complete jQuery example with just one line of code! This opens up a whole new kind of client / server functionality (and can of worms). Nice idea and could even lead to much smaller web code in the device but it will depend on a (local or remote) server. For now I go for the new, local template menu but am open to this non-local server idea. |
I never intended to offload any part of the existing code to an external server as it would lead to loss of functionality without internet. jQuery was included to speed up the development, in the final version it could be replaced with native code if required. The can of worms of course should be locked away behind SRI and HSTS, so they can't come out :) I like this local template menu, but I was not able to find it, is it still work in progress? |
Yes it is WIP but I hope to release today. I need to tune the Ajax part in the near future as currently it uses functionality based on my then simple knowledge of updating pages without rewrites. |
TBPH if the webui configuration is structures this way there's really no need to include the web downloading component. This is perfectly straightforward, it is in continuation with the existing gpio configuration so almost no learning curve and it leaves the user free to experiment and change the template according to his needs |
@arendst let's discuss the JSON template you have in mind in a client-server scenario. I could write a standalone one (to the tune of tasmota ota fw-server.py) or integrate it into https://github.com/jziolkowski/tdm EDIT: or expand the fw-server to become ota-template-server.py |
@jziolkowski too early. It was just a brainwave after seeing the possibilities provided by @netpok. If regarding the current template functionality it would be just that. The released JSON message as provided by the template command. |
Got it. But in case you decide it's a plausible idea, I'm up for the task. |
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
The text was updated successfully, but these errors were encountered: