Xcel Energy ITron Gen 5 Riva

Sounds good to me!

I have been slacking putting up better docs explaining the process of joining the Xcel program, adding LFDI, etc.

For anyone here, I’d love some feedback on the current docs. As you continue working on projects I find it harder and harder refining documentation as its no longer fresh when working through it. Either open a PR or add some feedback here on how to streamline the process of getting the meter on the network, then up and running through home assistant.

1 Like

It took about 5 business days from when I requested access to when I was finally able to pull data into HA. I do still get an “unsafe legacy renegotiation disabled” error when I try the curl command to test the keys but the command line entities are working and pulling data into HA now.

Nice. Mine just changed to that error message today. I used the itron2mqtt script to create the cert. I have only been using the command line curl from ubuntu 22.04.

Did you use this to add it to HA, or the itron2mqtt script?

I’m not sure what the best way to add itron2mqtt to HA. The config is what I will try next.

Edit: The linked configs are not working. I get the same error. I get the same legacy renegotiation disabled message in the terminal in HA.

I have ran into this in different places with openssl 3.0. It doesn’t like some forms of encryption. IDK if this is that problem, but I had to update my ssh keys to ed25519 on my openssl-3.0 machine.

The error:

curl: (35) OpenSSL/3.0.8: error:0A000152:SSL routines::unsafe legacy renegotiation disabled

I see an issue here with curl: curl: (35) error:0A000152:SSL routines::unsafe legacy renegotiation disabled · Issue #9158 · curl/curl · GitHub

That config file is part of the iton2mqtt docker image. That must be why it exists:

So I guess I need to run this docker image somewhere. Anyone have a suggestion on the best way to add it to the home assistant os? I have done custom add-ons before and it wasn’t… super smooth. I could run it on another machine.

I’m using @SergeantScar’s method with just command line sensors set up in my config file. I did use the itron2mqtt script to generate the LFDI and cert/key pem files though.

It works for now and was easy enough to get working. It would be nice as an integration but that it beyond my skills.

1 Like

I was able to fix this on my HA server. This is what I did:

  1. I added the file /root/config/xcelcerts/openssl.conf. The contents are the openssl.conf file here. Added again for simplicity:
openssl_conf = openssl_init

[openssl_init]
ssl_conf = ssl_sect

[ssl_sect]
system_default = system_default_sect

[system_default_sect]
Options = UnsafeLegacyRenegotiation
  1. For each of the commands, I set the environment variable before running the curl command:
  - platform: command_line
    name: "Smart Electric Meter Consumption"
    command: "OPENSSL_CONF=/root/config/xcelcerts/openssl.conf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://10.0.0.226:8081/upt/1/mr/3/r --cert /root/config/xcelcerts/cert.pem --key /root/config/xcelcerts/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: 5
    command_timeout: 5

The important part (for this error) is OPENSSL_CONF=/root/config/xcelcerts/openssl.conf .

I still have some tuning on the sensor configuration. But this is at least returning a value. I will probably poke more at the itron2mqtt code to see what else I should be scraping. I prefer the command_line integration to a docker image running on another machine. An add-on that just did this would be perfect.

1 Like

Mine came online this morning about 7:55 - that’s when my docker container stopped throwing errors.

The nmap now shows the port as open.

All looks to be working.

1 Like

Same, mine started working yesterday as well

I got my official enrollment email this morning.

I got my official enrollment email as well, and the Edit button still does nothing as far as actually allowing me to add the meter to my network. @rucknapucknavitz were you able to get your meter on your network?

I’m trying various browsers and even turning off my pihole trying to make this work and just nothing.

I had more success getting online with the Xcel mobile app than the website. Maybe give that a go?

Poking at it again today. I followed the steps to get logged into the main homeassistant container. The config folder is just at /config. :tada:.

So, if you are running the HassOS, and you want to use the command line sensors, make sure you are using /config, not /root/config. The /root/config works in the ssh terminal, but that runs in another container.

Here is the config I am using:

