Jump to content

Logging variables on demand


hart2hart

Recommended Posts

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?

Link to comment

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.

Link to comment
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.

Link to comment

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.  

  1. @MrBill a network push to IFTT, where they have a 'few' micro-aps to add to google sheets.
  2. 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.
  3. 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. 

 

Link to comment

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.

Link to comment
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. 

Link to comment
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.

Link to comment
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

Link to comment

@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.

Link to comment
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.

Link to comment

Archived

This topic is now archived and is closed to further replies.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      36.9k
    • Total Posts
      370.2k
×
×
  • Create New...