Xcel Energy ITron Gen 5 Riva

When I try to setup my command line sensors I get an error end of the stream or a document separator is expected. I copied directly from the reddit article.

- sensor:
    unique_id: xcel_meter
    name: Xcel Meter
    command: "OPENSSL_CONF=/config/xcel/openssl.conf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://172.16.5.11:8081/upt/1/mr/3/r --cert /config/xcel/cert.pem --key /config/xcel/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
    unit_of_measurement: "kWh"
    value_template: "{{ float(value) | multiply(0.001) | round(3) if is_number(value) }}"
    device_class: 'energy'
    state_class: 'total_increasing'
    scan_interval: 5 #in seconds
    command_timeout: 5 #in seconds
      
- sensor:
    unique_id: xcel_meter_load
    name: Xcel Meter Load
    command: "OPENSSL_CONF=/config/xcel/openssl.conf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://172.16.5.11:8081/upt/1/mr/1/r --cert /config/xcel/cert.pem --key /config/xcel/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
    value_template: "{{ float(value) if is_number(value_json) }}"
    unit_of_measurement: "W"
    device_class: 'power'
    scan_interval: 5 #in seconds
    command_timeout: 5 #in seconds

This writeup is what needs to be the top-post in this thread :slight_smile:

I did the form and I got access to the Github repository.

However, when I go to https://my.xcelenergy.com/MyAccount/s/meters-and-devices/ I see a blank page, see screenshot below.

