Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Higher or Lower Humidity Control #150

Closed
RRCRT opened this issue May 14, 2018 · 9 comments
Closed

Higher or Lower Humidity Control #150

RRCRT opened this issue May 14, 2018 · 9 comments

Comments

@RRCRT
Copy link

RRCRT commented May 14, 2018

Humidity control (Sprayer) is only one way at the moment ie when humidity gets to low the sprayer will spray based on duration etc..
I would like to have a fan come on when the humidity get to high and stop when humidity gets to desired %. I did in the passed change the Sprayer settings in terrariumEnvironment.py:

 # Hum checks and actions
      if self.sprayer['enabled']:
        toggle_on = False
        extra_logging_message = ''
        logger.debug('Environment spraying is enabled.')
        logger.debug('Environment spraying is based on: %s' % self.sprayer['mode'])
        if 'sensor' == self.sprayer['mode']:
          # Only spray when the lights are on. Or when explicit enabled during the nights.
          if self.sprayer['night_enabled'] or self.is_light_on():
            # Spray based on the average humidity values of the used sensors
            toggle_on = self.sprayer['humidity']['current'] > self.sprayer['humidity']['alarm_max']
            if toggle_on:
              extra_logging_message = 'Sprayer humdity value %f%% is higher then alarm %f%%.' % (self.sprayer['humidity']['current'],
                                                                                        self.sprayer['humidity']['alarm_max'])
        else:
          # Spray based on time table
          toggle_on = terrariumUtils.is_time(self.sprayer['time_table'])
          if toggle_on is None:
            self.__update_timing('sprayer')

          if toggle_on and len(self.sprayer['sensors']) > 0:
            # Use the extra added sensors for finetuning the trigger action
            toggle_on = self.sprayer['humidity']['current'] > self.sprayer['humidity']['alarm_max']
            if toggle_on:
              extra_logging_message = 'Sprayer humdity value %f%% is lower then alarm %f%%.' % (self.sprayer['humidity']['current'],
                                                                                        self.sprayer['humidity']['alarm_max'])

        if toggle_on:
          if self.is_door_open():
            logger.warning('Environment could not spray for %f seconds based on %s mode because of an open door.%s' % (self.sprayer['spray_duration'],
                                                                                                                       self.sprayer['mode'],
                                                                                                                       extra_logging_message))
          else:
            if not self.is_sprayer_on():
              logger.info('Environment is turning on the sprayer for %f seconds based on %s mode.%s' % (self.sprayer['spray_duration'],
                                                                                                      self.sprayer['mode'],
                                                                                                      extra_logging_message))
            self.sprayer_on()
        else:
          if self.is_sprayer_on():
            logger.info('Environment is turning off the sprayer based on %s mode.' % (self.sprayer['mode'],))

          self.sprayer_off()

      #else:
      #  logger.debug('Make sure that the spayer is off when not enabled at all.')
      #  if self.is_sprayer_on():
      #    logger.info('Environment is turning off the sprayer due to disabling it')
      #  self.sprayer_off()

this worked for me up to a point ie when spray duration (fan on) was reached and 0 wait time you would of thought it would if humidity to high switch back on for 60 but this isn't the case what would happen is the fan comes on for a split second then off for a split second for ever till a restart or reboot.

I don't really need sprayer but didn't want to lose it either as I might need it in the future. Just wondering for us growers that need to control humidity downwards if there is a quick Environment fix for this maybe adding a simple Humidity control based on the 'Cooling settings' or a quick edit to the above code (Sprayer) as I'm not every sure if I've edited right.
I know your working on a new "Add Environment" type setting page but if there is a quick fix for now i'll most appreciate it.
Many Thanks in advance

@theyosh
Copy link
Owner

theyosh commented May 14, 2018

New setup: You will have a alarm low and alarm high setting with own power switches. So in that way you can have a sprayer and blower controlling together the humidity. Or you use only the sprayer part or the blower part.

newhumidity

Repository owner deleted a comment from RRCRT May 16, 2018
theyosh pushed a commit that referenced this issue May 21, 2018
…ct power switches for low alarm and high alarm. #150
theyosh pushed a commit that referenced this issue May 22, 2018
@theyosh
Copy link
Owner

theyosh commented May 23, 2018

Currently I am finalizing the code and do some testing. Here are some new pictures. There is now also an option to select day lights and night lights....
screenshot from 2018-05-23 19-35-37
screenshot from 2018-05-23 19-36-14
screenshot from 2018-05-23 19-35-57

theyosh pushed a commit that referenced this issue May 24, 2018
theyosh pushed a commit that referenced this issue May 26, 2018
@theyosh
Copy link
Owner

theyosh commented May 27, 2018

Ok, we are almost there. I got a new version running on my live terrarium. You can see it here: https://terrarium.theyosh.nl/

There you can see the new Environment system running and what all the options are. Currently I would like to test it a couple of days more. But I think it is pretty stable at the moment. If you are brave enough, you could switch to the development branch and test it your self. :)
Make a backup of the 'settings.cfg' file if you want to go back to the master branch BEFORE testing development.

@RRCRT
Copy link
Author

RRCRT commented May 29, 2018

Hi..
I have managed to install the development branch by removing all files and folders including the git as this is the only way it would install and run with choosing no option on second page of install.sh. after install the Environment system would not save but this time without errors in screen -r. I then realised I hadn't cleaned browser data. After that it all worked fine, It's a big thumps up from here. Had no bugs yet.
Thanks for your efforts!

@theyosh
Copy link
Owner

theyosh commented May 29, 2018

Cool.... browser cache is a bitch :P

@theyosh
Copy link
Owner

theyosh commented May 31, 2018

Ok, new release is out. So I think this issue should be fixed now. Could you try to update and see if it is all working?

@theyosh
Copy link
Owner

theyosh commented Jun 10, 2018

Any updates please? As far I can judge, it is working like requested

@theyosh
Copy link
Owner

theyosh commented Jun 13, 2018

Closing after 15 days of silence... :P

@theyosh theyosh closed this as completed Jun 13, 2018
@RRCRT
Copy link
Author

RRCRT commented Jun 21, 2018

been working fine for me all this time many thanks 🥇

theyosh pushed a commit that referenced this issue Mar 22, 2021
…ct power switches for low alarm and high alarm. #150
theyosh pushed a commit that referenced this issue Mar 22, 2021
theyosh pushed a commit that referenced this issue Mar 22, 2021
theyosh pushed a commit that referenced this issue Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants