hart2hart Posted May 10, 2022 Posted May 10, 2022 I’m writing an irrigation program that:1. Store Flume Node server Today Gallons in variable Flume_Start2. Turns on and off each zone3. Store Flume Node server Today Gallons in variable Flume_End 4. Calculate difference _Start between _End into variable Water_Used At this point, how can I log DateTime, Start variable, End variable, Water_Used Network resource to send it to a service?
kzboray Posted May 10, 2022 Posted May 10, 2022 Setup variables for each and write them at the start / end of a cycle. You probably want to use state variables. s.start.date=${sys.date} s.start.time=${sys.time} s.start.variable= etc I'm not sure what you mean about a network resource to send to a service.
hart2hart Posted May 11, 2022 Author Posted May 11, 2022 Thanks. That’s my question. Write them with what and to where?
oskrypuch Posted May 11, 2022 Posted May 11, 2022 @hart2hartAre you using an ISY994 or IoP on a Polisy? * Orest
hart2hart Posted May 11, 2022 Author Posted May 11, 2022 994 now but making plans for move to IoP in next few months.
MrBill Posted May 11, 2022 Posted May 11, 2022 13 hours ago, hart2hart said: I’m writing an irrigation program that: 1. Store Flume Node server Today Gallons in variable Flume_Start 2. Turns on and off each zone 3. Store Flume Node server Today Gallons in variable Flume_End 4. Calculate difference _Start between _End into variable Water_Used At this point, how can I log DateTime, Start variable, End variable, Water_Used Network resource to send it to a service? A long time ago, I started writing a node server to log data to Google Sheets... I lost. ☹️ This is an area that's really lacking, it would be outstanding if we had a method to collect data for external analysis. 12 hours ago, kzboray said: You probably want to use state variables. I might be missing something, but why would you want to use state variables? If the variable needs to trigger an IF statement, i would understand the use of state variables, if its a just a counter/data collector why would a state variable be used? I'm sure it's less important on speedier Polisy but back in the day that I was using state variables for everything and had 200+, I ran into problems on the 994. State variables do use more processing power than integer variables due to the fact they are triggers.
kzboray Posted May 11, 2022 Posted May 11, 2022 @MrBill As i understood what @hart2hart was trying to be accomplished, these would be used as triggers for something to happen. Thus the state variable. 1
sjenkins Posted May 11, 2022 Posted May 11, 2022 I think if the purpose is to log data in some way there are a number of ways to get there which might be tweaked depending on the task at hand. saying this I do agree it would be really nice now that we have Polisy to just right click on a node or variable and 'turn on logging' which is put to some rolling text file. This would be very cool. @MrBill a network push to IFTT, where they have a 'few' micro-aps to add to google sheets. a network push to an RPi (or any computer, just easy with linux and cheap with RPi) which would store a text file with a date stamp. if your use case is pretty stable then a node server which takes your data and sends to an MQTT and is pulled from there using one of the tools out there, or write your own with python.
tmorse305 Posted May 11, 2022 Posted May 11, 2022 I use NodeLink for logging. You can log devices, programs and variables. The log is written to every time there is a change. I was tracking my heating system run time and use the log data in an excel file to do the calculations. NodeLink is a node server but is not available on Polyglot. I run in on a RPi. It's also a great aid in debugging when programs are not doing what you want them to. 2
kzboray Posted May 11, 2022 Posted May 11, 2022 @simplextech If you're feeling like migrating another NS. seems like there is a home for NodeLink Logging on PG3.
simplextech Posted May 11, 2022 Posted May 11, 2022 5 minutes ago, kzboray said: @simplextech If you're feeling like migrating another NS. seems like there is a home for NodeLink Logging on PG3. Interesting. This gives me a thought that perhaps there should be a forum for Node Server requests? @Geddy any thoughts on this?
Geddy Posted May 11, 2022 Posted May 11, 2022 2 hours ago, simplextech said: This gives me a thought that perhaps there should be a forum for Node Server requests? @Geddy any thoughts on this? @simplextech would you see this as a different place than the current "Product Requests" forum? I mean, it is "way down" in the Site Comments area of the forums, but I'd see that as the best place to post specific requests. I know others have been posting in the PG2 node server section asking if developers are going to be releasing a PG3 version if there isn't already one. But I'm thinking the existing "Product Request" forum would be where I'd suggest posting NS requests. 1
simplextech Posted May 11, 2022 Posted May 11, 2022 10 minutes ago, Geddy said: But I'm thinking the existing "Product Request" forum would be where I'd suggest posting NS requests. Sounds good to me. 1
Bumbershoot Posted May 16, 2022 Posted May 16, 2022 On 5/10/2022 at 3:47 PM, hart2hart said: I’m writing an irrigation program that: 1. Store Flume Node server Today Gallons in variable Flume_Start 2. Turns on and off each zone 3. Store Flume Node server Today Gallons in variable Flume_End 4. Calculate difference _Start between _End into variable Water_Used At this point, how can I log DateTime, Start variable, End variable, Water_Used Network resource to send it to a service? I'm not currently using this technique, but it worked well in the past. https://wiki.universal-devices.com/index.php?title=ISY-994i_Series_INSTEON:Networking#Dynamic.2FCustom_Page_Creation I created a csv file and appended data to it as necessary, making it more useful than a simple log file. I haven't tried this on Polisy, however. 2
hart2hart Posted May 17, 2022 Author Posted May 17, 2022 9 hours ago, Bumbershoot said: I'm not currently using this technique, but it worked well in the past. https://wiki.universal-devices.com/index.php?title=ISY-994i_Series_INSTEON:Networking#Dynamic.2FCustom_Page_Creation I created a csv file and appended data to it as necessary, making it more useful than a simple log file. I haven't tried this on Polisy, however. Perfect! As a temporary solution, I had setup an email notification and was collecting data in an email account so just had to add text to subject for file name and to append. It took me a few minutes to figure out how to add newline. Given it's unix/linux , I assumed it was some combo of \n\r. Turned out to be a simple hitting return in the body of the message. LOL
Ross Posted May 18, 2022 Posted May 18, 2022 (edited) @MrBill's idea of having a node server log to Google Sheets is something I've been hoping would happen for a while (I requested it a couple of years ago). I was successful in logging to GS with Network Resources and IFTTT, but it was cumbersome. While at it, it would be nice to go the other way - type a number in Google Sheets and have it write to a variable (I can do this with Rest; however, it then takes me to another webpage and I'd rather it stay right there. I've looked at @Bumbershoot's CSV. However, I couldn't figure out a way to "automatically" get the CSV to a Google Sheet so I can see it when I'm away from home. Maybe there's a simple step that I'm missing. I will make my requests under Product Requests per @Geddy's advice. Edited May 18, 2022 by Ross Fixed some grammar errors - I'm sure there's some I missed...
apostolakisl Posted May 18, 2022 Posted May 18, 2022 On 5/11/2022 at 12:46 PM, tmorse305 said: I use NodeLink for logging. You can log devices, programs and variables. The log is written to every time there is a change. I was tracking my heating system run time and use the log data in an excel file to do the calculations. NodeLink is a node server but is not available on Polyglot. I run in on a RPi. It's also a great aid in debugging when programs are not doing what you want them to. Hands down, this is the best way to do it. It would only be better if it ran on polyglot. I run it on a 24/7 pc and it works perfectly, but it could be run on rpi, if you can find one as they seem to be in short supply. I use it to track temperature and humidity from Inteon thermostats as well as outside temp/humidity at my church. I use that data to figure out algorithms for running the hvac system. It saves the data as a csv file which open in excel or whatever spread sheet you want. You can set it up to follow whichever variables you want.
Recommended Posts