Python script not working

Posted on
Wed Jan 05, 2022 1:57 pm
SMUSEBY offline
Posts: 297
Joined: Sep 16, 2009

Python script not working

Joe -in 2020, you were kind enough to write a script for me that writes temperature data to a text file. The script is triggered in indigo when there is a temperature change.
Code: Select all
dev = indigo.devices[1969337208] #outside phidgets temp sensor
data = dev.states['temperature']

with open('/Users/rss/OneDrive/Documents/GBK/G oS Temp Data.txt', 'a') as outfile:
    output = u"{0: %Y, %m, %d, %H:%M}, {1}C\n".format(indigo.server.getTime(), data)
    outfile.write(output)

I just noticed that the above script and two others are no longer writing to the text file. There is no error message in the event log. I've verified that the dev reference is accurate, and that the file exists.
If you have a moment, and can see what is wrong, would you please let me know?
Thanks,
Bob

Posted on
Wed Jan 05, 2022 2:31 pm
SMUSEBY offline
Posts: 297
Joined: Sep 16, 2009

Re: Python script not working

It's a OneDrive issue.

Posted on
Wed Jan 05, 2022 2:44 pm
FlyingDiver offline
User avatar
Posts: 5605
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Python script not working

Yeah, writing or appending to a cloud-synced file could be problematic.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest