# SetMbusUserKeyByChannel

## Description

SetMbusUserKeyByChannel is a request to generate, transfer and set an M-Bus user key on an M-Bus device (for instance a G-meter behind an E-meter) via the DLMS gateway device. The request needs the DeviceIdentification from the gateway device and the channel for the M-Bus device. A use case for a request with the channel (as only identification of the M-Bus device besides the identification of the gateway) as input is to be able to respond to new M-Bus device discovered on channel x alarms (x in 1..4) from a gateway. If a new M-Bus User key is to be set on an M-Bus device with a known identification, this can be done with the [SetKeyOnGMeter](/gxf/domains/smartmetering/smartmeteringws/configuration/setkeyongmeter.md) request.

All requests have similar response behaviour which is described in [ResponseMessages](/gxf/domains/smartmetering/responsemessages.md).

The response contains the DeviceIdentification and CorrelationUid which is received from the SetMbusUserKeyByChannel request. [GetSetMbusUserKeyByChannelResponse](/gxf/domains/smartmetering/smartmeteringws/configuration/getsetmbususerkeybychannelresponse.md) returns the result from issuing a SetMbusUserKeyByChannel request.

## References

XSD: [sm-configuration.xsd](https://github.com/OSGP/open-smart-grid-platform/blob/development/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/sm-configuration.xsd)

WSDL: [SmartMeteringConfiguration.wsdl](https://github.com/OSGP/open-smart-grid-platform/blob/development/osgp/shared/osgp-ws-smartmetering/src/main/resources/SmartMeteringConfiguration.wsdl)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://grid-exchange-fabric.gitbook.io/gxf/domains/smartmetering/smartmeteringws/configuration/setmbususerkeybychannel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
