This add-on “YAMLcomposer” rocks, at least for my use cases ![]()
I only came across it when reading Reimplement my Sitemap (>1000 Items) to WebUI using the yamlcomposer and yaml based widget templates .
At first, and I repeat my commentary here:
The first use case was creating things, items and groups (~50 per battery) for my five 5kWh 48V LiFePO4 batteries connected to my inverter.charger. So far so good…
Then I thought I could realise an indicator light ==> a RGB LED in each room (integrated into a central light fixture) indicates a few events around the house; e.g., when mail has been delivered, the gate is opened, irrigation is running, tank is filling; each with a different colour.
While I have only one dummy light to prototype, YAMLcomposer was ideal in creating the items and groups for it.
version: 1
# Indicator causes are independent state Items. A source rule owns each cause;
# indicator.rules is the only component allowed to control the indicator lights.
items:
grp_Indicator_Causes:
type: Group
label: Indicator causes
grp_Indicator_Red:
type: Group
label: Red indicator causes
grp_Indicator_Orange:
type: Group
label: Orange indicator causes
grp_Indicator_Green:
type: Group
label: Green indicator causes
grp_Indicator_Blue:
type: Group
label: Blue indicator causes
grp_Indicator_Yellow:
type: Group
label: Yellow indicator causes
grp_Indicator_Purple:
type: Group
label: Purple indicator causes
grp_Indicator_Lights_Power:
type: Group
group:
type: Switch
label: Indicator lights power
grp_Indicator_Lights_Colour:
type: Group
group:
type: Color
label: Indicator lights colour
grp_Indicator_Lights_Online:
type: Group
group:
type: Switch
label: Indicator lights online
Indicator_Cause_SmartPlugAlert:
type: Switch
label: Smart-plug fault
groups: ["grp_Indicator_Causes", "grp_Indicator_Red"]
Indicator_Cause_IrrigationRunning:
type: Switch
label: Irrigation running
groups: ["grp_Indicator_Causes", "grp_Indicator_Green"]
Indicator_Cause_TankFilling:
type: Switch
label: Tank filling
groups: ["grp_Indicator_Causes", "grp_Indicator_Blue"]
Indicator_Cause_MailWaiting:
type: Switch
label: Mail waiting
groups: ["grp_Indicator_Causes", "grp_Indicator_Yellow"]
Indicator_Cause_Doorbell:
type: Switch
label: Doorbell
groups: ["grp_Indicator_Causes", "grp_Indicator_Yellow"]
Indicator_Cause_GateEvent:
type: Switch
label: Gate event
groups: ["grp_Indicator_Causes", "grp_Indicator_Yellow"]
Indicator_Cause_GateOpen:
type: Switch
label: Gate open
groups: ["grp_Indicator_Causes", "grp_Indicator_Yellow"]
Indicator_Cause_WashingMachineRunning:
type: Switch
label: Washing machine running
groups: ["grp_Indicator_Causes", "grp_Indicator_Purple"]
Indicator_ActiveCause:
type: String
label: Indicator active cause
Indicator_ActiveColour:
type: String
label: Indicator active colour
Now this is not even the thing that thrilled me; I initially created the items and groups referenced to a location (shed_indicator); yet later realised it should have been location-less (indicator). Instead of using the UI and delete and recreate the items and groups, I created a new .yaml file with the location reference removed; deleted the old .yaml, saved the new; change the item/group names in my text-based rule files, and made a change that could easily have taken 2 hours in less than 15 minutes.
As said I elsewhere: kudo to @jimtng for creating this add-on. I love it (and I am not even a yaml guy) ![]()