< 032020-01-04⋎05 >

farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Feature requests and bug reports: github.com/farmOS/farmOS/issuesSet by ChanServ on 2018-08-16 at 14:32
01:56*farmBOT has joined
11:10*JustTB has quit (Ping timeout: 265 seconds)
11:24*JustTB has joined
12:15*JustTB has quit (Quit: Leaving.)
13:22*spitz234[m] has joined
15:37*cpm has joined
15:55*JustTB has joined
19:28*cpm has quit (Quit: Leaving)
20:34paul121[m]the default sensor graph only displays 24 hours?
20:34paul121[m]Is that correct?
20:35mstenta[m]Actually I think it's only the last 100 points
20:35mstenta[m]That was kind of an arbitrary decision
20:35mstenta[m]With the assumption we'd take a next step at some point
20:54paul121[m]Ah okay
20:55paul121[m]Over Christmas I wrote some scripts to send my dad's solar panel data via notifications to his phone
20:55paul121[m]And just am hooking it into farmOS, too ;-)
20:56paul121[m] * And am just now hooking it into farmOS, too ;-)
20:56paul121[m]Ironically we get about 100 data points per day haha (based on current length of day)
20:57paul121[m]Question: Can you edit sensor data? Mostly would be nice to delete all data for the sensor in the "debugging" phase of setting up the sensor
20:57paul121[m](right now I've archived a few sensor assets to reset the data)
21:04*uploaded an image: Screen Shot 2020-01-04 at 1.04.14 PM.png (185KB) < matrix.org/_matrix/media/r0/download/mat >
21:16mstenta[m]Cool!!
21:17mstenta[m]<paul121[m] "Question: Can you edit sensor da"> Not via the farmOS UI currently
21:17mstenta[m]Workaround would be to delete the sensor asset and create a new one, and copy and paste the public and private keys over to the new one
21:18mstenta[m]If you have direct access to the database you can also do it with an SQL query
21:19mstenta[m]That would be a useful addition though: maybe a delete data button that appears in the edit tab (with a warning and confirm page)
21:23paul121[m]Yeah I think that would be useful
21:23paul121[m]Even with the option to delete data in a given date range
21:25paul121[m]And specify the `value` string so you could delete only some data from the sensor
21:45mstenta[m]Yea! It might not be too hard to do that with a custom Views Bulk Operation
21:47mstenta[m]That would allow you to use the existing filter/sort options, select all, and then have a delete button below the list of data on the main sensor asset page
21:47mstenta[m]VBOs are what all the buttons on asset/log lists are
21:47mstenta[m]They're pretty simple to write
21:47paul121[m]Ohh and the Quantity Report?
21:48mstenta[m]Huh?
21:48paul121[m]The same "sorting" features in the Quantity Report - are those provided by a VBO?
21:48mstenta[m]Oh you mean the filter/sort on the quantity report? Yea that's standard Views module feature
21:49mstenta[m]Views module is basically just a SQL query builder, that lets you build lists of things, and also expose UI forms for sorting/filtering them
21:49mstenta[m]That's what all the lists in farmOS are built with
21:50mstenta[m]Including the sensor data list you see under the graphs
21:50mstenta[m]<paul121[m] "The same "sorting" features in t"> No those aren't VBO, they are just Views features
21:50mstenta[m]VBOs are the buttons at the bottom of lists when you select rows
21:51paul121[m]ohhh! So the "Bulk Operation" piece is the selecting multiple rows, and doing an action on the rows
21:51paul121[m]Yup, makes sense.
21:51mstenta[m]Yes exactly
21:51paul121[m]So the "Custom" part of a VBO is basically just writing the SQL query?
21:51mstenta[m]Not even... It's just writing the action
21:51mstenta[m]Let me find an example...
21:53mstenta[m]github.com/farmOS/farmOS/blob/7.x-1.x/mo
21:53mstenta[m]That hook defines the "Assign" action for assigning logs in bulk to a user
21:54mstenta[m]The only thing that might be a hurdle for the asset sensor data View is...
21:54mstenta[m]The rows are not Drupal entities
21:54mstenta[m]They are just simple database table rows
21:54mstenta[m]I think VBOs might only work with entities... :-/
21:54mstenta[m]I forget though. Maybe it's possible
21:56mstenta[m]Here's another hook that defines three actions for asset entities (archive, unarchive, and clone):
21:56mstenta[m]github.com/farmOS/farmOS/blob/7.x-1.x/mo
21:58mstenta[m]Here's the documentation for definitely custom VBOs
21:58mstenta[m]www.drupal.org/node/2052067
21:58mstenta[m]Defining*
21:59paul121[m]So as soon as you implement `hook_action_info` Drupal knows to display the bulk operations in the View?
22:00mstenta[m]No there's another step necessary: you have to edit the View configuration
22:00mstenta[m]To add the operation as an option
22:00mstenta[m]So you can build views with different sets of operations depending on what you need
22:05mstenta[m]Hmm I don't think it will be possible to use VBO on sensor data... :-(
22:05mstenta[m]www.drupal.org/node/1282486
22:05mstenta[m]> VBO only supports entity (base or revision) tables.
22:07mstenta[m]Drat
22:07paul121[m]haha shoot
22:08mstenta[m]So maybe just a custom form
22:08mstenta[m]Maybe in a new tab separate from the view and edit tabs
22:10paul121[m]That makes sense
22:10paul121[m]And the `form_submit` would run a SQL query
22:10mstenta[m]Yup!
22:11mstenta[m]And you could have the date range and other filters you described
22:12paul121[m]Neat. I'll try and give that a shot
22:13paul121[m]Gtg but hopefully within the next week lol
22:13mstenta[m]That's probably a better approach for this anyway
22:13mstenta[m]Cool! Later!
22:30mstenta[m]@paul121:matrix.org: fyi here is the line that deletes data when a sensor asset is deleted
22:30mstenta[m]github.com/farmOS/farmOS/blob/1e398698e6
22:36*JustTB has left
22:41*JustTB has joined

< 032020-01-04⋏05 >