Rule library

Just an idea for the team and the community, IMHO it would be a great addition to the community to have a rule sharing section, where community created rules could be “downloaded” and imported, I.e import someone else’s rule, update devices bingo your off.
Is there any appetite for something like this?

1 Like

This idea has been proposed before but apparently never really took off. There is a forum category dedicated to such examples as well, with no set way on how they are shared (import/export never really caught on, likely because such exports tend to be most useful only in your own environment or may at least carry data other than seen directly in the rule about it):

Nothing to stop anyone from trying again. :grinning:

6 Likes

There's a function in webcore specifically for this. :slight_smile:

The cloning option could be used as the basis for sharing rules.

The only addition to the standard cloning process would be the substitution of Hub Variables in addition to the substitution of devices. This really should be part of the standard cloning process.

I would want to see the file containing the cloned rule to not be editable. Need to ensure the validity of the file.

Hubitat Inc. would need to maintain a location to store these files for validated users.

Rules are open. If you do a standard export you can easily see what's going on. Also very hard to insert something malicious into an automation. You would see it when adding your own devices.

Exported rule

{"deviceReplacements":{"1085":{"deviceName":"Generic Zigbee Shade","deviceLabel":"Blinds-Master Bedroom Front Blinds Wand","deviceTypeName":"Generic Zigbee Shade","deviceTypeNamespace":"hubitat"}},"appReplacements":{"1743":{"appTypeName":"Rule-5.1","appTypeNamespace":"hubitat","appType":"sys","appName":"Rule-5.1","appLabel":"Open Bedroom Blind","parentAppInstalledAppId":"400","parentAppTypeName":"Rule Machine","parentAppTypeNamespace":"hubitat","parentAppName":"Rule Machine","parentAppLabel":"Rule Machine","childApps":{},"singleInstance":false}},"appData":{"1743":{"state":{"actionDone":true,"ndx":2,"p.PB":"true","dateFormat":"yyyy-MM-dd","nestedBlock":[],"clonedName":"Open Bedroom Blind","selectActionsParams":{"label":"Open Bedroom Shade(s)"},"editCondIf":null,"stopOnST":false,"usesTime":false,"nestedIf":[],"trigCustoms":[],"setDisabledActs":true,"capabDone":true,"skipping":false,"lastEvtName":"Triggered","locationBlocked":[],"pbFixed":true,"ruleNdx":1,"actionList":["1"],"notEqual":true,"timeTriggers":[],"locVars":{},"timeHandlersUpdated":true,"actLabelIndent":"","varSettingsUpdated":true,"prevStateUpdated":true,"certainTimes":[],"disabledActions":[],"prevState":{"PB":"true"},"eval":{},"lastEvtText":null,"capabstrue":{"1":"When time is Sunrise+30 minutes<span style='color:black'>(7:06 AM)</span>"},"nestedSkipAll":[],"lastEvtDate":"2026-05-13","nestedInIf":[],"actions":{"1":{"wait":null,"quick":true,"delay":"","modes":{},"method":"getRLShade","indent":"","rule":null,"label":"Open: Master Bedroom Front Blind Wand\\n","cond":0}},"trigDevs":{},"usesDate":false,"actNdx":2,"lastEvtValue":"","installed":true,"waitEvents":[],"private":"true","simpleCond":false,"changedValues":true,"copyL":[],"running":false,"nestedRepIf":[],"lastEvtTime":"06:37","condOper":"cond","nestedElse":[],"varTriggersFixed":true,"setCopyActs":true,"cutAction":[],"broken":false,"fixedMarkIfs":true,"stopped":false,"rulesList":[],"hasPrev":[],"nestedLabel":[],"oldInputAct":true,"inputAct":true,"stateVarsUpdated":true,"lastEvtDevId":null,"waitCondNdx":1,"token":0,"capabsfalse":{},"stPrimed":true,"timeTriggersW":{},"todn":{"n":1},"allLocalVars":{},"timeFormat":"hh:mm","varSettingsOld":{},"olddValues":true,"inUseConds":[],"condDevs":{}},"appSettings":[{"deviceList":null,"multiple":false,"name":"tCapab1","type":"enum","value":"Certain Time"},{"deviceList":null,"multiple":false,"name":"tCapab2","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actionDone","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"runAction","type":"button","value":""},{"deviceList":null,"multiple":true,"name":"copyAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"pausRule","type":"button","value":""},{"deviceList":null,"multiple":true,"name":"disableAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"insertAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"delete","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"useST","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"time1","type":"enum","value":"Sunrise"},{"deviceList":null,"multiple":false,"name":"actSubType.1","type":"enum","value":"getRLShade"},{"deviceList":null,"multiple":false,"name":"actionCancel","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"refreshActions","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"runSingle","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"dValues","type":"bool","value":"true"},{"deviceList":null,"multiple":false,"name":"editAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"pointless","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"comments","type":"textarea","value":""},{"deviceList":null,"multiple":false,"name":"hasAll","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"shadeRL.1","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"cancelCapab","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actType.1","type":"enum","value":"sceneActs"},{"deviceList":null,"multiple":true,"name":"cutAct","type":"enum","value":null},{"deviceList":{"1085":"Blinds-Master Bedroom Front Blinds Wand"},"multiple":true,"name":"shadeOpenClose.1","type":"capability.windowShade,capability.windowBlind","value":null},{"deviceList":null,"multiple":false,"name":"stopRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"date1","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"lvTable","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"origLabel","type":"text","value":"Open Bedroom Blind"},{"deviceList":null,"multiple":false,"name":"atSunriseOffset1","type":"number","value":"30"},{"deviceList":null,"multiple":true,"name":"logging","type":"enum","value":"[\\"Events\\",\\"Triggers\\",\\"Actions\\"]"},{"deviceList":null,"multiple":false,"name":"editCond","type":"enum","value":""},{"deviceList":null,"multiple":true,"name":"deleteAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"actType.2","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"delayAct.1","type":"enum","value":"none"},{"deviceList":null,"multiple":false,"name":"updateRule","type":"button","value":""}],"subscriptions":[{"handler":"midnightHandler","name":"systemStart","type":"LOCATION","typeId":1,"typeName":"■■■■ for Brains","filter":"false"}]}}}````{"deviceReplacements":{"1085":{"deviceName":"Generic Zigbee Shade","deviceLabel":"Blinds-Master Bedroom Front Blinds Wand","deviceTypeName":"Generic Zigbee Shade","deviceTypeNamespace":"hubitat"}},"appReplacements":{"1743":{"appTypeName":"Rule-5.1","appTypeNamespace":"hubitat","appType":"sys","appName":"Rule-5.1","appLabel":"Open Bedroom Blind","parentAppInstalledAppId":"400","parentAppTypeName":"Rule Machine","parentAppTypeNamespace":"hubitat","parentAppName":"Rule Machine","parentAppLabel":"Rule Machine","childApps":{},"singleInstance":false}},"appData":{"1743":{"state":{"actionDone":true,"ndx":2,"p.PB":"true","dateFormat":"yyyy-MM-dd","nestedBlock":[],"clonedName":"Open Bedroom Blind","selectActionsParams":{"label":"Open Bedroom Shade(s)"},"editCondIf":null,"stopOnST":false,"usesTime":false,"nestedIf":[],"trigCustoms":[],"setDisabledActs":true,"capabDone":true,"skipping":false,"lastEvtName":"Triggered","locationBlocked":[],"pbFixed":true,"ruleNdx":1,"actionList":["1"],"notEqual":true,"timeTriggers":[],"locVars":{},"timeHandlersUpdated":true,"actLabelIndent":"","varSettingsUpdated":true,"prevStateUpdated":true,"certainTimes":[],"disabledActions":[],"prevState":{"PB":"true"},"eval":{},"lastEvtText":null,"capabstrue":{"1":"When time is Sunrise+30 minutes<span style='color:black'>(7:06 AM)</span>"},"nestedSkipAll":[],"lastEvtDate":"2026-05-13","nestedInIf":[],"actions":{"1":{"wait":null,"quick":true,"delay":"","modes":{},"method":"getRLShade","indent":"","rule":null,"label":"Open: Master Bedroom Front Blind Wand\\n","cond":0}},"trigDevs":{},"usesDate":false,"actNdx":2,"lastEvtValue":"","installed":true,"waitEvents":[],"private":"true","simpleCond":false,"changedValues":true,"copyL":[],"running":false,"nestedRepIf":[],"lastEvtTime":"06:37","condOper":"cond","nestedElse":[],"varTriggersFixed":true,"setCopyActs":true,"cutAction":[],"broken":false,"fixedMarkIfs":true,"stopped":false,"rulesList":[],"hasPrev":[],"nestedLabel":[],"oldInputAct":true,"inputAct":true,"stateVarsUpdated":true,"lastEvtDevId":null,"waitCondNdx":1,"token":0,"capabsfalse":{},"stPrimed":true,"timeTriggersW":{},"todn":{"n":1},"allLocalVars":{},"timeFormat":"hh:mm","varSettingsOld":{},"olddValues":true,"inUseConds":[],"condDevs":{}},"appSettings":[{"deviceList":null,"multiple":false,"name":"tCapab1","type":"enum","value":"Certain Time"},{"deviceList":null,"multiple":false,"name":"tCapab2","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"actionDone","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"runAction","type":"button","value":""},{"deviceList":null,"multiple":true,"name":"copyAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"pausRule","type":"button","value":""},{"deviceList":null,"multiple":true,"name":"disableAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"insertAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"delete","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"useST","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"time1","type":"enum","value":"Sunrise"},{"deviceList":null,"multiple":false,"name":"actSubType.1","type":"enum","value":"getRLShade"},{"deviceList":null,"multiple":false,"name":"actionCancel","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"refreshActions","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"runSingle","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"dValues","type":"bool","value":"true"},{"deviceList":null,"multiple":false,"name":"editAct","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"pointless","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"comments","type":"textarea","value":""},{"deviceList":null,"multiple":false,"name":"hasAll","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"shadeRL.1","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"cancelCapab","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"actType.1","type":"enum","value":"sceneActs"},{"deviceList":null,"multiple":true,"name":"cutAct","type":"enum","value":null},{"deviceList":{"1085":"Blinds-Master Bedroom Front Blinds Wand"},"multiple":true,"name":"shadeOpenClose.1","type":"capability.windowShade,capability.windowBlind","value":null},{"deviceList":null,"multiple":false,"name":"stopRule","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"date1","type":"bool","value":""},{"deviceList":null,"multiple":false,"name":"lvTable","type":"button","value":""},{"deviceList":null,"multiple":false,"name":"origLabel","type":"text","value":"Open Bedroom Blind"},{"deviceList":null,"multiple":false,"name":"atSunriseOffset1","type":"number","value":"30"},{"deviceList":null,"multiple":true,"name":"logging","type":"enum","value":"[\\"Events\\",\\"Triggers\\",\\"Actions\\"]"},{"deviceList":null,"multiple":false,"name":"editCond","type":"enum","value":""},{"deviceList":null,"multiple":true,"name":"deleteAct","type":"enum","value":null},{"deviceList":null,"multiple":false,"name":"actType.2","type":"enum","value":""},{"deviceList":null,"multiple":false,"name":"delayAct.1","type":"enum","value":"none"},{"deviceList":null,"multiple":false,"name":"updateRule","type":"button","value":""}],"subscriptions":[{"handler":"midnightHandler","name":"systemStart","type":"LOCATION","typeId":1,"typeName":"■■■■ for Brains","filter":"false"}]}}}`
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.