Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix opentherm_gw climate TypeError in current_temperature if no temperature is known. #22112

Merged

Conversation

mvn23
Copy link
Contributor

@mvn23 mvn23 commented Mar 16, 2019

Description:

Fix TypeError in the opentherm_gw climate platform in case the library doesn't report a temperature value. Initialize _current_temperature and _target_temperature to None instead of 0.0.

Related issue (if applicable): fixes #21695

Pull request in home-assistant.io with documentation (if applicable): N/A

Example entry for configuration.yaml (if applicable):

N/A

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

  • N/A

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • N/A

Don't set opentherm_gw climate temperatures to 0 on init.
@ghost ghost added the in progress label Mar 16, 2019
@mvn23 mvn23 changed the title Fix opentherm_gw TypeError in current_temperature if no temperature is known. Fix opentherm_gw climate TypeError in current_temperature if no temperature is known. Mar 16, 2019
@Danielhiversen Danielhiversen merged commit 4423572 into home-assistant:dev Mar 16, 2019
@ghost ghost removed the in progress label Mar 16, 2019
@mvn23 mvn23 deleted the opentherm_gw_climate_temperature_fix branch March 16, 2019 15:37
This was referenced Mar 23, 2019
@balloob balloob added this to the 0.90.2 milestone Mar 26, 2019
balloob pushed a commit that referenced this pull request Mar 26, 2019
)

Don't set opentherm_gw climate temperatures to 0 on init.
@gnkarn
Copy link

gnkarn commented Mar 28, 2019

this may be the same case with other sensors too (?), for example i receive this message :

Invalid state ( > 263): [<class 'decimal.ConversionSyntax'>]
10:07 components/utility_meter/sensor.py (WARNING) - message first occured at 10:07 and shows up 2 times

when this sensor fails to report its meassure ,


utility_meter:
  daily_energy:
    source: sensor.home_energy_sensor_aparent
    cycle: daily 
  monthly_energy:
    source: sensor.home_energy_sensor_aparent
    cycle: monthly

and the sensor itself is

- platform: mqtt
  name: "Home Energy sensor_aparent"
  state_topic: "ESPURNA_energy/data"
  value_template: "{{ value_json.apparent }}"
  unit_of_measurement: "W"

  qos: 1
- platform: mqtt
  name: "Home Energy sensor_energy"
  state_topic: "ESPURNA_energy/data"
  value_template: "{{ value_json.energy }} "
  unit_of_measurement: "J"
  qos: 1
- platform: mqtt
  name: "Home Energy sensor_rssi"
  state_topic: "ESPURNA_energy/data"
  value_template: "{{ (value_json.rssi) | round(1) }} "
  unit_of_measurement: "db"
  qos: 1
  

  
- platform: template
  sensors:
    home_energy_kwh:
      unit_of_measurement: 'Kwh'
      value_template: >-
              {{ (states('sensor.home_energy_sensor_energy') | float / 3600000) | round(3) }}
- platform: template
  sensors:
    home_energy_cost:
      friendly_name: "Home Energy cost"
      entity_id: sensor.home_energy_kwh
      unit_of_measurement: "$"
      value_template: >-
        {{ states('sensor.home_energy_kwh')  | multiply(6) | round(2) }}              

@MartinHjelmare
Copy link
Member

Please open an issue if you suspect a bug. If you need help please use our help channels:
https://home-assistant.io/help/#communication-channels

Merged PRs should not be used for support or bug reports. Thanks!

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Mar 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError in Opentherm Gateway component
6 participants