Did I miss a step somewhere? What else could be wrong? (I live in a newly constructed house built this year with Xcel in Colorado.

@Puree same here. I found this repository: GitHub - ws/xcelsior: (Unofficial) Interface with Itron smart meter via Xcel's Energy Launchpad program

Which has a link to enroll your meter: https://my.xcelenergy.com/MyAccount/s/meters-and-devices/manage-meters-and-devices

When I visit there, I see that my meter is “Pending” and any wifi settings I apply don’t seem to work. Been about a month (new construction) and hasn’t changed for me - been pending the whole time and no wifi settings seem to work.

I may try to contact Xcel soon, let me know if you get anywhere.

1 Like

This is what I see and experience as well.

Looks like my issue was that I don’t in fact have a smart meter, its not a gen5 riva - not sure what it is.

I got my command line sensor cleaned up and it saves and runs but the command line fails with an exit code of 1. Any idea what that means?

https://10.0.0.226:8081/upt/1/mr/1/r is Instantaneous Demand (kW)
https://10.0.0.226:8081/upt/1/mr/2/r is Current Summation Delivered (kWh)
https://10.0.0.226:8081/upt/1/mr/3/r is Current Summation Received (kWh)

(1) Maximum power or rate of energy consumed
during a 15-minute period, for the month.

(2) Total energy received on the grid from the customer,
since the meter was installed where distributed
energy resources (solar, battery, etc.) are connected.

(3) Total energy used since the meter was installed.

Now that I have Enphase installed and Deliver power to the grid, my Instantaneous Demand sensor (sensor.smart_electric_meter_power) is goofed up because it isn’t reporting negative numbers.
When I’m delivering power to the grid (like 5023 W) my sensor.smart_electric_meter_power reports 4207 W, but it’s really negative number.

My sensor should report -4207 because it’s backfeeding to the grid.

Here is my sensor.smart_electric_meter_power configuration in configuration.yaml.

sensor:
  - platform: command_line
    unique_id: xcel_meter_power
    name: "Smart Electric Meter Power"
    command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/1/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
    unit_of_measurement: "W"
    device_class: "power"
    scan_interval: 5
    command_timeout: 5

How do I change this to capture negative numbers.

Here is what I get when I don’t include the 2>&1 | grep -o ‘.*’ | grep -Eo ‘[0-9]+’ , To parse out the numbers 0-9

 OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/1/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem

<Reading
     xmlns="urn:ieee:std:2030.5:ns"
     href="/upt/1/mr/1/r">
    <qualityFlags>01</qualityFlags>
    <timePeriod>
        <duration>1</duration>
        <start>1701374722</start>
    </timePeriod>
    <value>-4089</value>
</Reading>

After a lot of googling, I found something that works to grep for a negative number.

[+-]?: Match optional + or -
[0-9]+: Match 1 or more digits

Here is my configuration.yaml

sensor:
  - platform: command_line
    unique_id: xcel_meter_power
    name: "Smart Electric Meter Power"
    #command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/1/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
    command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/1/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '([+-]?[0-9]+)'"
    #   value_template: "{{ float(value) | multiply(0.001) | round(3) if is_number(value) }}"
    #   value_template: "{{ value | multiply(0.001) | round(3)}}"
    # value_template: "{{ float(value) if is_number(value_json) }}"
    unit_of_measurement: "W"
    device_class: "power"
    scan_interval: 5
    command_timeout: 5

Just got mine installed as well in Minneapolis (~5 days ago). Says Wifi is connected, but pending on Meter Setup. Any idea how long it takes to be connected?

When I try to enroll in launchpad, I get Error Authorization header cannot be null. Tried different browsers and clearing cache. Will try again later.

1 Like

If anyone is interested, I wrapped @zakn’s xcel_itron2mqtt project into a HASS compatible add-on: wingrunr21/hassio-xcel-itron-mqtt. It generates the certs and ldfi for you on initial startup if they don’t already exist.

@zakn I think this could likely co-exist with your existing setup if you’d prefer I PR this back into your repo. Most of it is getting all the config set up properly to match add-on guidelines.

2 Likes

I am having the same issue. I will get the “Request Successful” message and can see that it shows “connected”, but Meter Status never leaves “pending”. Whenever I come back after a little time it shows “not connected”. The process repeats itself any time I enter new credentials. I have it on a 2.4ghz IoT network. I always get a notification when a host joins my network, and I’ve never received one, even when the meter initially shows “connected”.

I also get the “authorization header cannot be null” if I try to go to the launchpad consent screen. I had to get around it by signing up for the sdk access and using the links in the guides that take me to the Manage Meters and Devices page. Not sure if that is part of my hangup.

UPDATE: Contacted Xcel support. Clearing the browser cache did allow me to successfully enroll in Launchpad. They are stating that even if I can access the “Managed Devices” screens, the meter will not register until you can accept the Ts & Cs. Waiting on my email confirming the meter is licensed before I try to connect to wifi.

1 Like

So strange. I just tried today again, and It said “success” when I enrolled in Launchpad. I did nothing different. I’ll give it a few days until I check back.

Wifi issues are still a problem, but I think I understand why. I have a mesh network and I was suspicious that was the issue since it will briefly report “connected”. I grabbed a range extender and set it up near the meter and boom; rock solid connection to the extender’s SSID. The problem is, because the extender essentially creates a different network altogether, I cannot reach the Itron from any devices on my mesh network.

I could at least see the MAC of the Itron through the extender’s GUI, so I setup a reservation to see if that would coax meter onto the mesh network. It’s doing more than before, e.g. can see it connecting / disconnecting from mesh’s GUI, but it is never stable and I’ve only ever seen one ping response.

TLDR: Itron doesn’t like (my?) mesh networks.

My iTron Gen 5 Riva sensors stopped working after Home Assistant Core 2023.12.0 was installed.

I don’t understand what needs to be done to fix the problem.

I can no longer get sensor updates for:
sensor.smart_electric_meter_consumption
sensor.smart_electric_meter_power
sensor.smart_electric_meter_production

Is it that these sensors can no longer be created in configuration.yaml ???

Here is my configuration.yaml:

sensor:
  - platform: command_line
    unique_id: xcel_meter_power
    name: "Smart Electric Meter Power"
    #command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/1/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
    command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/1/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '([+-]?[0-9]+)'"
    #   value_template: "{{ float(value) | multiply(0.001) | round(3) if is_number(value) }}"
    #   value_template: "{{ value | multiply(0.001) | round(3)}}"
    # value_template: "{{ float(value) if is_number(value_json) }}"
    unit_of_measurement: "W"
    device_class: "power"
    scan_interval: 5
    command_timeout: 5

  - platform: command_line
    unique_id: xcel_meter_consumption
    name: "Smart Electric Meter Consumption"
    command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/3/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
    unit_of_measurement: "kWh"
    value_template: "{{ value | multiply(0.001) | round(3)}}"
    device_class: "energy"
    state_class: "total_increasing"
    #scan_interval: 86400
    scan_interval: 5
    command_timeout: 5

  - platform: command_line
    unique_id: xcel_meter_productiion
    name: "Smart Electric Meter Production"
    command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/2/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
    unit_of_measurement: "kWh"
    value_template: "{{ value | multiply(0.001) | round(3)}}"
    device_class: "energy"
    state_class: "total_increasing"
    #scan_interval: 86400
    scan_interval: 5
    command_timeout: 5

I updated to 12.0 and mine are still working. :sweat:

I have been thinking of adding another sensor that just records the text before all the number conversions. If the meter returns an error message, we could read it.

What does your configuration.yaml look like for your sensors.

It’s posted higher up. This thread is getting long in the tooth, so I understand if you didn’t find it:

Take a look at the posts I made above and below that too. I think I put all the steps I took in there.

Mine isn’t perfectly reliable. I’m not sure why it fails sometimes, but I just added an EV and I have been paying close attention to the graph, and it has been missing data sometimes.

At this point, I don’t believe it is an issue with the HA update. Unless the config file storage changed for you and not me. If I were you, I would wait a day at least to change anything in case it is just the meter taking a holiday.

@petro showed my how to fix it.

This is what he told me to put in configuration.yaml and it worked.

command_line:
- sensor:
    unique_id: xcel_meter_power
    name: "Smart Electric Meter Power"
    #command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/1/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
    command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/1/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '([+-]?[0-9]+)'"
    unit_of_measurement: "W"
    device_class: "power"
    scan_interval: 5
    command_timeout: 5

- sensor:
    unique_id: xcel_meter_consumption
    name: "Smart Electric Meter Consumption"
    command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/3/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
    unit_of_measurement: "kWh"
    value_template: "{{ value | multiply(0.001) | round(3)}}"
    device_class: "energy"
    state_class: "total_increasing"
    #scan_interval: 86400
    scan_interval: 5
    command_timeout: 5
 - sensor:
    unique_id: xcel_meter_productiion
    name: "Smart Electric Meter Production"
    command: "OPENSSL_CONF=/config/xcelcerts/myown/openssl.cnf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/2/r --cert /config/xcelcerts/myown/cert.pem --key /config/xcelcerts/myown/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
    unit_of_measurement: "kWh"
    value_template: "{{ value | multiply(0.001) | round(3)}}"
    device_class: "energy"
    state_class: "total_increasing"
    #scan_interval: 86400
    scan_interval: 5
    command_timeout: 5

I’ve been waiting for months to get Xcel to process my device connection request but the status still says “Pending”. Every night for the past several weeks I get this email:

The Xcel Energy Launchpad team is still working to resolve your enrollment issue. We sincerely apologize for the inconvenience. We will let you know when your smart meter has been successfully set up. Thank you for your interest in Xcel Energy Launchpad. We will be in touch with you soon.

I’ve tried calling Customer Support, emailing [email protected], and emailing [email protected] . I’ve never had a call or email returned from them. Has anyone else been caught in this black hole and did you ever escape (and how)?