Help creating custom Input module for the APDS 9960 I2C color (RGB) and proximity sensor

I am trying to create a new module.
I have already tested this sensor with custom py code.
But this is my first time with mycodo input module.
I am using an Adafruit driver to comunicate with the module.

I have already added custom measurements to the Mycodo. And I have added this module via browser using the page “Import Input Module”
But when I try to setup it, it ask for the dependency, that I have already tried to install already when trying to install this module:

Install Dependencies for APDS-9960

There were unmet dependencies encountered when adding the following device: APDS-9960 (APDS9960)

Dependencies not installed: adafruit-circuitpython-apds9960

To install these dependencies, click the Install button below and wait for the install to complete before attempting to add the device again. Note that the frontend and the backend will be restarted following the install to allow detection of the newly-installed modules.

Then I click Install:

[2022-05-10 02:34:11] Dependency installation beginning. Installing: adafruit-circuitpython-apds9960

[2022-05-10 02:34:12] 
[2022-05-10 02:34:12] #### Installing/updating adafruit-circuitpython-apds9960 (pip-pypi)
[2022-05-10 02:34:17] Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
[2022-05-10 02:34:17] Requirement already satisfied: adafruit-circuitpython-apds9960 in ./env/lib/python3.9/site-packages (3.1.1.dev4+gc7dc592)
[2022-05-10 02:34:19] Requirement already satisfied: adafruit-circuitpython-busdevice in ./env/lib/python3.9/site-packages (from adafruit-circuitpython-apds9960) (5.1.8)
[2022-05-10 02:34:19] Requirement already satisfied: adafruit-circuitpython-register in ./env/lib/python3.9/site-packages (from adafruit-circuitpython-apds9960) (1.9.8)
[2022-05-10 02:34:19] Requirement already satisfied: Adafruit-Blinka in ./env/lib/python3.9/site-packages (from adafruit-circuitpython-apds9960) (7.3.0)
[2022-05-10 02:34:19] Requirement already satisfied: Adafruit-PureIO>=1.1.7 in ./env/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-circuitpython-apds9960) (1.1.9)
[2022-05-10 02:34:19] Requirement already satisfied: rpi-ws281x>=4.0.0 in ./env/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-circuitpython-apds9960) (4.3.4)
[2022-05-10 02:34:19] Requirement already satisfied: pyftdi>=0.40.0 in ./env/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-circuitpython-apds9960) (0.54.0)
[2022-05-10 02:34:19] Requirement already satisfied: adafruit-circuitpython-typing in ./env/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-circuitpython-apds9960) (1.6.0)
[2022-05-10 02:34:19] Requirement already satisfied: RPi.GPIO in ./env/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-circuitpython-apds9960) (0.7.1)
[2022-05-10 02:34:19] Requirement already satisfied: sysv-ipc>=1.1.0 in ./env/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-circuitpython-apds9960) (1.1.0)
[2022-05-10 02:34:19] Requirement already satisfied: Adafruit-PlatformDetect>=3.13.0 in ./env/lib/python3.9/site-packages (from Adafruit-Blinka->adafruit-circuitpython-apds9960) (3.22.1)
[2022-05-10 02:34:19] Requirement already satisfied: pyserial>=3.0 in ./env/lib/python3.9/site-packages (from pyftdi>=0.40.0->Adafruit-Blinka->adafruit-circuitpython-apds9960) (3.5)
[2022-05-10 02:34:19] Requirement already satisfied: pyusb!=1.2.0,>=1.0.0 in ./env/lib/python3.9/site-packages (from pyftdi>=0.40.0->Adafruit-Blinka->adafruit-circuitpython-apds9960) (1.1.1)

[2022-05-10 02:34:27] End install of adafruit-circuitpython-apds9960

[2022-05-10 02:34:27] 
[2022-05-10 02:34:27] #### Setting permissions

[2022-05-10 02:34:31] #### Dependencies installed. Restarting frontend and backend...

[2022-05-10 02:34:52] #### Dependency install complete.

I am stuck in this loop with my custom Input module

My module is in here:

# coding=utf-8
import copy

from mycodo.inputs.base_input import AbstractInput

