Skip to content

Conversation

@iseeberg79
Copy link
Contributor

@iseeberg79 iseeberg79 commented Jan 4, 2026

Add support for EMH CASA 1.1 Smart Meter Gateway

Implements native meter support for EMH CASA 1.1 Smart Meter Gateways via HAN interface.

Features

  • Auto-discovery of the meter using mDNS detection of smgw.local
  • Auto-discovery of meter ID via TAF contracts
  • Power, energy, currents, voltages, and phase powers
  • OBIS code decoding for CASA logical names
  • Digest authentication with custom Host header support
  • Configurable refresh interval (default: 15s)
  • Sensitive data redaction (credentials, meter IDs)

Implementation Notes

  • Designed for isolated HAN network (BSI TR-03109)
  • Self-signed certificate handling (InsecureSkipVerify)
  • HTTP/1.1 enforcement (CASA gateway requirement)
  • Implementation based on gosanman/smartmetergateway (MIT)

Configuration Example

meters:
  - name: grid
    type: emh-casa
    uri: https://192.168.x.y   //. leave empty for mDNS detection
    user: <username>
    password: <password>

Config UI

image

Result

image

@evcc-bot evcc-bot added devices Specific device support enhancement New feature or request labels Jan 4, 2026
@andig
Copy link
Member

andig commented Jan 4, 2026

This is a lot of code we would need to maintain. Could the actual device interface live in an external repo?

@iseeberg79
Copy link
Contributor Author

iseeberg79 commented Jan 4, 2026

Don't yet know.

HAN is special in usage anyway: is it generally useful?

The interface could be seen somewhat stable as TRUDI uses it.

Let's know about community interest in general first, then decide?

TAF-1 profile gives realtime data access that's why it's valid as a grid meter.

As many, I don't personally rely on it as I have an additional meter installed already. Locally the implementation replaces the old IR reading device.

@andig
Copy link
Member

andig commented Jan 4, 2026

Don‘t get me wrong- HAN makes absolute sense. I‘m just saying the core library could live outside of evcc.

@github-actions github-actions bot added the stale Outdated and ready to close label Jan 19, 2026
@tobima
Copy link

tobima commented Jan 20, 2026

This looks promising!

Unfortunately, my SMGW currently only provides meter readings and not the real-time power output. I’ve already reached out to my metering point operator regarding this; it might be related to the specific user profile assigned to my access.

That said, I can confirm that the library works as intended and reliably retrieves measurement data whenever it is available. Since any software change on the SMGW requires re-certification, I expect the API to remain stable.

Ultimately, it would be great to have the SMGW supported as a grid meter.

@github-actions github-actions bot removed the stale Outdated and ready to close label Jan 20, 2026
@andig
Copy link
Member

andig commented Jan 20, 2026

Unfortunately, my SMGW currently only provides meter readings and not the real-time power output.

That's a no-go since the primary purpose of the grid meter is not fulfilled. Let's close here. We can reopen once power measurements become available.

@andig andig closed this Jan 20, 2026
@iseeberg79
Copy link
Contributor Author

Closed too early as it depends? My meter provides stable power measurements (see screenshots). We need multiple feedback on installed meters?

@tobima
Copy link

tobima commented Jan 20, 2026

How could we get more feedback?

@iseeberg79
Copy link
Contributor Author

iseeberg79 commented Jan 20, 2026

I have asked in Slack & GH discussions

please update here on any changes.

Could you try to select and not to autodiscover?

Would be great to exchange a (reduced) set of meter data to be sure not to have an implementation error and to exclude issues with ordering of meter ids as there are at least two contracts available.
I'll send a curl command to gather more data.

@andig andig reopened this Jan 20, 2026
@iseeberg79
Copy link
Contributor Author

iseeberg79 commented Jan 21, 2026

It seems not every installation of the same gateway is providing second-based metering.

Example dataset of an gateway/meter installation (TAF1/7)

curl -k --digest -u "user:password" https://192.168.33.2:443/json/metering/origin/1efr0123456789/extended

{
    "capture_time": "2026-01-20T19:53:40+01:00",
    "status": "a000000020863800",
    "timestamp": "2026-01-20T19:53:40+01:00",
    "values": [
        {
            "logical_name": "0100010800ff.1efr0123456789.sm",
            "scaler": -1,
            "signature": "-",
            "unit": 30,
            "value": "15688560"
        },
        {
            "logical_name": "0100020800ff.1efr0123456789.sm",
            "scaler": -1,
            "signature": "-",
            "unit": 30,
            "value": "4695714"
        },
        {
            "logical_name": "01000e0700ff.1efr0123456789.sm",
            "scaler": -1,
            "signature": "-",
            "unit": 44,
            "value": "499"
        },
        {
            "logical_name": "0100100700ff.1efr0123456789.sm",
            "scaler": 0,
            "signature": "-",
            "unit": 27,
            "value": "359"
        },
        {
            "logical_name": "01001f0700ff.1efr0123456789.sm",
            "scaler": -2,
            "signature": "-",
            "unit": 33,
            "value": "435"
        },
        {
            "logical_name": "0100200700ff.1efr0123456789.sm",
            "scaler": -1,
            "signature": "-",
            "unit": 35,
            "value": "2276"
        },
        {
            "logical_name": "0100240700ff.1efr0123456789.sm",
            "scaler": 0,
            "signature": "-",
            "unit": 27,
            "value": "923"
        },
        {
            "logical_name": "0100330700ff.1efr0123456789.sm",
            "scaler": -2,
            "signature": "-",
            "unit": 33,
            "value": "175"
        },
        {
            "logical_name": "0100340700ff.1efr0123456789.sm",
            "scaler": -1,
            "signature": "-",
            "unit": 35,
            "value": "2313"
        },
        {
            "logical_name": "0100380700ff.1efr0123456789.sm",
            "scaler": 0,
            "signature": "-",
            "unit": 27,
            "value": "-168"
        },
        {
            "logical_name": "0100470700ff.1efr0123456789.sm",
            "scaler": -2,
            "signature": "-",
            "unit": 33,
            "value": "183"
        },
        {
            "logical_name": "0100480700ff.1efr0123456789.sm",
            "scaler": -1,
            "signature": "-",
            "unit": 35,
            "value": "2294"
        },
        {
            "logical_name": "01004c0700ff.1efr0123456789.sm",
            "scaler": 0,
            "signature": "-",
            "unit": 27,
            "value": "-395"
        },
        {
            "logical_name": "0100510701ff.1efr0123456789.sm",
            "scaler": 0,
            "signature": "-",
            "unit": 8,
            "value": "120"
        },
        {
            "logical_name": "0100510702ff.1efr0123456789.sm",
            "scaler": 0,
            "signature": "-",
            "unit": 8,
            "value": "240"
        },
        {
            "logical_name": "0100510704ff.1efr0123456789.sm",
            "scaler": 0,
            "signature": "-",
            "unit": 8,
            "value": "344"
        },
        {
            "logical_name": "010051070fff.1efr0123456789.sm",
            "scaler": 0,
            "signature": "-",
            "unit": 8,
            "value": "222"
        },
        {
            "logical_name": "010051071aff.1efr0123456789.sm",
            "scaler": 0,
            "signature": "-",
            "unit": 8,
            "value": "188"
        }
    ]
}

EMH Presse

@github-actions github-actions bot added the stale Outdated and ready to close label Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devices Specific device support enhancement New feature or request stale Outdated and ready to close

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants