Mycodo

An environmental monitoring and regulation system

GPL-3.0 License

Stars
3K
Committers
59

Bot releases are visible (Hide)

Mycodo - 8.10.0

Published by kizniche over 3 years ago

8.10.0 (2021-04-24)

This release contains changes that requires modification to any Custom Functions you may have in use. In order for the new features to work for Custom Functions, it required the use of an abstract base function class (similarly to Inputs and Outputs). As a result, any Custom Functions that previously were formatted as such:

from mycodo.controllers.base_controller import AbstractController

class CustomModule(AbstractController, threading.Thread):
    """
    Class to operate custom controller
    """
    def __init__(self, ready, unique_id, testing=False):
        threading.Thread.__init__(self)
        super(CustomModule, self).__init__(ready, unique_id=unique_id, name=__name__)

        self.unique_id = unique_id
        self.log_level_debug = None

        # Set custom options
        custom_function = db_retrieve_table_daemon(
            CustomController, unique_id=unique_id)
        self.setup_custom_options(
            FUNCTION_INFORMATION['custom_options'], custom_function)

will need to be changed to the format:

from mycodo.functions.base_function import AbstractFunction

class CustomModule(AbstractFunction):
    """
    Class to operate custom controller
    """
    def __init__(self, function, testing=False):
        super(CustomModule, self).__init__(function, testing=testing, name=__name__)

        # Note: The following 2 lines are no longer needed to be defined here. Delete them.
        # self.unique_id = function.unique_id  
        # self.log_level_debug = None

        # Set custom options
        custom_function = db_retrieve_table_daemon(
            CustomController, unique_id=self.unique_id)  # Note: "self." is added here
        self.setup_custom_options(
            FUNCTION_INFORMATION['custom_options'], custom_function)

        # These two lines are new and are required to execute initialize_variables()
        if not testing:
            self.initialize_variables()

You also no longer need to define the following (i.e. you can remove these lines):

controller = db_retrieve_table_daemon(
    CustomController, unique_id=self.unique_id)
self.log_level_debug = controller.log_level_debug
self.set_log_level_debug(self.log_level_debug)

Additionally, if you have pre_stop() in your Function Class, it will need to be renamed to stop_function().

There are two ways to perform these changes.

Method A:

  1. Deactivate all custom functions.
  2. Delete all custom functions on the Setup -> Function page.
  3. Delete all custom functions on the Configure -> Custom Functions page.
  4. Perform the Mycodo upgrade.
  5. Make the necessary edits to all your Custom Functions.
  6. Import all your updated Custom Functions on the Configure -> Custom Functions page.
  7. Add and configure your Custom Functions on the Setup -> Function page.

Method B:

  1. Either SSH into your Raspberry Pi or use a keyboard/mouse/monitor and edit the Custom Functions in the ~/Mycodo/mycodo/function/custom_functions directory.
  2. Perform the Mycodo upgrade.

Method A is more involved, but does not require accessing the Pi from outside the web UI. Method B has fewer steps and doesn't require deleting and reconfiguring new Functions, but requires being able to SSH in to your Raspberry Pi or connecting a keyboard/mouse/monitor to be able to edit the files in-place.

As always, a backup of the current system files and settings is performed during an upgrade, allowing you to restore your system to a previous release state if needed.

