You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create "device templates" which define how a device is combined into Thing + Channels + Items.
For example, a lightbulb "template" contains the information on what thing(s) to create, from what binding, and what items it should have, e.g. Switch Item for on/off, Dimmer for Brightness, Dimmer for Color Temp, A Color item (so e.g. 4 items).
So when someone wants to add 50x lightbulbs into openhab, they just define 50 instances of this template, instead of creating: 50x Things + 50 * 4 = 200 Items one by one.
Also should they want to add another item to the template, or modify the parameters of an item, e.g. Change the Brightness min/max/steps, or e.g. change its MQTT topic, it can be done on the template, and all the 50 devices will immediately follow suit.
This will greatly simplify things. Hopefully
I have been doing this for years. My "device list" is stored in a YAML file, like this (just to illustrate)
So I have a "Device template" (aka type) of esphome-switch. In this, I would create the Thing, Channels (MQTT), and Items based on that given YAML definition.
Obviously the structure of the YAML is not the point here. It is specific to my implementation.
What this does:
I can add more Switch devices easily by just adding another entry like that
I can still fully customise each items with group / tags / metadata etc.
I can modify the template should I need to make adjustments
I can easily keep the yaml structure above and set it to use a different "template" (i.e. type) and instantly migrate my things/items to a different type of device, e.g. a Zigbee switch instead of ESPHome.
The text was updated successfully, but these errors were encountered:
An idea:
Create "device templates" which define how a device is combined into Thing + Channels + Items.
For example, a lightbulb "template" contains the information on what thing(s) to create, from what binding, and what items it should have, e.g. Switch Item for on/off, Dimmer for Brightness, Dimmer for Color Temp, A Color item (so e.g. 4 items).
So when someone wants to add 50x lightbulbs into openhab, they just define 50 instances of this template, instead of creating: 50x Things + 50 * 4 = 200 Items one by one.
Also should they want to add another item to the template, or modify the parameters of an item, e.g. Change the Brightness min/max/steps, or e.g. change its MQTT topic, it can be done on the template, and all the 50 devices will immediately follow suit.
This will greatly simplify things. Hopefully
I have been doing this for years. My "device list" is stored in a YAML file, like this (just to illustrate)
So I have a "Device template" (aka
type
) ofesphome-switch
. In this, I would create the Thing, Channels (MQTT), and Items based on that given YAML definition.Obviously the structure of the YAML is not the point here. It is specific to my implementation.
What this does:
type
) and instantly migrate my things/items to a different type of device, e.g. a Zigbee switch instead of ESPHome.The text was updated successfully, but these errors were encountered: