kizniche / Mycodo

An environmental monitoring and regulation system
http://kylegabriel.com/projects/
GNU General Public License v3.0
2.96k stars 494 forks source link

A bunch of feedback/suggestions #444

Closed fry42 closed 6 years ago

fry42 commented 6 years ago

Hi,

I've been tinkering around with various setups and mycodo for a few weeks now and thought I'd give a little bit of feedback. I'm totally aware that there are many different scenarios, so my findings are purely subjective and I don't claim that they are universally applicable.

So while I do understand the logic behind the current structure I think there are improvements possible.

My suggestion would be something like this:

- Dashboard
- Camera
- Live
- Async
- Setup
    - Data
    - Calibration
    - Output
    - Function
    - Timer
    - Methods
    - LCD
- More
    - Export/Import
    - Output Usage
    - Output Usage Reports

This way you would have all monitoring on the first level. I don't claim that this is THE solution, just thought I put it up for discussion...

Is there any reason why you set use_video_port for capturing still images? I manually changed that because the image quality is way better (at least using the V1 module). Would be nice to have the option on the settings page. Also setting manual white balance would be useful for timelapse recordings...

Camera page: Currently there is no file management for photos within mycodo. Personally I don't need it because I just use smb for accessing the folders, but It could be a nice addition for future versions to have a listing of all available photos, ability to download/delete, ...

What I'm really missing is the ability to take a still via the timer interface. For me this makes much more sense than the Interval based system. Especially since it is also available in the Conditional Functions (which didn't list my camera in action=>photos, last time I checked...)

Some form of comments/logfile would also be useful, I think this has already been discussed somewhere...

Again, these are just my 2 cents, put up for discussion...

Btw.: totally excited about the adition of the MiFlora sensor!

Greetings! S.

kizniche commented 6 years ago

Thanks for the great feedback. I like to see requests that both make sense and are easy to implement. I'll go through your list and let you know what I think.

Mycodo always opens with live measurements - which I never use, because my dashboard has all the gauges&graphs I need.

The reason I start with the live measurements page is because there's a notification if no Inputs exist, instructing the user to add sensors on the Data page. This would be more helpful to newbies rather than just seeing a graph page instructing the user to add a graph (for which no measurements could be put on). I see an alternative to this issue being the ability to select the landing page. I'll add an option to select the landing page in the configuration.

So while I do understand the logic behind the current structure I think there are improvements possible.

I like yours better than the current. I'll incorporate the new structure.

So it would make sense to add the supported resolutions of these cameras in some way. Maybe it's enough to add it to the help pages (or a link to the picamera documentation).

I don't want to be too restrictive (such as having a dropdown for pre-selected resolutions). I'll improve the documentation for this.

Is there any reason why you set use_video_port for capturing still images?

I believe it's a remnant from when I first started working with the picamera module and was just dropping in others' code to get something working and never revisited it. It has applicability with the streaming module, but it doesn't appear so for the still image capture. I'll remove it.

Currently there is no file management for photos within mycodo. Personally I don't need it because I just use smb for accessing the folders, but It could be a nice addition for future versions to have a listing of all available photos, ability to download/delete, ...

I seldom think about this, but when I do, I realize it's just easier using SFTP/FTP than to build an in-house image navigator. I'll see if there's anything pre-made that I can just drop into Mycodo.

What I'm really missing is the ability to take a still via the timer interface. For me this makes much more sense than the Interval based system.

I'm planning to have conditionals take the role of timers. It seems to me to make more sense because the action framework is already there, and a timer is merely a conditional by another name.

which didn't list my camera in action=>photos

That's a bug. I'll fix that for the next release.

Inverted PWM signal

Nice. Added to next release.

activate/deactivate PID via timer

This comes back to conditionals taking the place of the current iteration of timers.

Timespan "switch off" option

I'll probably add this once I implement timer functionality for conditionals.

more integration of alerts and data sources

I'd like to refrain from redundancy, and I think if I begin going down the route of building conditional functionality into Inputs/Math/etc. it might be confusing to new users. I'd be more inclined to merely add better documentation.

Thanks again for the feedback. Let me know if you have any other ideas or responses. I'll be pushing the edits I mentioned above, shortly.

frodus17 commented 6 years ago

Would it be possible add a button to change a PID setpoint within the Dashboard PID widget? I routinely have to change temp manually, and it'd be nice to do that. You set activate/deactivate, pause and hold there, which is nice.

kizniche commented 6 years ago

That sounds like a nice feature. I'll include it in the next commit.

kizniche commented 6 years ago

I think I managed to port all Timer functionality into Conditionals, and removed all remnant Timer code. This expands the possibilities to unfathomable levels... of new issues, and probably a few useful configurations that may work as well.

Theoi-Meteoroi commented 6 years ago
  Kyle,  do you have any sort of software harness or mechanism you use for regression testing things like the conditionals code?   I’ve done a fair bit of test engineering and for the complexity of Mycodo - you have done pretty well with overall stability and service access (log viewers, etc.).  I like to help as I can with defects or problems with integration because it might help you roll the ball forward faster.  You seem to really shine with the developer’s hat on but work bug reports in earnest.  That is not as common with developers as one would hope. You deserve some recognition for that.  Most folks just step back as soon as it doesn’t repeatedly “abend” (abnormal ending) as the mainframe  guys used to call it.   I know. I was the guy the users called when it went tango uniform for them.  

Looking forward to the next release! I hope the other users know about the Zenodo repository. Unless I’m using the built-in upgrade, I prefer to get my release images there. Its easy to pick down-rev versions if I need to build a controller that has known characteristics and/or documented work-arounds. I’ve had trouble with Mycodo releases I’ve pulled from Github in the past, and that one regression with MH-Z19 has me wondering about them again.

Another tool I use to actively follow Mycodo development is GitKraken. I can review your code changes and keep a local up to date clone. I think Mycodo is still pretty much the coolest thing I work on, I only wish I had more time to contribute. Datacenter stuff seems boring in comparison.

On Apr 15, 2018, at 3:16 PM, Kyle Gabriel notifications@github.com wrote:

I think I managed to port all Timer functionality into Conditionals, and removed all remnant Timer code. This expands the possibilities to unfathomable levels... of new issues, and probably a few useful configurations that may work.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kizniche/Mycodo/issues/444#issuecomment-381442427, or mute the thread https://github.com/notifications/unsubscribe-auth/APsXKn8AInTyqWPr06dmTQqaN1U09O6Zks5to8a_gaJpZM4TLBob.

kizniche commented 6 years ago

Unfortunately, only input modules are tested. This was implemented not too long ago by someone else, and I wasn't familiar enough to expand it beyond the basic use for the inputs and a few flask endpoint tests. I would like to have good testing coverage, but I'm pulling myself in so many different directions, testing often gets put on the back burner because I'm better at other areas, and I often think that if I'm not going to (or unable to) implement it in a decent way, I'd rather wait until I can learn more about it. Unfortunately, testing is still largely a black box to me for how to implement it into things like the frontend and daemon.

kizniche commented 6 years ago

I revisited the form submission that gave me trouble the last time I attempted to get a frontend test of adding inputs working. I figured out the issue and built the first big test of manipulating the frontend, which includes testing if every input can be added (48 so far). I found an issue with one input addition (SHT1_7x) in the course of this, so it has already paid off in finding bugs. On a Pi 2, it took 202 seconds to complete this test.

https://github.com/kizniche/Mycodo/blob/b46f3fef13c97f2c4b9873f78aba509c2a9019b5/mycodo/tests/software_tests/test_mycodo_flask/test_endpoints.py#L137-L153

kizniche commented 6 years ago

That's actually a huge achievement, considering that unlocks the ability to now test all form submissions.

mrplow commented 6 years ago

How would I set a daily timer to switch a relay on for 12 hours?

I set a conditional Timer (Daily) with a start time of 10:00 (it was past then when I created the Conditional) with a Duration of 43200 seconds.

After activating the relay did not turn on.

I'm assuming it will start operating correctly tomorrow at 10:00? I'm guessing the timer didn't trigger because I created it after it's start time. Is this a correct assumption?

Thanks a lot! I'm really enjoying this project.

kizniche commented 6 years ago

You are correct. It will only trigger the actions at that specific time. If you want it to be on currently, calculate how long the output needs to be on for the remaining time until you want it to turn off, then turn that output on for that duration from the Output page.

kizniche commented 6 years ago

In the future, I will create a duration timer conditional that ensures the output is in the set state for that duration (even after a power outage). Currently a power outage will disrupt the timer Conditionals.

mrplow commented 6 years ago

Excellent, I'm glad I understood correctly.

No prob, I just plugged it into the wall for now and I'll pull it at 10:00. "Manual" labour for one day isn't a big deal.

kizniche commented 6 years ago

@mrplow I added a Time Span Conditional Timer to the latest release, so you can ensure your Output is in the correct state throughout a duration. Make sure you set a Time Point conditional after the end to turn it off (or on) to counter the Time Span Timer. See the manual for more info about this conditional.

mrplow commented 6 years ago

Thanks @kizniche. I had already upgraded and created the conditional but didn't think about creating another to turn it off.