How do I create a c...
Clear all

How do I create a custom function that takes method data?  



I am learning about the custom function capabilities so that I can implement a MIMO controller, but first I am working on converting the base PID controller into a custom function. Rewriting most of the variables and measurements was simple, and I see how influxdb commands are used to retrieve data in the PID controller. However, I don't fully understand how setup_custom_options works and I am wondering if it can be used by custom functions to get the method id from the user.

1 Answer

A Method selection isn't currently supported for Custom Options, but I just added it with commit 26e508c and will be available in the next version release, which should be in the next few days. When implemented, you can add a custom option like so:

'id': 'select_method',
'type': 'select_device',
'default_value': '',
'options_select': [
'name': lazy_gettext('Select Method'),
'phrase': lazy_gettext('Select Method Description')

See the example function for this in context.

Mycodo Developer