SIP
Moisture Sensor Chart - Printable Version

+- SIP (https://nosack.com/sipforum)
+-- Forum: SIP (Sustainable Irrigation Platform) (https://nosack.com/sipforum/forumdisplay.php?fid=1)
+--- Forum: Writing plugins (https://nosack.com/sipforum/forumdisplay.php?fid=8)
+--- Thread: Moisture Sensor Chart (/showthread.php?tid=324)



Moisture Sensor Chart - cdesouza - 2024 Feb 16

The purpose of this plugin is to display charts for the following data
  • moisture sensor data collected by the moisture_sensor_data_mqtt plugin
  • watering time (accumulated per day)

Sometime in the future I would also like to display charts for
  • temperature of my overwintering tent
  • water level in the water butt

I have played around with chart.js and have a rudimentary framework setup to configure and display charts:

   
   

I do however have some questions:
  1. I required chart.js and d2.js to be installed. I guess they should be installed under ./static/scripts. How will they be installed, via plugin manifest or will they come with the SIP installation?
  2. As far as I understand the chart.js documentation if I work with milliseconds I do not required a data adapter, however I could not get this to work so I would also required luxon.js and chartjs-adaptor-luxon. Again both in ./static/scripts. So the same question as for 1. applies.
  3. The moisture sensor data that I want to display is under ./data/moisture_sensor_data. This cannot be loaded via d3.js as it does not see this directory. Can this be changed or should the data be stored somewhere else?
  4. For the accumulated watering time I had planned to listen for the schedule completed signal and sum the schedule time for each station or is this information already available somewhere?  

I'm playing with the idea of turning this into a chart plugin that takes a sets of datasource/configuration and displays a chart for each.


RE: Moisture Sensor Chart - dan - 2024 Feb 18

For 1 and 2 the manifest should work.

Not sure about 3. Could you use a symbolic link?

for 4, the accumulated watering time is not currently calculated. You could get the durations from gv.lrun or possibly from gv.rs. gv.lrun would have the correct durations of a program was cut short.


RE: Moisture Sensor Chart - cdesouza - 2024 Mar 04

I put the data files under static/data

What is program 0? I see that log_run() in helpers.py ignores this program.

More or less done with the plugin but I found a few cases where the station_completed signal is not sent when I think it should be sent:

  1. STOP ALL STATIONS
  2. Station sequential and concurrent mode - when a station is running a program and a new program is started on the same station 
  3. Station sequential mode - when a station is running a program and a new program is started on a different station   



RE: Moisture Sensor Chart - dan - 2024 Mar 05

I will take a look at this.


RE: Moisture Sensor Chart - cdesouza - 2024 Mar 08

I'm done with testing and I did not find any more issue apart from those mentioned in the previous post. 

So from my point of view the pull request containing the schedule_data_collector and the simple_chart plugins could be merged.