Just using a tweak of your logic above to try and get a button dimming and brightening my blind and got a bit of an odd thing happening… it works, but only twice…
[{"id":"e8e6290c0de09c90","type":"server-state-changed","z":"59430083fba16f20","name":"Study Light Switch","server":"3aa13fed.bf745","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.study_light_switch_action","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":660,"wires":[["6cc9216855f24d53","1371276ecd430ab4"]]},{"id":"6cc9216855f24d53","type":"switch","z":"59430083fba16f20","name":"Hold Actions","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"left_top_hold","vt":"str"},{"t":"eq","v":"left_bottom_hold","vt":"str"},{"t":"eq","v":"right_top_hold","vt":"str"},{"t":"eq","v":"right_bottom_hold","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":350,"y":660,"wires":[["df44b2fd95736b35"],["1ecb47afdecdaddf"],["d8315b8b3acdde08"],["6a8878273cf61135"]]},{"id":"df44b2fd95736b35","type":"change","z":"59430083fba16f20","name":"","rules":[{"t":"set","p":"hold_btn_lt","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":600,"wires":[[]]},{"id":"1ecb47afdecdaddf","type":"change","z":"59430083fba16f20","name":"","rules":[{"t":"set","p":"hold_btn_lb","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":640,"wires":[[]]},{"id":"d8315b8b3acdde08","type":"change","z":"59430083fba16f20","name":"","rules":[{"t":"set","p":"hold_btn_rt","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":680,"wires":[["d7b539ce91a0c835"]]},{"id":"6a8878273cf61135","type":"change","z":"59430083fba16f20","name":"","rules":[{"t":"set","p":"hold_btn_rb","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":720,"wires":[["8d0654457eadd171"]]},{"id":"5d4cd4124797a743","type":"api-call-service","z":"59430083fba16f20","name":"","server":"3aa13fed.bf745","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.study_bulb"],"data":"{ \"brightness\": msg.data.attributes.brightness+15 }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":720,"wires":[["95595c2a7ac6add5"]]},{"id":"acb0e4c1adef50af","type":"switch","z":"59430083fba16f20","name":"","property":"hold_btn_rt","propertyType":"flow","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":910,"y":640,"wires":[["d7b539ce91a0c835"]]},{"id":"95595c2a7ac6add5","type":"delay","z":"59430083fba16f20","name":"","pauseType":"delay","timeout":"50","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1070,"y":720,"wires":[["acb0e4c1adef50af"]]},{"id":"d7b539ce91a0c835","type":"api-current-state","z":"59430083fba16f20","name":"","server":"3aa13fed.bf745","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.study_bulb","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":785,"y":720,"wires":[["5d4cd4124797a743"]],"l":false},{"id":"1371276ecd430ab4","type":"debug","z":"59430083fba16f20","name":"debug 24","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":340,"y":580,"wires":[]},{"id":"8d0654457eadd171","type":"api-current-state","z":"59430083fba16f20","name":"","server":"3aa13fed.bf745","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.study_bulb","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":785,"y":780,"wires":[["4bb53e34ae3dfbf0"]],"l":false},{"id":"4bb53e34ae3dfbf0","type":"api-call-service","z":"59430083fba16f20","name":"","server":"3aa13fed.bf745","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.study_bulb"],"data":"{ \"brightness\": msg.data.attributes.brightness-15 }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":890,"y":780,"wires":[["d001348625689d84"]]},{"id":"d001348625689d84","type":"delay","z":"59430083fba16f20","name":"","pauseType":"delay","timeout":"50","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1070,"y":780,"wires":[["59b6a2eea7648bd0"]]},{"id":"59b6a2eea7648bd0","type":"switch","z":"59430083fba16f20","name":"","property":"hold_btn_rb","propertyType":"flow","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":970,"y":860,"wires":[["8d0654457eadd171"]]},{"id":"3aa13fed.bf745","type":"server","name":"Home Assistant","version":4,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m"}]
I suspect it might be because on my button, for some reason holding it (or any action actually) give a blank state response immediately after the actual state change
Is there any way to ignore this?
Is this flow still the best way of doing this?