User Management for OpenEMS UI Backend


I am currently running OpenEMS Edge and Backend successfully with my ESS setup. I am running the OpenEMS UI attached to the backend and it is working successfully.

However, there is no user validation being enforced. You can log in without a username and password. We would like to make the UI available to customers over the internet, however of course the current configuration is highly insecure as there is absolutely no validation applied and a malicious user can easily cause damage to the customer’s equipment.

How can user management be implemented in OpenEMS Backend? Ideally we should be able to create and manage user accounts, require credentials to log in etc.



In OpenEMS, user management function is not provided directly.
instead of user management, OpenEMS is providing “Metadata” function.

This function is interface of authentication/authorization.
Now officially OpenEMS implemented FileMetadata(use static file) and OdooMetadata(OSS ERP user integration via web api) based on this interface.

Of course you can also implement it yourself. // io.openems.backend.metadata.{dummy, file, odoo} directory is implementation of ↑. you just write handler function.

I think official implementation is good material of learning metadata mecanism.

Hi Thomas,

we use the Odoo connection in production and I can highly recommend it to anyone.

Odoo not only serves as a authentication provider and for Edge management, but also for persisting configuration, auditing etc. Also the OpenEMS App-Center is tightly integrated with Odoo, even though certain parts are unfortunately not yet published as open source.

You can use our Gitpod for a live Demo of the integration: Dashboard


I don’t mean to hijack this thread, Stefan, but since I am still unable to get the GitPod simulation working, can your provide some simple initial steps to get the Odoo user authentication working? I have created an account and database on Odoo and enabled the Metadata.Odoo service in my OpenEMS Backend but I am not quite clear on the process. I heard mention of the Odoo plugin for OpenEMS but it appears to be a work in progress. Any advice would be appreciated.

1 Like

Install this in Odoo…

1 Like

Thanks Sn0w3y. Do you mean as an App in Odoo or something else? I do not currently have a self-hosted instance of Odoo. I just have an account with them and they are hosting it.

1 Like

yes, you need to self-host odoo16

1 Like

Ah. That clears up a lot. Thanks, I will run with it…


I previously attempted trying to use the Odoo Metadata provider but gave up and wrote my own metadata provider because I couldn’t get the Odoo one to work.

I would still like to try the Odoo provider because running my own one requires a certain amount of maintenance. Is there any installation instructions for the Odoo Addon?

1 Like

no, but it should not be too hard… just google installation instructions for odoo on for example linux ubuntu and so on

1 Like

I have successfully installed the Odoo addon for OpenEMS in my Odoo 16 instance, and now the OpenEMS area is appearing within Odoo for me.

However, when I try to add a new device in Odoo, I immediately receive ‘RPC Error - Odoo Server Error’. Stacktrace below.

It appears that ‘’ is evaluating as a boolean instead of a string within the ‘_compute_monitoring_url()’ function.

Have you experienced this issue before or are you aware of any misconfigurations that could have caused it?

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/", line 996, in get
    cache_value = field_cache[record._ids[0]]
KeyError: <NewId 0x7fccefa95ab0>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/", line 1161, in __get__
    value = env.cache.get(record, self)
  File "/usr/lib/python3/dist-packages/odoo/", line 1003, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'openems.device(<NewId 0x7fccefa95ab0>,).monitoring_url'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/", line 1633, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/usr/lib/python3/dist-packages/odoo/service/", line 133, in retrying
    result = func()
  File "/usr/lib/python3/dist-packages/odoo/", line 1660, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
  File "/usr/lib/python3/dist-packages/odoo/", line 1864, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/", line 154, in _dispatch
    result = endpoint(**request.params)
  File "/usr/lib/python3/dist-packages/odoo/", line 697, in route_wrapper
    result = endpoint(self, *args, **params_ok)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/", line 42, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/", line 33, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/", line 468, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/", line 453, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/", line 6587, in onchange
    snapshot1 = Snapshot(record, nametree)
  File "/usr/lib/python3/dist-packages/odoo/", line 6347, in __init__
  File "/usr/lib/python3/dist-packages/odoo/", line 6357, in fetch
    self[name] = record[name]
  File "/usr/lib/python3/dist-packages/odoo/", line 5915, in __getitem__
    return self._fields[key].__get__(self, self.env.registry[self._name])
  File "/usr/lib/python3/dist-packages/odoo/", line 1210, in __get__
  File "/usr/lib/python3/dist-packages/odoo/", line 1392, in compute_value
  File "/usr/lib/python3/dist-packages/odoo/addons/mail/models/", line 403, in _compute_field_value
    return super()._compute_field_value(field)
  File "/usr/lib/python3/dist-packages/odoo/", line 4232, in _compute_field_value
    fields.determine(field.compute, self)
  File "/usr/lib/python3/dist-packages/odoo/", line 98, in determine
    return needle(*args)
  File "/odoo/odoo-server/addons/openems/models/", line 45, in _compute_monitoring_url
    rec.monitoring_url = url +
TypeError: can only concatenate str (not "bool") to str

The above server error caused the following client error:
null `
1 Like

Please see the Pull Requests for this Errror on GutHub

@sfeilmeier this was the error i was talking about in the PR

1 Like

Hi @Sn0w3y,

Do you know of a workaround for this or a way of getting it working?


We would like to go ahead with the metadata implementation but I can’t find any instructions on how to proceed. Are there any?

Sn0w3ys PR has been merged recently:

1 Like

Were you able to get any further, @thomas? I have Odoo installed and I am able to authenticate users and even add an edge device such as “edge0”. But, the websocket queries never return an edge device when I log in as a user through the OpenEMS UI. I get this error:

{"jsonrpc":"2.0","id":"1de80263-0ed7-4beb-8dde-b7e193447ea0","error":{"code":1,"message":"Unable to find edge with id [edge0]","data":["Unable to find edge with id [edge0]"]}}

I am so close but I an unsure how there are no edge devices returning even though the users are definitely associated with one in Odoo.