Hi,
I’ve been trying to store state in custom code ( that can be run via a scheduled job ), but so far failed. Use-case is, for example, checing the change in state-of-charge.
I tried a global variable -
import requests
log = logging.getLogger(__name__)
count = 1
def test():
global count
bot_sendtext("Hello World! "+str(count))
count += 1
return {"msg": "Hello world!"}
but I guess the python instance is created each time the scheduled take is run.
Any thoughts ?