New features: custom Function Actions and Input Actions

I’ve been slowly refactoring parts of Mycodo to be able to import custom single-file modules. Currently custom Inputs, Outputs, and Functions are supported. I’ve been thinking about refactoring Function Actions to act similarly, so users can create their own actions. I’ve also been wanting to add the ability to add actions to Inputs, to be able to do things such as MQTT publishes every measurement, and such. I know there’s been a desire for these features in the community for a while, so I wanted to start a discussion in case anyone else had any input.

2 Likes

I just came up with an idea how to implement Actions for Inputs. These would be Actions that would run after every measurement acquisition by the Input. From the currently-available Actions, I can really only see the MQTT Publish Action being applicable to Inputs. There will need to be a slight modification to it, namely the ability to select which Input measurement to publish.

These could be other Actions that may be applicable to Inputs:

  • Execute Command: Shell
  • Send email
  • Webhook
1 Like

Input Actions are now working, with the first being the MQTT Publish Action. There’s some testing and documentation rewriting to be done, but the framework is now in place. It should be at a state to be committed to master in a day or two.