def constraints_pass_measurement_repetitions(mod_input, value):
    """
    Check if the user input is acceptable
    :param mod_input: SQL object with user-saved Input options
    :param value: integer
    :return: tuple: (bool, list of strings)
    """
    errors = []
    all_passed = True
    # Ensure 1 <= value <= 1000
    if value < 1 or value > 1000:
        all_passed = False
        errors.append("Must be a positive value between 1 and 1000")
    return all_passed, errors, mod_input

# Measurements
measurements_dict = {
    0: {
        'measurement': 'color_red',
        'unit': '16_bit_color'
    },
    1: {
        'measurement': 'color_green',
        'unit': '16_bit_color'
    },
    2: {
        'measurement': 'color_blue',
        'unit': '16_bit_color'
    },
    3: {
        'measurement': 'color_clear',
        'unit': '16_bit_color'
    },
    4: {
        'measurement': 'proximity_IR',
        'unit': 'eight_bit_color'
    },
    5: {
        'measurement': 'movement',
        'unit': 'unitless'
    }
}

# Input information
INPUT_INFORMATION = {
    'input_name_unique': 'APDS9960',
    'input_manufacturer': 'Broadcom',
    'input_name': 'APDS-9960',
    'input_library': 'Adafruit_CircuitPython_APDS9960',
    'measurements_name': 'RGB_Distance_Movement',
    'measurements_dict': measurements_dict,
    'url_manufacturer': 'https://www.broadcom.com/products/optical-sensors/integrated-ambient-light-and-proximity-sensors/apds-9960',
    'url_datasheet': 'https://docs.broadcom.com/docs/AV02-4191EN',
    'url_additional': 'https://learn.adafruit.com/adafruit-apds9960-breakout',
    'url_product_purchase' : 'https://www.adafruit.com/product/3595',

    'dependencies_module': [
        # ('pip-pypi', 'Adafruit_GPIO', 'Adafruit-GPIO==1.0.3'),
        ('pip-pypi', 'adafruit-circuitpython-apds9960', 'adafruit-circuitpython-apds9960'),
    ],

    'interfaces': ['I2C'],
    'i2c_location': ['0x39'],
    'i2c_address_editable': False,

    'options_enabled': [
        'i2c_location',
        'period',
        'pre_output'
    ],

    'options_disabled': ['interface'],

     'custom_commands': [
        {
            'type': 'message',
            'default_value': 'The APDS-9960 is a specialized chip that detects hand gestures, proximity and ambient light color over I2C.'
                             'The APDS9960 from Avago Technologies has an integrated IR LED and driver, along with four directional photodiodes that sense reflected IR energy from the LED. Its proximity detection feature allows it to measure the distance an object is from the front of the sensor (up to a few centimeters) with 8 bit resolution.'
                             'Since there are four IR sensors, you can measure the changes in light reflectance at each of the cardinal locations over time and turn those changes into gestures. Our interface library can detect directional gestures (left to right, right to left, up to down, down to up).'
                             'The Color and Ambient Light Sense detection feature provides red, green, blue and clear light intensity data. Each of the R, G, B, C channels have a UV and IR blocking filter and a dedicated data converter producing16-bit data simultaneously. This architecture allows applications to accurately measure ambient light and sense color'
        },
    ]

}

class InputModule(AbstractInput):
    """Read Colors as Red, Green, Blue and Clear(no filter) as 16 bits Values
       Proximity are read as 8 bits values, by an IR sensor
       It can also sense movements as up/down/left/wright directions using the same IR sensor.
       The RGB sensor can operate independtly from the IR sensor, but you can not disable the IR sensor to read movement nor distance.
       Also, unfornetly, it is not possible to read ambient IR emission using this sensor.
        """
    def __init__(self, input_dev, testing=False,):
        super().__init__(input_dev, testing=testing, name=__name__)

        self.adc = None
        self.adc_gain = None

        self.measurements_for_average = None

        if not testing:
            self.setup_custom_options(
                INPUT_INFORMATION['custom_options'], input_dev)
            self.try_initialize()

    def initialize(self):
        from adafruit_apds9960.apds9960 import APDS9960
        import board

        try:
            self.apds = APDS9960(self.input_dev.i2c_bus)
            self.set_sensor_settings()
        except Exception:
            self.logger.exception("Exception while initializing sensor")

    def set_sensor_settings(self):
        if self.is_enabled(0) or self.is_enabled(1) or self.is_enabled(2) or self.is_enabled(3):
            self.enabled_rgb = True
            self.apds.enable_color = True
            self.logger.debug("APDS RGBC sensor enabled")
        else:
            self.apds.enable_color = False
            self.enabled_rgb = False
            self.logger.debug("APDS RGBC sensor disabled")

        if self.is_enabled(4) or self.is_enabled(5):
            self.apds.enable_proximity = True
            self.enabled_IR = True
            self.logger.debug(f"APDS IR sensor Enabled")
            if self.is_enabled(5) == True:
                self.apds.enable_gesture = True
                self.enabled_gestures = True
                self.logger.debug(f"APDS gesture sensor Enabled")
            else:
                self.apds.enable_gesture = False
                self.enabled_gestures = False
                self.logger.debug(f"APDS gesture sensor Disabled")
                
        else:
            self.apds.enable_proximity = False
            self.enabled_IR = False
            self.logger.debug("APDS IR sensor disabled")

        # Throw out first measurement of Atlas Scientific sensor, as it may be prone to error
        self.get_measurement()

    def get_measurement(self):
        if not self.apds.color_data_ready:
            self.logger.error("Error 101: Device not set up. See https://kizniche.github.io/Mycodo/Error-Codes#error-101 for more info.")
            return
        
        return_string = None
        self.return_dict = copy.deepcopy(measurements_dict)

        # Read device
        

        if self.enabled_rgb:
            red, green, blue, clear = self.apds.color_data
            self.logger.debug("Device Returned: R:{} G:{} B:{} C:{}".format(red, green, blue, clear))
            self.value_set(0, int(red))
            self.value_set(1, int(green))
            self.value_set(2, int(blue))
            self.value_set(3, int(clear))
        if self.enabled_IR:
            distance = apds.gesture()
            self.value_set(4, int(distance))
        if self.enabled_gestures:
            movement = apds.proximity
            if movement == 1:
                self.value_set(5, "up")
            if movement == 2:
                self.value_set(5, "down")
            if movement == 3:
                self.value_set(5, "left")
            if movement == 4:
                self.value_set(5, "right")

        return self.return_dict

System info:

Mycodo Version: 8.13.9
Python Version: 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
Database Version: b354722c9b8b
Daemon Status: Running
Daemon Process ID: 3606
Daemon RAM Usage: 96.964 MB
Daemon Virtualenv: Yes
Frontend Process ID: 499
Frontend RAM Usage: 116.164 MB
Frontend Virtualenv: Yes

At page https://bioreactor3.local/admin/dependencies/ i get:

Error 500: Internal Server Error

Something bad happened but it's probably not your fault. Letting the developers know about these issues is crucial to supporting Mycodo. Please submit a new issue on GitHub with the following diagnostic information and error traceback (copy the entire traceback):

Version: 8.13.9
Database: b354722c9b8b
Model: Raspberry Pi 3 Model B Rev 1.2

Release:
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye

Firmware:
b''

Error (Full Traceback):

Traceback (most recent call last):
  File "/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/mycodo-root/env/lib/python3.9/site-packages/flask_restx/api.py", line 672, in error_router
    return original_handler(e)
  File "/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/mycodo-root/env/lib/python3.9/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/var/mycodo-root/env/lib/python3.9/site-packages/flask_login/utils.py", line 277, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "/home/pi/Mycodo/mycodo/mycodo_flask/routes_admin.py", line 383, in admin_dependencies
    if each_dep not in unmet_list:
TypeError: unhashable type: 'list'

The second item of the tuple is the name of the module that’s imported, which can be different from the pypi.org name that is the third item. With circuitpython libraries, it almost always is different.

This issue has already been fixed on the yet-to-be released master branch. See the changelog.

Thanks, that solved the first problem!

I’ve made a few changes, and I am able to make the sensor work inside mycodo, but I am not able to see the logged values anywhere!
Last code:

# coding=utf-8
import copy
import time
import board

from mycodo.inputs.base_input import AbstractInput

