Ok. While I work through the Odoo implementation, I would like to try a the more simple approach provided by using Metadata. I have a working OpenEMS Edge installation on a Pi server, a working OpenEMS Backend installation on another Pi, and OpenEMS UI running on the same Backend server. When I use the UI login, it defaults to the demo admin/admin user and displays no Edge devices upon login.
So, I have created a file called devices.json which lives on the Backend server that is being read by the Controller Api Backend from OpenEMS Edge. On the Backend server, I have enabled a Metadata.File bundle that points to the devices.json file. The API key in that Edge websocket configuration is confirmed to be reading from the Backend devices.json file that contains this:
{
"edges": {
"edge0": {
"comment": "Edge #0",
"apikey": "edge0",
"setuppassword": "abcdefgh"
},
"edge1": {
"comment": "Edge #1",
"apikey": "edge1",
"setuppassword": "1234567"
}
}
}
I have sifted through a lot of code so I am only coming to the community for help after exhausting every angle.
Here is an example of the kind of file I layout I would like to use for the user management:
{"username": "admin", "password": "admin", "role": "ADMIN", "device": "edge0"},
{"username": "testadmin", "password": "testadmin", "role": "ADMIN", "device": "edge0"},
{"username": "testowner", "password": "testowner", "role": "OWNER", "device": "edge1"},
{"username": "testguest", "password": "testguest", "role": "GUEST", "device": "edge2"},
Now, what I am having trouble understanding is how/where do you then define a Metadata file that can be used for user authentication from the UI? On the Backend, it looks like you can only create/enable one Metadata.File instance which I am already using for the devices. Also, how do you associate users with devices, or does it matter? Do I create another Controller Api Backend in the Edge server configuration?
The entire OpenEMS framework is brilliant but sometimes I feel like I need to get with Russell Crowe in A Beautiful Mind to get to the next level.