Actionable notifications in home assistant are notifications with buttons that are configured once pressed to trigger automations.
In the video below you can see the step by step actions I did to build a actionable notification template
This is the code below:
Take this code and add a new flow, then click on import from code and paste from below.
Change the template to your own phone and use case.
[{"id":"1901f90f9d7a2bc8","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"d044bd01c7a781c6","type":"comment","z":"1901f90f9d7a2bc8","name":"Generic Template","info":"1) Find our device name from developer tools\ndevices: notify.mobile_app_giordano_s_iphone_12\n\n2) set message value in the \"Set Message\"\n\n3) Set actions","x":180,"y":100,"wires":[]},{"id":"cda25f881a6bf12e","type":"api-call-service","z":"1901f90f9d7a2bc8","name":"Notify Phone","server":"1e5734de.b5addb","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_giordano_s_iphone_12","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"{{message}}\",\"data\":{\"actions\":[{\"action\":\"{{action1}}\",\"title\":\"{{actionTitle1}}\",\"icon\":\"sfsymbols:bell\"},{\"action\":\"{{action2}}\",\"title\":\"{{actionTitle2}}\"}]}}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":570,"y":200,"wires":[["b6b4a2295d33bd65"]]},{"id":"b6b4a2295d33bd65","type":"debug","z":"1901f90f9d7a2bc8","name":"Message","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":200,"wires":[]},{"id":"abd0bc4ea1d0fdce","type":"change","z":"1901f90f9d7a2bc8","name":"Set Message","rules":[{"t":"set","p":"message","pt":"msg","to":"You have left the home and you lamp is on, What should I do?","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":200,"wires":[["48eac47166aeefb3"]]},{"id":"fa868a982347f0a3","type":"inject","z":"1901f90f9d7a2bc8","name":"Start","props":[],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":150,"y":200,"wires":[["abd0bc4ea1d0fdce"]]},{"id":"cda99e943e1bc2a5","type":"server-events","z":"1901f90f9d7a2bc8","name":"All Mobile App Notification Actions","server":"2e31528c.f3973e","version":1,"event_type":"mobile_app_notification_action","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"},{"property":"event_type","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":220,"y":360,"wires":[["7196107ec1d310cd"]]},{"id":"7196107ec1d310cd","type":"switch","z":"1901f90f9d7a2bc8","name":"","property":"payload.event.action","propertyType":"msg","rules":[{"t":"eq","v":"TURN_LAMP_ON","vt":"str"},{"t":"eq","v":"TURN_LAMP_OFF","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":450,"y":360,"wires":[["3c78a272e531b6b5"],["822f3fc0e68f3daa"]]},{"id":"48eac47166aeefb3","type":"change","z":"1901f90f9d7a2bc8","name":"Set Actions","rules":[{"t":"set","p":"action1","pt":"msg","to":"TURN_LAMP_ON","tot":"str"},{"t":"set","p":"action2","pt":"msg","to":"TURN_LAMP_OFF","tot":"str"},{"t":"set","p":"actionTitle1","pt":"msg","to":"Keep the light ON?","tot":"str"},{"t":"set","p":"actionTitle2","pt":"msg","to":"Turn the light OFF?","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":140,"wires":[["cda25f881a6bf12e"]]},{"id":"3c78a272e531b6b5","type":"api-call-service","z":"1901f90f9d7a2bc8","name":"Turn Lamp ON","server":"1e5734de.b5addb","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.hue_go_1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":620,"y":320,"wires":[[]]},{"id":"822f3fc0e68f3daa","type":"api-call-service","z":"1901f90f9d7a2bc8","name":"Turn Lamp OFF","server":"1e5734de.b5addb","version":5,"debugenabled":false,"domain":"light","service":"turn_off","areaId":[],"deviceId":[],"entityId":["light.hue_go_1"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":620,"y":400,"wires":[[]]},{"id":"1e5734de.b5addb","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"},{"id":"2e31528c.f3973e","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]