def constraints_pass_gamma(mod_input, value):
    """
    Check if the user input is acceptable
    :param mod_input: SQL object with user-saved Input options
    :param value: float or int
    :return: tuple: (bool, list of strings)
    """
    errors = []
    all_passed = True
    # Ensure value is between 0 - 100
    if value > 4.99 or value < 0.01:
        all_passed = False
        errors.append("Must be >= 0.01 and <= 4.99")
    return all_passed, errors, mod_input

# Measurements
measurements_dict = {
    0: {
        'measurement': 'color_red',
        'unit': '16_bit_color'
    },
    1: {
        'measurement': 'color_green',
        'unit': '16_bit_color'
    },
    2: {
        'measurement': 'color_blue',
        'unit': '16_bit_color'
    },
    3: {
        'measurement': 'color_clear',
        'unit': '16_bit_color'
    },
    4: {
        'measurement': 'proximity_IR',
        'unit': 'eight_bit_color'
    },
    5: {
        'measurement': 'movement',
        'unit': 'unitless'
    }
}

# Input information
INPUT_INFORMATION = {
    'input_name_unique': 'APDS9960',
    'input_manufacturer': 'Avago_Broadcom',
    'input_name': 'APDS-9960',
    'input_library': 'Adafruit_CircuitPython_APDS9960',
    'measurements_name': 'RGB_Distance_Movement',
    'measurements_dict': measurements_dict,
    'url_manufacturer': 'https://www.broadcom.com/products/optical-sensors/integrated-ambient-light-and-proximity-sensors/apds-9960',
    'url_datasheet': 'https://docs.broadcom.com/docs/AV02-4191EN',
    'url_additional': 'https://learn.adafruit.com/adafruit-apds9960-breakout',
    'url_product_purchase' : 'https://www.adafruit.com/product/3595',

    'dependencies_module': [
        ('pip-pypi', 'adafruit_apds9960', 'adafruit-circuitpython-apds9960'),
    ],

    'interfaces': ['I2C'],
    'i2c_location': ['0x39'],
    'i2c_address_editable': False,

    'options_enabled': [
        'measurements_select',
        'i2c_location',
        'period',
        'pre_output'
    ],

    'options_disabled': ['interface'],

    'custom_commands': [
        {
            'type': 'message',
            'default_value': 'The APDS-9960 is a specialized chip that detects hand gestures, proximity and ambient light color over I2C.'
                             'The APDS9960 from Avago Technologies has an integrated IR LED and driver, along with four directional photodiodes that sense reflected IR energy from the LED. Its proximity detection feature allows it to measure the distance an object is from the front of the sensor (up to a few centimeters) with 8 bit resolution.'
                             'Since there are four IR sensors, you can measure the changes in light reflectance at each of the cardinal locations over time and turn those changes into gestures. Our interface library can detect directional gestures (left to right, right to left, up to down, down to up).'
                             'The Color and Ambient Light Sense detection feature provides red, green, blue and clear light intensity data. Each of the R, G, B, C channels have a UV and IR blocking filter and a dedicated data converter producing16-bit data simultaneously. This architecture allows applications to accurately measure ambient light and sense color'
        },
    ]

}

