Here is my attempt at a universal Pico Controller Subflow — for my use cases anyway. The top output sends out all commands and the next five are per button commands for easy integration.
Flow
[{"id":"f303a7d09980af88","type":"subflow","name":"Pico Controller","info":"# **Pico Controller**\n\nThis subflow is an attempt to create a universal pico controller for use with hubitat. Placing it inline with a pico and a dimmer connected through the first output will use defaults of:\n\n100%,up,50%,down,off\n\nfor each button. \n\nThis can be customized as follows:\n\n\n## **Bulb Groups**\nIf the Group environmental variable is selected, then the up and down buttons will increase or decrease the dimmer percentage by 10%. You must also additionally set two additional device nodes for the bulb group that is being acted on. One should be for level commands and it should be titled \"currentlevel\", the other is for switch commands and should be titled \"currentswitch\". Both of these device nodes should be set to send events. This allows the subflow to track the level and switch state of the bulb.","category":"","in":[{"x":148,"y":464,"wires":[{"id":"63141a3d8a75e016"}]}],"out":[{"x":2660,"y":448,"wires":[{"id":"40374c2adb2f601a","port":0},{"id":"759e361417e760fe","port":0},{"id":"1b7e741f075a025a","port":0},{"id":"05849239ecb42d74","port":0},{"id":"da9e8ddd803e5f5c","port":0},{"id":"781021b7c0141623","port":0},{"id":"4c6b7ddf5aaf8c33","port":0},{"id":"8fac24ddda39adfb","port":0},{"id":"b51e8b1b05fba6b3","port":0},{"id":"c4b95f6d92f10bb3","port":0},{"id":"78e8e815a0418aed","port":0},{"id":"778f3cb9bd70477a","port":0},{"id":"579155c6728b1ee2","port":0}]},{"x":2388,"y":192,"wires":[{"id":"40374c2adb2f601a","port":0},{"id":"c4b95f6d92f10bb3","port":0},{"id":"78e8e815a0418aed","port":0},{"id":"778f3cb9bd70477a","port":0},{"id":"579155c6728b1ee2","port":0}]},{"x":2388,"y":384,"wires":[{"id":"759e361417e760fe","port":0},{"id":"1b7e741f075a025a","port":0},{"id":"8fac24ddda39adfb","port":0},{"id":"b51e8b1b05fba6b3","port":0}]},{"x":2388,"y":528,"wires":[{"id":"05849239ecb42d74","port":0}]},{"x":2388,"y":624,"wires":[{"id":"da9e8ddd803e5f5c","port":0},{"id":"781021b7c0141623","port":0},{"id":"8fac24ddda39adfb","port":0}]},{"x":2388,"y":704,"wires":[{"id":"4c6b7ddf5aaf8c33","port":0}]}],"env":[{"name":"Command","type":"str","value":"setLevel","ui":{"label":{"en-US":"Top Command"},"type":"select","opts":{"opts":[{"l":{"en-US":"setLevel"},"v":"setLevel"},{"l":{"en-US":"setColorTemperature"},"v":"setColorTemperature"}]}}},{"name":"CT","type":"str","value":"","ui":{"type":"select","opts":{"opts":[{"l":{"en-US":"circadian2200"},"v":"circadian2200"},{"l":{"en-US":"circadian2700"},"v":"circadian2700"},{"l":{"en-US":"circadianhack2200"},"v":"circadianhack2200"},{"l":{"en-US":"circadianhack2700"},"v":"circadianhack2700"}]}}},{"name":"Top","type":"str","value":"100,1","ui":{"label":{"en-US":"Top Level"}}},{"name":"Favorite","type":"str","value":"50,1","ui":{"label":{"en-US":"Favorite Level"}}},{"name":"Group","type":"bool","value":"false","ui":{"icon":"font-awesome/fa-th","type":"checkbox"}}],"meta":{},"color":"#C7E9C0","inputLabels":["Pico"],"outputLabels":["All","On","Up","Favorite","Down","Off"],"icon":"node-red-dashboard/ui_button.png"},{"id":"b23c6197b2cea3b9","type":"switch","z":"f303a7d09980af88","name":"Button 1-5","property":"payload.value","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"2","vt":"num"},{"t":"eq","v":"3","vt":"num"},{"t":"eq","v":"4","vt":"num"},{"t":"eq","v":"5","vt":"num"}],"checkall":"true","repair":false,"outputs":5,"x":838,"y":496,"wires":[["259b2bf717ab9ad7"],["df2904f4c414d285"],["d5b59dcb81333328"],["70eac538866490d7"],["a3b58046d1ef5a35"]]},{"id":"259b2bf717ab9ad7","type":"switch","z":"f303a7d09980af88","name":"pushed\\n released","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"pushed","vt":"str"},{"t":"eq","v":"released","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1084,"y":272,"wires":[["775c19797c8e1fd6"],[]]},{"id":"759e361417e760fe","type":"change","z":"f303a7d09980af88","name":"Up","rules":[{"t":"set","p":"command","pt":"msg","to":"startLevelChange","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"up","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2002,"y":400,"wires":[[]]},{"id":"da9e8ddd803e5f5c","type":"change","z":"f303a7d09980af88","name":"Down","rules":[{"t":"set","p":"command","pt":"msg","to":"startLevelChange","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"down","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2002,"y":624,"wires":[[]]},{"id":"1b7e741f075a025a","type":"change","z":"f303a7d09980af88","name":"Stop Change","rules":[{"t":"set","p":"command","pt":"msg","to":"stopLevelChange","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2022,"y":432,"wires":[[]]},{"id":"4c6b7ddf5aaf8c33","type":"change","z":"f303a7d09980af88","name":"off","rules":[{"t":"set","p":"command","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2002,"y":704,"wires":[[]]},{"id":"df2904f4c414d285","type":"switch","z":"f303a7d09980af88","name":"pushed\\n released","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"pushed","vt":"str"},{"t":"eq","v":"released","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1084,"y":416,"wires":[["669b3e985b1e3b46"],["334576d2c8ee49f2"]]},{"id":"d5b59dcb81333328","type":"switch","z":"f303a7d09980af88","name":"pushed\\n released","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"pushed","vt":"str"},{"t":"eq","v":"released","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1084,"y":496,"wires":[["05849239ecb42d74"],[]]},{"id":"70eac538866490d7","type":"switch","z":"f303a7d09980af88","name":"pushed\\n released","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"pushed","vt":"str"},{"t":"eq","v":"released","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1084,"y":640,"wires":[["631830a6de09d2d9"],["a60feb41043ace07"]]},{"id":"a3b58046d1ef5a35","type":"switch","z":"f303a7d09980af88","name":"pushed\\n released","property":"payload.name","propertyType":"msg","rules":[{"t":"eq","v":"pushed","vt":"str"},{"t":"eq","v":"released","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1084,"y":704,"wires":[["4c6b7ddf5aaf8c33"],[]]},{"id":"40374c2adb2f601a","type":"change","z":"f303a7d09980af88","name":"Top","rules":[{"t":"set","p":"command","pt":"msg","to":"Command","tot":"env"},{"t":"set","p":"arguments","pt":"msg","to":"Top","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":2002,"y":112,"wires":[[]]},{"id":"05849239ecb42d74","type":"change","z":"f303a7d09980af88","name":"Favorite","rules":[{"t":"set","p":"command","pt":"msg","to":"setLevel","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"Favorite","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":2012,"y":528,"wires":[[]]},{"id":"781021b7c0141623","type":"change","z":"f303a7d09980af88","name":"Stop Change","rules":[{"t":"set","p":"command","pt":"msg","to":"stopLevelChange","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2022,"y":656,"wires":[[]]},{"id":"4f1114b9da9670b6","type":"change","z":"f303a7d09980af88","name":"set topic pico","rules":[{"t":"set","p":"topic","pt":"msg","to":"pico","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":624,"y":496,"wires":[["b23c6197b2cea3b9"]]},{"id":"669b3e985b1e3b46","type":"switch","z":"f303a7d09980af88","name":"env.group","property":"Group","propertyType":"env","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1276,"y":400,"wires":[["3c055e94195a2284"],["759e361417e760fe"]]},{"id":"631830a6de09d2d9","type":"switch","z":"f303a7d09980af88","name":"env.group","property":"Group","propertyType":"env","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1276,"y":624,"wires":[["3a54497853ac3109"],["da9e8ddd803e5f5c"]]},{"id":"63141a3d8a75e016","type":"switch","z":"f303a7d09980af88","name":"topic","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"currentlevel","vt":"str"},{"t":"eq","v":"currentswitch","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":338,"y":464,"wires":[["9cd955ea440c31cb"],["765e19f2b0c58239"],["4f1114b9da9670b6"]]},{"id":"3c055e94195a2284","type":"switch","z":"f303a7d09980af88","name":"switch on/off","property":"switch","propertyType":"flow","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1478,"y":352,"wires":[["45feb05ae438710e","e238d6dc09ae6825"],["b51e8b1b05fba6b3"]]},{"id":"8fac24ddda39adfb","type":"change","z":"f303a7d09980af88","name":"setLevel","rules":[{"t":"set","p":"command","pt":"msg","to":"setLevel","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"payload & \",0\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":2012,"y":480,"wires":[[]]},{"id":"e3c744b8744f7001","type":"counter","z":"f303a7d09980af88","name":"","init":"0","step":"10","lower":"0","upper":"100","mode":"increment","outputs":2,"x":1788,"y":480,"wires":[["8fac24ddda39adfb"],[]]},{"id":"c716835a66d2f1e5","type":"change","z":"f303a7d09980af88","name":"+10","rules":[{"t":"set","p":"increment","pt":"msg","to":"10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1826,"y":336,"wires":[["e3c744b8744f7001"]]},{"id":"922f20cf87e5cfcb","type":"change","z":"f303a7d09980af88","name":"-10","rules":[{"t":"set","p":"decrement","pt":"msg","to":"10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1826,"y":592,"wires":[["e3c744b8744f7001"]]},{"id":"b51e8b1b05fba6b3","type":"change","z":"f303a7d09980af88","name":"10%","rules":[{"t":"set","p":"command","pt":"msg","to":"setLevel","tot":"str"},{"t":"set","p":"arguments","pt":"msg","to":"10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2002,"y":352,"wires":[[]]},{"id":"334576d2c8ee49f2","type":"switch","z":"f303a7d09980af88","name":"env.group","property":"Group","propertyType":"env","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1276,"y":432,"wires":[[],["1b7e741f075a025a"]]},{"id":"a60feb41043ace07","type":"switch","z":"f303a7d09980af88","name":"env.group","property":"Group","propertyType":"env","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1276,"y":656,"wires":[[],["781021b7c0141623"]]},{"id":"9cd955ea440c31cb","type":"change","z":"f303a7d09980af88","name":"","rules":[{"t":"set","p":"level","pt":"flow","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":614,"y":416,"wires":[[]]},{"id":"45feb05ae438710e","type":"delay","z":"f303a7d09980af88","name":"","pauseType":"delay","timeout":"50","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"x":1670,"y":336,"wires":[["c716835a66d2f1e5"]]},{"id":"e238d6dc09ae6825","type":"change","z":"f303a7d09980af88","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"level","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1504,"y":480,"wires":[["e3c744b8744f7001"]]},{"id":"f01c28fca710af98","type":"delay","z":"f303a7d09980af88","name":"","pauseType":"delay","timeout":"50","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"x":1670,"y":592,"wires":[["922f20cf87e5cfcb"]]},{"id":"765e19f2b0c58239","type":"change","z":"f303a7d09980af88","name":"","rules":[{"t":"set","p":"switch","pt":"flow","to":"payload.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":624,"y":448,"wires":[[]]},{"id":"3a54497853ac3109","type":"switch","z":"f303a7d09980af88","name":"switch on/off","property":"switch","propertyType":"flow","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1478,"y":592,"wires":[["f01c28fca710af98","e238d6dc09ae6825"],[]]},{"id":"775c19797c8e1fd6","type":"switch","z":"f303a7d09980af88","name":"env.command","property":"Command","propertyType":"env","rules":[{"t":"eq","v":"setLevel","vt":"str"},{"t":"eq","v":"setColorTemperature","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1296,"y":272,"wires":[["40374c2adb2f601a"],["6bf65029ff099fc4"]]},{"id":"c4b95f6d92f10bb3","type":"change","z":"f303a7d09980af88","name":"circadian2200,Top","rules":[{"t":"set","p":"command","pt":"msg","to":"Command","tot":"env"},{"t":"set","p":"arguments","pt":"msg","to":"$globalContext(\"circadian2200\") & $env('Top')","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":2042,"y":176,"wires":[[]]},{"id":"6bf65029ff099fc4","type":"switch","z":"f303a7d09980af88","name":"env.CT","property":"CT","propertyType":"env","rules":[{"t":"eq","v":"circadian2200","vt":"str"},{"t":"eq","v":"circadian2700","vt":"str"},{"t":"eq","v":"circadianhack2200","vt":"str"},{"t":"eq","v":"circadianhack2700","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1650,"y":272,"wires":[["c4b95f6d92f10bb3"],["78e8e815a0418aed"],["778f3cb9bd70477a"],["579155c6728b1ee2"]]},{"id":"78e8e815a0418aed","type":"change","z":"f303a7d09980af88","name":"circadian2700,Top","rules":[{"t":"set","p":"command","pt":"msg","to":"Command","tot":"env"},{"t":"set","p":"arguments","pt":"msg","to":"$globalContext(\"circadian2700\") & \",\" & $env('Top')","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":2042,"y":208,"wires":[[]]},{"id":"778f3cb9bd70477a","type":"change","z":"f303a7d09980af88","name":"circadianhack2200,Top","rules":[{"t":"set","p":"command","pt":"msg","to":"Command","tot":"env"},{"t":"set","p":"arguments","pt":"msg","to":"$globalContext(\"circadianhack2200\") & $env('Top')","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":2062,"y":240,"wires":[[]]},{"id":"579155c6728b1ee2","type":"change","z":"f303a7d09980af88","name":"circadianhack2700,Top","rules":[{"t":"set","p":"command","pt":"msg","to":"Command","tot":"env"},{"t":"set","p":"arguments","pt":"msg","to":"$globalContext(\"circadianhack2700\") & $env('Top')","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":2062,"y":272,"wires":[[]]}]
this makes for an easy drop in pico controller for different bulbs. For simple dimmer bulbs it can simply be placed between the pico device node and the dimmer command node:
The level of the top button and the center “favorite” button can be set as environmental variables. The default is 100% and 50%:
For color temperature bulbs, I can select the setColorTemperature command as an environmental variable, and then I’ve hard coded my global variable color temps into the flow.
The toughest part was trying to get the up and down dimmer buttons working with bulb groups as hubitat does not support the “startraising” and startlowering” commands for bulb groups. When the “Group” env variable is selected each up or down button press will increase or decrease the level by 10%. The problem is tracking the current state of the bulb, which may be turned on/off and have its level set by many other automations. Ultimately, I ended up using two device nodes set to send level events and switch events. They must be named “currentlevel” and “currentswitch” to be sorted correctly in the subflow. This seems to work relatively reliably.