PythonScriptsPro icon indicating copy to clipboard operation
PythonScriptsPro copied to clipboard

How can I get the return value from a Python script

Open eric2100 opened this issue 5 months ago • 1 comments

How can I get the return value from a Python script? thank you.

action: notify.mobile_app_iphone metadata: {} data: message: aa{{ resp.success }}

action: python_script.exec metadata: {} data: file: /config/python_scripts/hello_world.py response_variable: resp

/config/python_scripts/hello_world.py `from datetime import datetime import logging

logger = logging.getLogger(name)

def run(hass, data, logger): result = {"temperature": 25, "humidity": 60} return {"success": True, "data": result}`

eric2100 avatar Aug 17 '25 19:08 eric2100