class InputModule(AbstractInput):
    """Read Colors as Red, Green, Blue and Clear(no filter) as 16 bits Values
       Proximity are read as 8 bits values, by an IR sensor
       It can also sense movements as none(0) / up(1) /down(2) / left(3) / wright(4) directions using the same IR sensor. 
       The RGB sensor can operate independtly from the IR sensor, but you can not disable the IR sensor to read movement nor distance.
       Also, unfornetly, it is not possible to read ambient IR emission using this sensor.
        """
    def __init__(self, input_dev, testing=False,):
        super().__init__(input_dev, testing=testing, name=__name__)

        self.sensor = None
        self.return_dict = None
        self.enabled_IR = None
        self.enabled_rgb = None
        self.enabled_gestures = None

        if not testing:
            self.try_initialize()

    def initialize(self):
        from adafruit_apds9960.apds9960 import APDS9960

        i2c = board.I2C()
        self.logger.debug("APDS RGBC sensor enabled i2c: {}", i2c)
        self.sensor = APDS9960(i2c)

        try:
            self.set_sensor_settings()
        except Exception:
            self.logger.exception("Exception while initializing APDS9960 sensor")

    def set_sensor_settings(self):
        #Will it read colors?
        if self.is_enabled(0) or self.is_enabled(1) or self.is_enabled(2) or self.is_enabled(3):
            self.enabled_rgb = True
            self.sensor.enable_color = True
            while not self.sensor.color_data_ready:
                time.sleep(0.1)
            self.logger.debug("APDS RGBC sensor enabled")
        else:
            self.sensor.enable_color = False
            self.enabled_rgb = False
            self.logger.debug("APDS RGBC sensor disabled")

        #Will it read IR?
        if self.is_enabled(4) or self.is_enabled(5):
            self.sensor.enable_proximity = True
            self.enabled_IR = True
            self.logger.debug("APDS IR sensor Enabled")
            if self.is_enabled(5):
                self.sensor.enable_gesture = True
                self.enabled_gestures = True
                self.logger.debug("APDS gesture sensor Enabled")
            else:
                self.sensor.enable_gesture = False
                self.enabled_gestures = False
                self.logger.debug("APDS gesture sensor Disabled")  
        else:
            self.sensor.enable_proximity = False
            self.enabled_IR = False
            self.logger.debug("APDS IR sensor disabled")

    def get_measurement(self):
                
        self.return_dict = copy.deepcopy(measurements_dict)      

        if self.enabled_rgb:
            self.red, self.green, self.blue, self.clear = self.sensor.color_data
            self.logger.debug("Device Returned: R:{} G:{} B:{} C:{}".format(self.red, self.green, self.blue, self.clear))
            self.value_set(0, int(self.red))
            self.value_set(1, int(self.green))
            self.value_set(2, int(self.blue))
            self.value_set(3, int(self.clear))
            self.logger.debug("Logged colors: R:{} G:{} B:{} C:{}".format(self.value_get(0), self.value_get(1), self.value_get(2), self.value_get(3)))
        if self.enabled_IR:
            distance = self.sensor.proximity
            self.logger.debug("Device Returned proximity value: {} ".format(distance))
            self.value_set(4, int(distance))
            self.logger.debug(f"Logged movement: {self.value_get(4)}")
        if self.enabled_gestures:
            self.value_set(5, int(self.sensor.gesture()))
            self.logger.debug(f"Movement direction: {self.value_get(5)}")
        self.logger.debug("APDS  sensor readings completed")
        
        self.logger.debug(
            "This DEBUG message will only be displayed if the Debug "
            "option is enabled. {}".format(self.return_dict))

        return self.return_dict

I am getting this Logs:

