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

Feature Request: Interface for thirdparty apps #410

Open
womoak75 opened this issue Nov 12, 2022 · 10 comments
Open

Feature Request: Interface for thirdparty apps #410

womoak75 opened this issue Nov 12, 2022 · 10 comments
Labels
enhancement New feature or request

Comments

@womoak75
Copy link

An interface which allows easy integration of additional user applications into a custom Ahoi build would be a nice feature.

Unfortunately my knowledge of C++ is very 'minimalistic' (java ist my favourite), but i tried my very best to provide a simple example.
main...womoak75:ahoy:main

pros cons
minimal impact on existing code base no 'nice' sw design
esp8862/esp32 is in idle mode most of the time anyway
minimize merge effort on future custom builds

please feel free to agree/disagree or add additional topics.

@stefan123t
Copy link
Collaborator

@womoak75 this looks like a example template for building and adding custom plugins into the AhoyDTU.
Thanks, let us see who will make use of this blueprint for whatever app-plugin they want to provide for AhoyDTU.
Did you already have a specific purpose in mind ?

@womoak75
Copy link
Author

Yes, i do.
Want to connect my power meter and implement some "Nulleinspeisung".

I also added a mqtt callback to my example, to enable input/control data for a thirdparty app.
e.g. publishing to topic 'inverter/thirdparty/{data}' which will be ignored by the ahoi app.
Should be sufficient for a simple start and enables user to add their own code,
without "hacking" into the ahoi code base.

A more sophisticated approach would be adding hooks for all major functions (configuration, web, api, etc.),
but 'a journey of a thousand miles begins with a single step'

If desired, I could add a pull request for simplicity reasons. :)

@stefan123t
Copy link
Collaborator

@womoak75 could you add a #define to disable your plugin by default and some example in example_overwrite_config.h before you PR.
@lumapu did you take a quick look at this sample plugin or should @womoak75 wait with his PR till you have refactored a couple of things which you are busy with ?

@womoak75
Copy link
Author

Will add a PR at your request.

@lumapu
Copy link
Owner

lumapu commented Nov 15, 2022

@stefan123t will do

@womoak75
Copy link
Author

also tried to add web / webApi / gui support

@stefan123t
Copy link
Collaborator

A possible example scenario for this plugin adapter could be the Thingspeak integration in #185 or the Prometheus support in #190 and PR #356
Maybe the Azure IOT Cloud OAuth also could qualify for such a flexible plugin approach ?

@womoak75
Copy link
Author

@stefan123t
Maybe, but i am not familiar with the requirements.

Would suggest to merge my proposal and let the guys find out if its suitable or not.
'try and error', a frequently used developer approach. :)

Whats still missing, but probably necessary for "plugins", is configuration load/store functionality.
I took a look at the relevant code but couldn't figure out how to implement it in a simple way.
So i decided my application will use its own storage.

I would also recommend to refactor the GUI.
Wouldn't it be much easier concerning maintenance and extension,
if there's only one html main page and content loading is done by js?
Menu bar entries are loaded via js already.

@womoak75
Copy link
Author

womoak75 commented Nov 18, 2022

main...womoak75:ahoy:plugins
main...womoak75:ahoy:devel
plugin hacker version v0.0.1 :)

@stefan123t stefan123t changed the title Interface for thirdparty apps Feature Request: Interface for thirdparty apps Jan 12, 2023
@stefan123t stefan123t added the enhancement New feature or request label Jan 12, 2023
@lumapu lumapu mentioned this issue Apr 25, 2023
16 tasks
@stefan123t
Copy link
Collaborator

@lumapu können wir das als Beispiel für ein Plugin aktzeptieren und mergen ?
@womoak75 hat einiges an Doku geschrieben und man müsste mal prüfen ob es noch aktuell / mergebar ist ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants