core: Comed API Integration stopped working

The problem

I am getting an SSL error message in the log and the API is no longer updating the Comed price sensors.

What version of Home Assistant Core has the issue?

2022.6.7

What was the last working version of Home Assistant Core?

2022.6.7

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ComEd Hourly Pricing

Link to integration documentation on our website

https://www.home-assistant.io/integrations/comed_hourly_pricing/

Diagnostics information

No response

Example YAML snippet

sensor:
  - platform: comed_hourly_pricing
    monitored_feeds:
      - type: five_minute
      - type: current_hour_average

Anything in the logs that might be useful for us?

Logger: homeassistant.components.comed_hourly_pricing.sensor
Source: components/comed_hourly_pricing/sensor.py:128
Integration: comed_hourly_pricing (documentation, issues)
First occurred: 9:40:23 PM (4 occurrences)
Last logged: 9:45:23 PM

Could not get data from ComEd API: Cannot connect to host hourlypricing.comed.com:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')]

Additional information

This was working one minute then the next it stopped updating. I can also go directly to the URL in a browser and I get data back.

You can go to this URL: https://hourlypricing.comed.com/api?type=5minutefeed

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 18 (6 by maintainers)

Most upvoted comments

I also filed complaints with the Illinois Commerce Commission and Citizens Utility Board and gave them the info from their certificate provider about how to fix the problem. The complaints will help this issue get more prompt attention. This isn’t the first time Comed has done this, if I recall correctly.

On Tue, Jul 5, 2022 at 2:27 PM Keith Burzinski @.***> wrote:

ooooo finally a response from ComEd via twitter…fingers crossed…[image: image] https://user-images.githubusercontent.com/21233191/177401242-3a6309b8-19af-4f88-84da-8954dfc719e3.jpeg

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/74320#issuecomment-1175418946, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRYQTGMMGG5VI7XZ3QKVLVSSEDVANCNFSM52OLGQCQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

I made a pull request to fix this by using less strict certificate testing.

While we’re waiting for an official fix, I’ve created the below rest sensors (utilizing verify_ssl=false) to pull in this data. 2 sensors for 5 min price, 2 for hourly average. Of these 4 sensors, 2 are the raw numbers and the other 2 include offsets just like the ComEd integration (in my case, the offset is 8.5 c). I have a lot of automations based on this integration so needed to find a short term fix - appears to be working fine so far. Hope this helps!

  # Original ComEd Integration
  - platform: comed_hourly_pricing
    monitored_feeds:
      - type: five_minute
        offset: 0.0
      - type: current_hour_average
        offset: 0.0
      - type: five_minute
        offset: 8.5
        name: "ComEd Total 5 Minute Price"
      - type: current_hour_average
        offset: 8.5
        name: "ComEd Total Current Hour Average Price"

  # Rest sensors mimicking the above integration
  - platform: rest
    resource: https://hourlypricing.comed.com/api?type=5minutefeed
    name: comed_5_minute_price
    value_template: "{{ float(value_json[0].price) }}"
    verify_ssl: false
    unit_of_measurement: c
    state_class: measurement

  - platform: rest
    resource: https://hourlypricing.comed.com/api?type=currenthouraverage
    name: comed_current_hour_average_price
    value_template: "{{ float(value_json[0].price) }}"
    verify_ssl: false
    unit_of_measurement: c
    state_class: measurement

  - platform: rest
    resource: https://hourlypricing.comed.com/api?type=5minutefeed
    name: "ComEd Total 5 Minute Price"
    value_template: "{{ float(value_json[0].price) + 8.5}}" # includes offset
    verify_ssl: false
    unit_of_measurement: c
    state_class: measurement

  - platform: rest
    resource: https://hourlypricing.comed.com/api?type=currenthouraverage
    name: "ComEd Total Current Hour Average Price"
    value_template: "{{ float(value_json[0].price) + 8.5}}" # includes offset
    verify_ssl: false
    unit_of_measurement: c
    state_class: measurement

I’ve reached out to ComEd about this issue (via email and on twitter) as it’s something they really need to fix on their site. Sure, we could do a workaround by not strictly checking the certificate but this reduces security to some extent and really isn’t the correct/proper fix. Their site/TLS endpoint should really provide the full certificate chain.

ooooo finally a response from ComEd via twitter…fingers crossed…image