2022-05-11 12:09:40,855 - DEBUG - mycodo.inputs.apds9960_ad7ddc78 - Device Returned: R:3358 G:4577 B:5514 C:12921
2022-05-11 12:09:40,856 - DEBUG - mycodo.inputs.apds9960_ad7ddc78 - Logged colors: R:3358.0 G:4577.0 B:5514.0 C:12921.0
2022-05-11 12:09:40,858 - DEBUG - mycodo.inputs.apds9960_ad7ddc78 - Device Returned proximity value: 7 
2022-05-11 12:09:40,858 - DEBUG - mycodo.inputs.apds9960_ad7ddc78 - Logged movement: 7.0 volts
2022-05-11 12:09:43,629 - DEBUG - mycodo.inputs.apds9960_ad7ddc78 - Movement direction: 0.0 volts
2022-05-11 12:09:43,630 - DEBUG - mycodo.inputs.apds9960_ad7ddc78 - APDS  sensor readings completed
2022-05-11 12:09:43,658 - DEBUG - mycodo.controllers.controller_input_ad7ddc78 - Adding measurements to InfluxDB with ID ad7ddc78-2eec-470c-b79c-fee1ea2cb307: {}
2022-05-11 12:09:55,866 - DEBUG - mycodo.inputs.apds9960_ad7ddc78 - Device Returned: R:3358 G:4577 B:5514 C:12921
2022-05-11 12:09:55,867 - DEBUG - mycodo.inputs.apds9960_ad7ddc78 - Logged colors: R:3358.0 G:4577.0 B:5514.0 C:12921.0
2022-05-11 12:09:55,869 - DEBUG - mycodo.inputs.apds9960_ad7ddc78 - Device Returned proximity value: 7 
2022-05-11 12:09:55,870 - DEBUG - mycodo.inputs.apds9960_ad7ddc78 - Logged movement: 7.0 volts
2022-05-11 12:09:56,331 - DEBUG - mycodo.inputs.apds9960_7f13c385 - Movement direction: 0.0
2022-05-11 12:09:56,332 - DEBUG - mycodo.inputs.apds9960_7f13c385 - APDS  sensor readings completed
2022-05-11 12:09:56,333 - DEBUG - mycodo.inputs.apds9960_7f13c385 - This DEBUG message will only be displayed if the Debug option is enabled. {0: {'measurement': 'color_red', 'unit': '16_bit_color', 'value': 3358.0, 'timestamp_utc': datetime.datetime(2022, 5, 11, 15, 9, 37, 516931)}, 1: {'measurement': 'color_green', 'unit': '16_bit_color', 'value': 4577.0, 'timestamp_utc': datetime.datetime(2022, 5, 11, 15, 9, 37, 516970)}, 2: {'measurement': 'color_blue', 'unit': '16_bit_color', 'value': 5514.0, 'timestamp_utc': datetime.datetime(2022, 5, 11, 15, 9, 37, 516997)}, 3: {'measurement': 'color_clear', 'unit': '16_bit_color', 'value': 12921.0, 'timestamp_utc': datetime.datetime(2022, 5, 11, 15, 9, 37, 517023)}, 4: {'measurement': 'proximity_IR', 'unit': 'eight_bit_color', 'value': 7.0, 'timestamp_utc': datetime.datetime(2022, 5, 11, 15, 9, 37, 519716)}, 5: {'measurement': 'movement', 'unit': 'unitless', 'value': 0.0, 'timestamp_utc': datetime.datetime(2022, 5, 11, 15, 9, 56, 331821)}}
2022-05-11 12:09:56,401 - DEBUG - mycodo.controllers.controller_input_7f13c385 - Adding measurements to InfluxDB with ID 7f13c385-b910-437e-a1ee-236cd181f4a8: {0: {'measurement': 'color_red', 'unit': '16_bit_color', 'value': 3358.0, 'timestamp_utc': datetime.datetime(2022, 5, 11, 15, 9, 37, 516931)}, 1: {'measurement': 'color_green', 'unit': '16_bit_color', 'value': 4577.0, 'timestamp_utc': datetime.datetime(2022, 5, 11, 15, 9, 37, 516970)}, 2: {'measurement': 'color_blue', 'unit': '16_bit_color', 'value': 5514.0, 'timestamp_utc': datetime.datetime(2022, 5, 11, 15, 9, 37, 516997)}, 3: {'measurement': 'color_clear', 'unit': '16_bit_color', 'value': 12921.0, 'timestamp_utc': datetime.datetime(2022, 5, 11, 15, 9, 37, 517023)}, 4: {'measurement': 'proximity_IR', 'unit': 'eight_bit_color', 'value': 7.0, 'timestamp_utc': datetime.datetime(2022, 5, 11, 15, 9, 37, 519716)}, 5: {'measurement': 'movement', 'unit': 'unitless', 'value': 0.0, 'timestamp_utc': datetime.datetime(2022, 5, 11, 15, 9, 56, 331821)}}

But no values are visible at /live:

And only CH4 and CH5 are stored:

Also, I have set up units:

Thanks a Lot!
Vitor.

Ok, After changing from a custom measurement unit from 16_bit_color to the existing mycodo unit eight_bit_color, my input module works!

Did you add the custom units to Mycodo before importing the Input Module?

Did you add the custom units to Mycodo before importing the Input Module?

Yes, as shown in the prints

Strange. I’ll take a look to see if it’s a bug.

I just tested importing a test Input module with a new unit and measurement I added via the Measurement configuration page and it successfully stored the measurement in the database and displayed it on the Live Measurements page. So I’m not exactly sure where your configuration went wrong.

I didn’t tested it yet, but maybe it was the number 16 in the beginning of the unit name