| 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:34 | paul121[m] | the default sensor graph only displays 24 hours? |
| 20:34 | paul121[m] | Is that correct? |
| 20:35 | mstenta[m] | Actually I think it's only the last 100 points |
| 20:35 | mstenta[m] | That was kind of an arbitrary decision |
| 20:35 | mstenta[m] | With the assumption we'd take a next step at some point |
| 20:54 | paul121[m] | Ah okay |
| 20:55 | paul121[m] | Over Christmas I wrote some scripts to send my dad's solar panel data via notifications to his phone |
| 20:55 | paul121[m] | And just am hooking it into farmOS, too ;-) |
| 20:56 | paul121[m] | * And am just now hooking it into farmOS, too ;-) |
| 20:56 | paul121[m] | Ironically we get about 100 data points per day haha (based on current length of day) |
| 20:57 | paul121[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:57 | paul121[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:16 | mstenta[m] | Cool!! |
| 21:17 | mstenta[m] | <paul121[m] "Question: Can you edit sensor da"> Not via the farmOS UI currently |
| 21:17 | mstenta[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:18 | mstenta[m] | If you have direct access to the database you can also do it with an SQL query |
| 21:19 | mstenta[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:23 | paul121[m] | Yeah I think that would be useful |
| 21:23 | paul121[m] | Even with the option to delete data in a given date range |
| 21:25 | paul121[m] | And specify the `value` string so you could delete only some data from the sensor |
| 21:45 | mstenta[m] | Yea! It might not be too hard to do that with a custom Views Bulk Operation |
| 21:47 | mstenta[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:47 | mstenta[m] | VBOs are what all the buttons on asset/log lists are |
| 21:47 | mstenta[m] | They're pretty simple to write |
| 21:47 | paul121[m] | Ohh and the Quantity Report? |
| 21:48 | mstenta[m] | Huh? |
| 21:48 | paul121[m] | The same "sorting" features in the Quantity Report - are those provided by a VBO? |
| 21:48 | mstenta[m] | Oh you mean the filter/sort on the quantity report? Yea that's standard Views module feature |
| 21:49 | mstenta[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:49 | mstenta[m] | That's what all the lists in farmOS are built with |
| 21:50 | mstenta[m] | Including the sensor data list you see under the graphs |
| 21:50 | mstenta[m] | <paul121[m] "The same "sorting" features in t"> No those aren't VBO, they are just Views features |
| 21:50 | mstenta[m] | VBOs are the buttons at the bottom of lists when you select rows |
| 21:51 | paul121[m] | ohhh! So the "Bulk Operation" piece is the selecting multiple rows, and doing an action on the rows |
| 21:51 | paul121[m] | Yup, makes sense. |
| 21:51 | mstenta[m] | Yes exactly |
| 21:51 | paul121[m] | So the "Custom" part of a VBO is basically just writing the SQL query? |
| 21:51 | mstenta[m] | Not even... It's just writing the action |
| 21:51 | mstenta[m] | Let me find an example... |
| 21:53 | mstenta[m] | github.com/farmOS/farmOS/blob/7.x-1.x/mo |
| 21:53 | mstenta[m] | That hook defines the "Assign" action for assigning logs in bulk to a user |
| 21:54 | mstenta[m] | The only thing that might be a hurdle for the asset sensor data View is... |
| 21:54 | mstenta[m] | The rows are not Drupal entities |
| 21:54 | mstenta[m] | They are just simple database table rows |
| 21:54 | mstenta[m] | I think VBOs might only work with entities... :-/ |
| 21:54 | mstenta[m] | I forget though. Maybe it's possible |
| 21:56 | mstenta[m] | Here's another hook that defines three actions for asset entities (archive, unarchive, and clone): |
| 21:56 | mstenta[m] | github.com/farmOS/farmOS/blob/7.x-1.x/mo |
| 21:58 | mstenta[m] | Here's the documentation for definitely custom VBOs |
| 21:58 | mstenta[m] | www.drupal.org/node/2052067 |
| 21:58 | mstenta[m] | Defining* |
| 21:59 | paul121[m] | So as soon as you implement `hook_action_info` Drupal knows to display the bulk operations in the View? |
| 22:00 | mstenta[m] | No there's another step necessary: you have to edit the View configuration |
| 22:00 | mstenta[m] | To add the operation as an option |
| 22:00 | mstenta[m] | So you can build views with different sets of operations depending on what you need |
| 22:05 | mstenta[m] | Hmm I don't think it will be possible to use VBO on sensor data... :-( |
| 22:05 | mstenta[m] | www.drupal.org/node/1282486 |
| 22:05 | mstenta[m] | > VBO only supports entity (base or revision) tables. |
| 22:07 | mstenta[m] | Drat |
| 22:07 | paul121[m] | haha shoot |
| 22:08 | mstenta[m] | So maybe just a custom form |
| 22:08 | mstenta[m] | Maybe in a new tab separate from the view and edit tabs |
| 22:10 | paul121[m] | That makes sense |
| 22:10 | paul121[m] | And the `form_submit` would run a SQL query |
| 22:10 | mstenta[m] | Yup! |
| 22:11 | mstenta[m] | And you could have the date range and other filters you described |
| 22:12 | paul121[m] | Neat. I'll try and give that a shot |
| 22:13 | paul121[m] | Gtg but hopefully within the next week lol |
| 22:13 | mstenta[m] | That's probably a better approach for this anyway |
| 22:13 | mstenta[m] | Cool! Later! |
| 22:30 | mstenta[m] | @paul121:matrix.org: fyi here is the line that deletes data when a sensor asset is deleted |
| 22:30 | mstenta[m] | github.com/farmOS/farmOS/blob/1e398698e6 |
| 22:36 | * | JustTB has left |
| 22:41 | * | JustTB has joined |