Tasmota: Template extension

Created on 3 Oct 2019  路  7Comments  路  Source: arendst/Tasmota

Just an idea to extend templates to include "setOption" commands

Optional addition fields could be added like:
"SetOption37":6
and
"SetOption":FFFFFFFF
a 32 bit hex value for the set option 0 - 31, since they are only a bit bit each.

This will complete the implementation of a device is a single string.

question

Most helpful comment

I would keep setoption out of the template.

The user who created a template may have used other "setoptions" that are not related to the specific device thereby creating unexpected behavior for a new user who uses that template.

All 7 comments

Specific setup for a particular device can be placed in the template notes. There are many other settings and rules besides SetOptions that are needed sometimes.

Mike

P.S. I'm unclear what you mean by

"SetOption":FFFFFFFF
a 32 bit hex value for the set option 0 - 31, since they are only a bit bit each.

I would keep setoption out of the template.

The user who created a template may have used other "setoptions" that are not related to the specific device thereby creating unexpected behavior for a new user who uses that template.

Yes, plus the setoptions are spread across three registers, so either include them all or none.

Edit:
@meingraham FFFFFFFF converted from hex to bin has 32 bits. Using simple bit shifting you can set or extract current value of a setoption. It's a nice way to "pack" wide registers into a more convenient form.
image

Initially I thought it would make sense but indeed many setoptions could/would be overwritten making use uncontrollable.

Agreed. Templates are a way to describe the hardware config of the device. SetOptions describe part of functional part of the device. While in certain scenarios these areas overlap, suggesting that a device _requires_ all of the setoptions to be set in a certain way will lead to a lot of confusion.

Closing this issue as it has been answered.


Support Information (Guide)

See Wiki for more information.
See FAQ for common questions/answers and links if none of your question is in the list.
See Chat for more user experience.
See Community for forum.
See Code of Conduct

plus the setoptions are spread across _three_ registers

This is the answer to my question. 32 bits was not enough to specify every SetOption... I was just asking for clarification. Also, some SetOptions are not a simple binary setting. Those would require the bitmask to specify its use plus the value of the SetOption for those that aren't binary.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ximonline picture ximonline  路  3Comments

ximonline picture ximonline  路  3Comments

he-so picture he-so  路  3Comments

wirelesssolution picture wirelesssolution  路  3Comments

TylerDurden23 picture TylerDurden23  路  3Comments