Bugfixes

  • Fix camera paths not saving (#955)
  • Fix returning pylint3 report after saving Python Code
  • Fix detection of multiple cameras by opencv
  • Fix SCD30 (CircuitPython) Input (#963)
  • Fix importing Mycodo Settings ZIP if custom modules were exported (#967)
  • Fix inability to install picamera library on some Pi 4s (#967)
  • Fix VPD Function saving and calculating pressure conversion (#978)
  • Fix pressure conversion equations (#978)
  • Fix issues with Function channels/measurements
  • Fix Mijia LYWSD03MMC Input using a nonexistent pybluez version
  • Fix Hall Flow Input
  • Remove Flask-Session to resolve bug preventing frontend loading (#971)

Features

  • Add Input SHT41x
  • Add Input: Adafruit I2C capacitive soil sensor
  • Add Input: CircuitPython variants of the BME280 and SHT31-D Inputs
  • Add Input: KP303 Smart WiFi Power Strip (#980)
  • Add Input: Generic Analog pH/EC using ADS1115 ADC
  • Add Input: Tasmota Outlet Energy Monitor
  • Add Output: DS3502 Digital Potentiometer
  • Add Output: ULN2003 Unipolar Stepper Motor Driver
  • Add Function: SSD1309 Display
  • Add Function: Bang-Bang PWM
  • Add Function Action: MQTT Publish
  • Add Function Action: webhook to emit HTTP requests (discussion)
  • Partial conversion of Display/LCD controllers to Display Functions
  • Add external temperature compensation for Anyleaf pH Input
  • Add ability to set camera stream frames per second
  • Add missing stream resolution option to opencv cameras
  • Add ability for Atlas Scientific Peristaltic Pump Outputs to run in reverse
  • Add new ADC measurement rescaling method: Equation
  • Add Custom Actions to Functions
  • Add "wait_for_return" option to Custom Actions
  • Convert all LCD/Display controllers to Functions
  • Add ability to not have to set time-lapse end (defaults to 10 years) (#987)

Miscellaneous

  • Add Measurements: Apparent Power, Reactive Power, Power Factor
  • Add Units: kilowatt-hour, Watt, Volt-Amps, Volt-Amps-Reactive
  • Specify package versions for pypi dependencies
  • Update python libraries
  • Add unit testing for Custom Functions
  • Add ability to change theme from Config dropdown menu
Mycodo - 8.9.2

Published by kizniche over 3 years ago

8.9.2 (2021-03-16)

This bugfix release changes how sessions are handled and as a result will log all users out following the upgrade.

Bugfixes

  • Fix Function measurements not appearing in some dropdowns
  • Fix displaying saved Custom Option values when Inputs/Outputs have Custom Actions (#952)
  • Fix silent failures when cookies are too large (#950)
  • Fix use of select_measurement_channel custom option in controllers (#953)
  • Fix error-handling of erroneous measurements/units (#949)
Mycodo - 8.9.1

Published by kizniche over 3 years ago

8.9.1 (2021-03-13)

Bugfixes

  • Fix API deactivating controller in database (#944)
  • Fix invalid conversion (#947)
  • Fix inability to save MQTT Input (#946)
  • Fix Camera Widget (#948)
Mycodo - 8.9.0

Published by kizniche over 3 years ago

8.9.0 (2021-03-08)

This release contains bug fixes and several new types of Inputs and Outputs. These include stepper motors, digital-to-analog converters, a multi-channel PWM output, as well as an input to acquire current and future weather conditions.

This release also deprecates Math controllers. Current Math controllers will continue to function, but new Math controllers cannot be created. Instead, all Math controller functionality has been ported to Functions (Setup -> Function page), in order to reduce complexity and improve customizability. Much like Inputs and Outputs, Functions are single-file modules that can be created by users and imported. Take a look at the Mycodo/mycodo/functions directory for the built-in Function modules.

The new weather input acquires current and future weather conditions from openweathermap.org with either a city (200,000 to choose from) or latitude/longitude for a location and a time frame from the present up to 7 days in the future, with a resolution of days or hours. An API key to use the service is free and the measurements returned include temperature (including minimum and maximum if forecasting days in the future), humidity, dew point, pressure, wind speed, and wind direction. This can be useful for incorporating current or future weather conditions into your conditional controllers or other functions or calculations. For instance, you may prevent Mycodo from watering your outdoor plants if the forecasted temperature in the next 12 to 24 hours is below freezing. You may also want to be alerted by email if the forecasted weather conditions are extreme. Not everyone wants to set up a weather station, but might still want to have local outdoor measurements, so this input was made to bridge that gap.

Bugfixes

  • Fix broken Output API get/post calls
  • Fix selecting output channels in custom functions
  • Fix Autotune PID Function (#876)
  • Fix issue with LockFile not locking
  • Fix Output State and Output Duration On Conditional Conditions (#879)
  • Fix not showing camera stream buttons for cameras libraries that don't have stream support (#899)
  • Fix Clock Pin option showing twice for UART Inputs
  • Fix MCP3008 Input error (#902)
  • Fix Input Measurement option Invert Scale not displaying properly (#902)
  • Fix MQTT output being able to set 0 to disable option
  • Fix compounding of Function Action return messages in Conditionals
  • Fix ADS1015 and ADS1115 inputs only measuring channel 0 (#911)
  • Fix install of pyusb dependency of Adafruit_Extended_Bus (#863)
  • Fix Message and New Line options in Custom Options
  • Fix Conditional sample_rate not being set from Config
  • Fix Saving Angular and Solid Gauge Widget stop values (#916)
  • Fix uncaught exception if trying to acquire image when opencv can't detect a camera (#917)
  • Fix displaying input/output pypi.org dependencies with "=="
  • Fix pressure measurement in BME680 and BME280 Inputs (#923)
  • Fix controllers disappearing following reorder (#925)
  • Fix Inputs that use w1thermsensor (#926)
  • Fix issue generating documentation for similar Inputs/Outputs/Widgets
  • Fix execution of Input stop_input()
  • Fix Input Pre-Outputs not turning on
  • Fix Output not activating for Camera
  • Fix PWM trigger and Duration Method (#937)
  • Fix stopping Trigger Controllers (#940)
  • Fix Tags not appearing in Graph Widgets
  • Fix variable measurement Inputs saving correctly
  • Fix detection of custom_option save type (CSV or JSON) for proper parsing
  • Fix saving of unchecked checkboxes when using forms

Features

  • Add Digital-to-Analog Converter output support (and add MCP4728) (#893)
  • Add Stepper Motor Controller output support (and add DRV8825) (#857)
  • Add Output: GrovePi multi-channel relay I2C board
  • Add Output: PCA9685 16-channel PWM servo/LED controller
  • Add Input: MAX31865 (CircuitPython) (#900)
  • Add Input: Generic Hall Effect Flow sensor
  • Add Input: INA219 current sensor
  • Add Input: Grove Pi DHT11/22 sensor
  • Add Input: HC-SR04 Ultrasonic Distance sensor
  • Add Input: SCD30 CO2/Humidity/Temperature sensor
  • Add Input: Current Weather from OpenWeatherMap.org (Free API Key, Latitude/Longitude, 200,000 cities, Humidity/Temperature/Pressure/Dewpoint/Wind Speed/Wind Direction)
  • Add Input: Forecast Hourly/Daily Weather from OpenWeatherMap.org (Free API Key, , Humidity/Temperature/Pressure/Dewpoint)
  • Add Input: Raspberry Pi Sense HAT (humidity/temperature/pressure/compass/magnetism/acceleration/gyroscope)
  • Add Input: Xiaomi Mijia LYWSD03MMC
  • Add Input: Atlas Scientific CO2 sensor
  • Add Input: AHTx0 Temperature/Humidity sensor
  • Add Input: BME680 (Circuitpython)
  • Add measurements to Custom Controllers
  • Add Measurement and Unit: Speed, Meters/Second
  • Add Measurement and Unit: Direction, Bearing
  • Add Conversions: m/s <-> mph <-> knots, hour <-> minutes and seconds
  • Add LCD: Grove RGB LCD
  • Add Function: Bang-bang/hysteretic
  • Add Function Action: Output Value
  • Add Function Action: Set LCD Backlight Color
  • Add configurable link for navbar brand link
  • Add User option to Shell Command Function Action
  • Add Message and New Line options to Custom Options of Outputs
  • Add set_custom_option/get_custom_option to Conditionals (#901)
  • Add ability to login with username/password using MQTT Input and Outputs
  • Add ability to use Custom Channel Options with Inputs (first used in MQTT Input)
  • Add Custom Functions/Inputs/Outputs/Widgets to Settings Export/Import
  • Add user_scripts directory for user code that's preserved during upgrade/export/import (#930)
  • Add pin mode option (float, pull-up, pull-down) for Edge and State Inputs
  • Add Method: Cascaded Method, allows combining (multiply) any number of existing methods (discussion)
  • Add Functions and to API
  • Add missing Input Channels to Input API calls

Miscellaneous

  • Remove lirc
  • Change widget title styles
  • Fix GCC warnings (#906)
  • Remove default user "pi" with "mycodo" (for compatibility with non-Raspberry Pi operating systems)
  • Update pyusb to 1.1.1
  • Refactor Edge detection Input
  • Refactor method implementation from single large method into multiple small classes
  • Changed duration method start- and end-time handling
  • Port Math controllers to Functions: Equation (Single/Multi), Difference, Statistics (Single/Multi), Average (Single/Multi), Sum (Single/Multi), Wet-Bulb Humidity, Redundancy, Vapor Pressure Deficit, Verification
  • Deprecate Math controllers
  • Remove Math controllers from and add Functions to Live page
Mycodo - 8.8.8

Published by kizniche almost 4 years ago

8.8.8 (2020-10-30)

Bugfixes

  • Fix PiOLED (CircuitPython) (#842)

Miscellaneous

  • Update Polish translations
Mycodo - 8.8.7

Published by kizniche almost 4 years ago

8.8.7 (2020-10-27)

Bugfixes

  • Fix missing default values when adding new controllers (#868)
  • Fix catching loss of internet connection during upgrade (#869)
  • Fix Function Actions Output PWM and Output PWM Ramp not working (#865)
  • Fix dependencies not being installed for LCDs
  • Fix saving when missing/malformed custom_options JSON present (#866)

Features

  • Add LCDs: 128x32 and 128x64 PiOLED using the Adafruit CircuitPython library (#842)
Mycodo - 8.8.6

Published by kizniche about 4 years ago

8.8.6 (2020-10-07)

Bugfixes

  • Fix order of Atlas Scientific pH sensor calibration points (#861)

Features

  • Add Polish translation
Mycodo - 8.8.5

Published by kizniche about 4 years ago

8.8.5 (2020-10-01)

Bugfixes

  • Fix Output Widgets not able to control outputs
  • Fix ADS1256 (#854)
  • Fix PID controllers not obeying minimum off duration (#859)
Mycodo - 8.8.4

Published by kizniche about 4 years ago

8.8.4 (2020-09-28)

Bugfixes

  • Increase nginx proxy buffer to accommodate large headers (#849)
  • Fix URL generation for cameras (#850)
  • Fix display of Output data on Asynchronous Graphs (#847)
Mycodo - 8.8.3

Published by kizniche about 4 years ago

8.8.3 (2020-09-15)

Bugfixes

  • Fix inability to create Angular Gauge Widget with more than 4 stops (#844)
  • Fix issue with Python Code Input (#846)
  • Fix issue with install (#845)
Mycodo - 8.8.2

Published by kizniche about 4 years ago

8.8.2 (2020-09-13)

Bugfixes

  • Fix PID Controller not operating (#843)
  • Fix inability to switch any output except channel 0 from web interface (#840)
  • Minor fixes for PCF8574 Output
  • Fix Atlas Pump recording two pump durations

Features

  • Add ability to select method in Input/Output/Function controller custom options
Mycodo - 8.8.1

Published by kizniche about 4 years ago

8.8.1 (2020-09-09)

Bugfixes

  • Fix partially broken upgrade to new output system
  • Fix GPIO output startup states
Mycodo - 8.8.0

Published by kizniche about 4 years ago

8.8.0 (2020-09-08)

This release changes the Output framework to add the ability for a single Output to control multiple channels. This was originally based on the PCF8574 8-bit I/O Expander, which allows 8 additional IO pins to be controlled via the I2C bus, but applies to any other output device with more than one channel. As a result of this change, you will need to update any Custom Outputs to follow the new format (see /mycodo/outputs directory).

Bugfixes

  • Fix inability to save Python Code Input settings (#827)
  • Fix Cameras not appearing in Camera Widget (#828)
  • Fix inability to save Pause PID Function Action (#836)
  • Fix error diaplying Measurement or Gauge Widgets with Math controllers using non-default units (#831)
  • Fix default values not displaying for Input/Output Custom Actions
  • Fix some apt packages being detected as installed when they are not installed

Features

  • Convert Input module custom_options from CSV to JSON
  • Add Anyleaf ORP and pH Inputs (#825)

Miscellaneous

  • Remove unused Output selection in Methods
Mycodo - 8.7.2

Published by kizniche about 4 years ago

8.7.2 (2020-08-23)

Bugfixes

  • Fix issue displaying Measurement Widgets when a Math measurement is selected (#817)
  • Fix inability to generate Widget HTML (#817, #822)

Features

  • Add ability to duplicate a dashboard and its widgets (#812)
Mycodo - 8.7.1

Published by kizniche about 4 years ago

8.7.1 (2020-08-10)

Bugfixes

  • Remove copy of widget HTML files during upgrade
Mycodo - 8.7.0

Published by kizniche about 4 years ago

8.7.0 (2020-08-10)

This update includes the final refactoring of the output system to accommodate output modules that can operate multiple different types of output types. For instance, a peristaltic pump can be instructed to turn on for a duration or instructed to pump a volume. As a result of the output framework being modified to accommodate this, the duty_cycle parameter was removed from output_on_off() and output_on() functions of the DaemonControl class of mycodo_client.py. As a result, if you were previously using either of these function, you will need to add the parameter output_type='pwm' and change the duty_cycle parameter to amount. For example, output_on(output_id, duty_cycle=50) would need to be changed to output_on(output_id, output_type='pwm', amount=50), and output_on_off(output_id, 'on', duty_cycle=50) to output_on_off(output_id, 'on', output_type='pwm', amount=50).

This update also adds the ability to import custom Widget modules. Much like custom Inputs, Outputs, and Functions, you can now create and import your own single-file Widget module that allow new widgets to be added to a dashboard.

Bugfixes

  • Fix issue installing Python modules (#804)
  • Fix inability to save PID options when On/Off output selected (#805)
  • Fix graph shift issues
  • Fix PID Input/Math Setpoint Tracking unit and integer issue (#811)
  • Fix PID Controller debug logging (#811)
  • Fix bug in password reset function that would allow an attacker to discover if a user name doesn't exist

Features

  • Add Output: On/Off MQTT Publish
  • Add Output information links
  • Add ability to download Mycodo Backups (#803)
  • Add ability to import custom Widget modules
  • Add Widget Controller for background widget processes
  • Add Widget: Python Code (#803)
  • Add an option to the password reset function to save the reset code to a file

Miscellaneous

  • Deprecate duty_cycle parameter of output functions
  • Remove graph Shift X-Axis option
  • Move Autotune from PID Controller to Separate PID Autotune Controller (#811)
Mycodo - 8.6.4

Published by kizniche about 4 years ago

8.6.4 (2020-07-25)

Bugfixes

  • Fix issue displaying lines 5-8 on SD1306 LCDs (#800)
  • Fix Atlas Scientific Pump duration unit issues (#801)

Features

  • Add Inputs: Ads1115 (Circuit Python library), ADS1015 (Circuit Python library)
  • Add Input: BMP280 (bmp280-python library, includes ability to set forced mode) (#608)

Miscellaneous

  • Deprecate Input using the Adafruit_ADS1x15 library
Mycodo - 8.6.3

Published by kizniche about 4 years ago

8.6.3 (2020-07-25)

Bugfixes

  • Fix ADS1x15 Input
Mycodo - 8.6.2

Published by kizniche about 4 years ago

8.6.2 (2020-07-25)

Bugfixes

  • Fix DS18S20 Input module (#796)
  • Fix Peristaltic Pump Outputs unable to turn on for durations (#799)

Features

Miscellaneous

  • Improve custom output framework
  • Consolidate locking code to utils/lockfile.py
Mycodo - 8.6.1

Published by kizniche about 4 years ago

8.6.1 (2020-07-22)

Bugfixes

  • Fix Wireless 315/433 MHz Output module
Package Rankings
Top 6.64% on Proxy.golang.org