sensor:
  - platform: command_line
    unique_id: xcel_meter_power
    name: "Xcel Meter Power"
    command: "OPENSSL_CONF=/config/xcelcerts/openssl.conf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://<ip address>:8081/upt/1/mr/1/r --cert /config/xcelcerts/cert.pem --key /config/xcelcerts/key.pem 2>&1 | grep -o '<value>.*</value>' | grep -Eo '[0-9]+'"
    unit_of_measurement: "W"
    value_template: "{{ float(value) if is_number(value_json) }}"
    device_class: 'power'
    scan_interval: 91
    command_timeout: 16

  - platform: command_line
    unique_id: xcel_meter_consumption
    name: "Xcel Meter Consumption"
    command: "OPENSSL_CONF=/config/xcelcerts/openssl.conf /usr/bin/curl --ciphers ECDHE-ECDSA-AES128-CCM8 --insecure --url https://<ip address>:8081/upt/1/mr/3/r --cert /config/xcelcerts/cert.pem --key /config/xcelcerts/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: 91
    command_timeout: 16

Now how do I make this show up as the “grid” in the energy panel?

1 Like

For what it’s worth, I got my Launchpad enrollment email on 2/21 and I have never had the edit button work on any browser I’ve tried. I’m out of ideas at this point.

Since I moved to my current place last November, I’ve never been able to see my usage on xcel’s website, but on demand reads do work. Unsure if that’s related or not. I’ve tried calling xcel and their responses range from confusion to accusing me of doing something dangerous/illegal/not allowed by trying to connect my meter to wifi.

@whit, do you have an add device button?

I do have an add device button which takes me to this add device page but I haven’t tried to actually add a device yet.

Even if I’m able to add a device, it wouldn’t be useful because I still can’t get my meter connected to my wifi. No matter what I try, I can’t click this edit button to add my network information.

That is a bummer. This has to be the weirdest way to setup wifi I have ever done. I am lucky I just went on a big journey with my router to make a new setup, or I would have lost my mind.

It’s weird that it says “ready to go” too. I remember mine having an error there, until it said it was connected.

I don’t want to mess around with my setup. It just started working for me. Otherwise, I would take more screenshots of what I did.

Have you tried in a different browser? I think I used firefox. But Chrome or edge might work better.

I’ve learned a few things. I might have cracked this, but I have to wait 2 hours.

  1. You can choose what sensors end up in your energy panel by going to settings->dashboards->energy and clicking on Add Consumption in the Grid Consumption area on the left.

screenshot-2023-04-26-1682539045

  1. When I did that with my command line sensor, it doesn’t show up. There is a not-very-helpful help message that says this:

Which links to here: Expected data source not listed - Home Assistant

Interestingly, the command line sensor also doesn’t show up in developer tools->statistics.

  1. I have device_class: energy, state_class: total (I tried total_increasing too), and unit_of_measurement: "kWh". These don’t show up in the developer tools->states:

  1. My guess is that has something to do with the command line sensor. In fact, in the template sensor description, it says:

Templating is a powerful feature that allows you to control information going into and out of the system. It is used for:

  1. So that is what I did. I added a template sensor that just copies the sensor from the command line version and adds the correct statistics:
template:
  - sensor:
      - name: Grid Energy
        unique_id: template_grid_energy
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total
        state: >
          {{ states('sensor.xcel_meter_consumption') | float }}

This new sensor (sensor.grid_energy) shows up in the statistics, and in the list in the Settings->Dashboards->Energy->Add Consumption menu. :tada:.

  1. Update: This solution, to add the classes to the sensor worked for me as well:
    Xcel Energy ITron Gen 5 Riva - #186 by mcblok

And, I have spent long enough typing this out, that the result is in the energy dashboard!

Alright. Now I just need to sit back and watch my data. I am already enjoying seeing things like my oven’s energy use, and the furnace’s and the “background” levels. They are all higher than I expected.

Thanks for everyone who poked and prodded at this to get a solution. Let’s see how long it lasts before the API breaks :smiley:

2 Likes

Yeah I think I’ve tried every browser known to man at this point, and the xcel app.

My smart meter usage doesn’t even show up on my Xcel account, so I think there’s a bigger Xcel issue with my account that’s leading to this problem.

1 Like

You can do this without creating another sensor. Just add the following in configuration.yaml:

homeassistant:
  customize:
    sensor.smart_meter_consumption:
      device_class: energy
      state_class: total_increasing
1 Like

Did anyone else lose their command line sensor in the latest HA update (2023.5.0)? It no longer writes data, but I still get a positive connection in the terminal using the curl command.

Edit: FIXED. See post 188. Had a bad path for the openssl.config that didn’t catch up with me until the latest upgrade.

1 Like