GithubHelp home page GithubHelp logo

limych / ha-temperature-feels-like Goto Github PK

View Code? Open in Web Editor NEW
78.0 78.0 10.0 990 KB

Sensor of Temperature Feels Like for Home Assistant.

License: Other

Shell 35.67% Python 61.31% Dockerfile 0.57% Makefile 2.45%
home-assistant-climate home-assistant-component home-assistant-sensor home-assistant-temperature home-assistant-weather

ha-temperature-feels-like's People

Contributors

antonverburg avatar aulos avatar ctso avatar dependabot[bot] avatar eifinger avatar eseglem avatar github-actions[bot] avatar gregorymartin avatar iantrich avatar jcgoette avatar jdrozdnovak avatar limych avatar linushoppe avatar ludeeus avatar matthewflamm avatar mattrayner avatar misa1515 avatar mjmeli avatar myztillx avatar oncleben31 avatar raman325 avatar rianoc avatar rodpayne avatar rroller avatar salem84 avatar scottg489 avatar swartjean avatar tefinger avatar tetienne avatar vlebourl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ha-temperature-feels-like's Issues

Sensor reports "unknown" value

Hello,

I'm hoping someone can help me fix an issue I'm having with Temperature Feels Like. I feel like I'm missing something simple...

I have installed Temperature Feels Like v0.3.7 via HACS.
I have added the following to my configuration.yaml:

sensor:
  - platform: temperature_feels_like
    name: "Office temperature feels like"
    source:
      - sensor.office_temperature_sensor_temperature
      - sensor.office_temperature_sensor_humidity

The sensor then only reports "Unknown".
image

There are two entries in the logs related to Temperature Feels Like:

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/temperature_feels_like/sensor.py:182
Integration: temperature_feels_like (documentation, issues)
First occurred: 19:03:41 (1 occurrences)
Last logged: 19:03:41

Error doing job: Exception in callback TemperatureFeelingSensor.async_added_to_hass.<locals>.sensor_startup(<Event homeassistant_start[L]>) at /config/custom_components/temperature_feels_like/sensor.py:176
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/core.py", line 1114, in _onetime_listener
    self._hass.async_run_job(listener, event)
  File "/usr/src/homeassistant/homeassistant/core.py", line 641, in async_run_job
    return self.async_run_hass_job(HassJob(target), *args)
  File "/usr/src/homeassistant/homeassistant/core.py", line 593, in async_run_hass_job
    hassjob.target(*args)
  File "/config/custom_components/temperature_feels_like/sensor.py", line 182, in sensor_startup
    domain = split_entity_id(state.entity_id)[0]
AttributeError: 'NoneType' object has no attribute 'entity_id'
Logger: homeassistant.helpers.entity
Source: util/unit_conversion.py:379
First occurred: 19:03:41 (1 occurrences)
Last logged: 19:03:41

Update for sensor.office_temperature_feels_like fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 550, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 755, in async_device_update
    raise exc
  File "/config/custom_components/temperature_feels_like/sensor.py", line 318, in async_update
    self._temp_val = temp = self._get_temperature(self._temp)  # °C
  File "/config/custom_components/temperature_feels_like/sensor.py", line 258, in _get_temperature
    temperature = TemperatureConverter.convert(
  File "/usr/src/homeassistant/homeassistant/util/unit_conversion.py", line 379, in convert
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: % is not a recognized temperature unit.

Any pointers would be greatly appreciated.

Feels Like sensor updates multiple times when input sensors are updated at the same time

Is your feature request related to a problem? Please describe.

Yes. My temperature and humidity sensors update at the same time, but the calculation for the Feels Like Temperature happens twice, back-to-back. This causes strange spikes in the history where there are two values for the same point in time (one value is calculated with the current temperature and old humidity, the other is with current values for both)

Describe the solution you'd like

I'm not sure what the best solution is. Options are:

  • add an optional 1-second delay before calculating, and ignore any changes during that time (i.e. temp updates, triggering the calculation; humidity updates during the delay but does not trigger an additional calculation; sensor updates with 1-second-old temp and humidity values)
  • allow users to specify sensors to use as triggers. For example in my case I could have it only update the Feels Like Temperature when the humidity sensor is updated (but not necessarily changed).
  • allow users to specify a minimum age for sensor data. When triggered, check that all input sensors have been updated within that time frame, or don't update the Feels Like Temperature (or mark it unavailable)

Describe alternatives you've considered

I have not been able to find an alternative that resolves this issue.

Additional context

I have automations that trigger on a comparison of two Feels Like Temperature sensors, and it is triggered twice as often as it needs to be, with bad data for the first of each trigger. I can set it to restart mode but it still feels like there should be a solution to the sensors getting updated with old data half the time.

Calculation error if wind value is not available

Describe the bug
I'm using a weather entity to calculate the feels like temperature, but sometimes the Wind bearing is empty. In these cases, the calculation fails and I get "Unknown" result.

Is it possible to validate the wind availability? If Wind is present, compute as expected, otherwise compute with Temperature and Humidity only.

Configuration.yaml

  - platform: temperature_feels_like
    name: "Home Feels Like Temperature"
    source: 
      - weather.home

Debug log

Source: custom_components/temperature_feels_like/sensor.py:314
Integration: temperature_feels_like (documentation, issues)
First occurred: 18:16:01 (2 occurrences)
Last logged: 18:16:01
Can't calculate sensor value: some sources are unavailable.

More documentation on "source"

Could you provide some examples of what "source" could look like if someone would want to use a few 'sensor's?

I intend to use a single outside sensor for humidity and then calculate a bedroom "feel like temp" in our house based on a sensor in the room (in celcius). My current config:

sensor:
  - platform: temperature_feels_like
    name: "Alex Room Feels Like Temp"
    source:
      - sensor.outside_humidity
      - sensor.alex_room_heater_ds18b20_temperature

This current config results in the sensor showing "unknown" in Developer Tools.

The output of in Developer Tools of the two "source" sensors are:

sensor.alex_heater_ds18b20_temperature | 22.6 | unit_of_measurement: °C friendly_name: Alex Heater DS18B20 Temperature device_class: temperature

and:

sensor.outside_humidity | 43 | friendly_name: outside_humidity

Compability with the next ha version

I tried the current beta for 2022.06 and there's an import error blocking this plugin:

2022-05-29 11:54:11 ERROR (MainThread) [homeassistant.config] Platform error: sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 877, in async_process_component_config
platform = p_integration.get_platform(domain)
File "/usr/src/homeassistant/homeassistant/loader.py", line 618, in get_platform
cache[full_name] = self._import_platform(platform_name)
File "/usr/src/homeassistant/homeassistant/loader.py", line 635, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/config/custom_components/temperature_feels_like/sensor.py", line 13, in <module>
from homeassistant.components.history import LazyState
ImportError: cannot import name 'LazyState' from 'homeassistant.components.history' (/usr/src/homeassistant/homeassistant/components/history/__init__.py)

Can't use `Independent Temperature and Humidity Entities`

Hi!

can not read a block mapping entry; a multiline key may not be an implicit key at line 34, column 11:
        source:
              ^
sensor:
  - platform: temperature_feels_like
    name: 'Room temperature feels like'
    source:
      - sensor.ble_temperature_climate_sensor
      - sensor.ble_humidity_climate_sensor

The Temperature Feels Like sensor does not have long term statistics

Environment

  • Home Assistant Core release with the issue: 2023.7.3 and earlier versions
  • This custom component release with the issue: 0.3.7
  • Last working this custom component release (if known):
  • Operating environment (Home Assistant/Supervisor/Docker/venv): VM

Describe the bug
Cannot add a graph tith the sensor's reading to dushboard. The sensor does not show up in the "Statistics Graph Card Configuration" card configuration. According to the information in the card long term statistics are missing.

I can add the sensor to the Gauge graph.

Configuration.yaml

sensor:
  - platform: temperature_feels_like
    source:
      - sensor.tze200_9yapgbuv_ts0601_temperature
      - sensor.tze200_9yapgbuv_ts0601_humidity

Steps to Reproduce
Go to "Edit Dashboard" and try adding Statistics Graph card with the sensor.

Expected behavior
The sensors shows up in sensors list of the Statistics Graph card.

Debug log


Add your logs here.

Additional context

Bug: Incompatibility with Home Assistant 2024.1.2 - Disrespects Unit Preference Imperial/Metric

Note: This is not a feature request - bug template not available.

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

After updating to HA 2024.1.2, this plugin no longer seems to respect the unit set in home assistant. Worked perfectly fine before in two circumstances:

  1. Indoor - internal temperature with internal humidity sensor
  2. Outdoor - using weather forecast

configuration.yml

  - platform: temperature_feels_like
    source: weather.forecast_home

  - platform: temperature_feels_like
    name: "Bedroom Feels Like Temperature"
    source:
      - sensor.everything_presence_one_7e9e1c_temperature
      - sensor.everything_presence_one_7e9e1c_humidity

Indoor:
image

Outdoor (Apparently, everyone outdoors is being boiled alive):
image

Entity States:
image

System Settings:
image

Home Assistant Versions:
image

Describe the solution you'd like

I would like this to respect the selection of the unit as it did previously

Describe alternatives you've considered

Attempted to reset and set my unit preference without success
Tried installing/reinstalling without success

Additional context

None

breaking stuf soon

Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2022.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for temperature_feels_like using this method at custom_components/temperature_feels_like/sensor.py, line 247: temperature = convert_temperature(
Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2022.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for temperature_feels_like using this method at custom_components/temperature_feels_like/sensor.py, line 329: convert_temperature(feeling, TEMP_CELSIUS, self.unit_of_measurement), 1

convert_temperature issue/error

Environment

  • Home Assistant Core release with the issue: 2022.11.1
  • This custom component release with the issue:
  • Last working this custom component release (if known):
  • Operating environment (Home Assistant/Supervisor/Docker/venv): HAOS in ProxMox

Describe the bug

Configuration.yaml

Add your configs here if any.

Steps to Reproduce

Expected behavior

Debug log

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:77
First occurred: 4:49:47 PM (3 occurrences)
Last logged: 4:49:47 PM

Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2023.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for temperature_feels_like using this method at custom_components/temperature_feels_like/sensor.py, line 247: temperature = convert_temperature(
Detected integration that accesses the `is_metric` property of the unit system. This is deprecated and will stop working in Home Assistant 2023.1. Please adjust to use instance check instead.. Please report issue to the custom integration author for temperature_feels_like using this method at custom_components/temperature_feels_like/sensor.py, line 290: if self.hass.config.units.is_metric
Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2023.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for temperature_feels_like using this method at custom_components/temperature_feels_like/sensor.py, line 329: convert_temperature(feeling, TEMP_CELSIUS, self.unit_of_measurement), 1

Additional context

Multiple Definitions

Is your feature request related to a problem? Please describe.

I want to control HVAC in my home according to feels like temperature. I have multiple thermostats and I was wondering if more than one feels like temperature can be used. When I try to only the last stays, even if I define different unique ids.

Describe the solution you'd like

Ability to have more than one feels like sensor.

Describe alternatives you've considered

Additional context

temperature utility

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:77
First occurred: 08:12:29 (2 occurrences)
Last logged: 08:12:29

Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2022.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for temperature_feels_like using this method at custom_components/temperature_feels_like/sensor.py, line 247: temperature = convert_temperature(
Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2022.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for temperature_feels_like using this method at custom_components/temperature_feels_like/sensor.py, line 329: convert_temperature(feeling, TEMP_CELSIUS, self.unit_of_measurement), 1

is_metric

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:77
First occurred: 08:38:01 (1 occurrences)
Last logged: 08:38:01

Detected integration that accesses the is_metric property of the unit system. This is deprecated and will stop working in Home Assistant 2023.1. Please adjust to use instance check instead.. Please report issue to the custom integration author for temperature_feels_like using this method at custom_components/temperature_feels_like/sensor.py, line 290: if self.hass.config.units.is_metric

add support for self defined temperature and humidity sources

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Inside, I have a template that calculates the "feels-like" from each temperature and humidity sensor on a per room basis, and also takes the average across all rooms.
I'm wondering if you could add the ability to use your own temperature and humidity sensor(s) (obviously the wind factor is removed)

Describe alternatives you've considered

Additional context

Error due Sensor Startup

HA 2021.5.4

2021-05-15 08:21:06 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback EventBus.async_listen_once.._onetime_listener(<Event homeassistant_start[L]>) at /usr/src/homeassistant/homeassistant/core.py:809
Traceback (most recent call last):
File "/usr/local/lib/python3.8/asyncio/events.py", line 81, in _run
self._context.run(self._callback, *self._args)
File "/usr/src/homeassistant/homeassistant/core.py", line 823, in _onetime_listener
self._hass.async_run_job(listener, event)
File "/usr/src/homeassistant/homeassistant/core.py", line 443, in async_run_job
return self.async_run_hass_job(HassJob(target), *args)
File "/usr/src/homeassistant/homeassistant/core.py", line 424, in async_run_hass_job
hassjob.target(*args)
File "/config/custom_components/temperature_feels_like/sensor.py", line 146, in sensor_startup
self._name = state.attributes["friendly_name"]
KeyError: 'friendly_name'

Configuration.yaml

  • platform: temperature_feels_like
    source: weather.dwd_weather_bad_liebenzell

Deprecation Home Assistant 2024.5

Version of the custom_component

0.3.9

Version of Home Assistant

2024.5.0b0

Describe the bug

Logger: homeassistant.helpers.frame
Source: helpers/frame.py:190
First occurred: 22:12:52 (5 occurrences)
Last logged: 22:15:23

Detected that custom integration 'temperature_feels_like' calls `async_track_state_change` instead of `async_track_state_change_event` which is deprecated and will be removed in Home Assistant 2025.5 at custom_components/temperature_feels_like/sensor.py, line 200: async_track_state_change(self.hass, list(entities), sensor_state_listener), please create a bug report at https://github.com/Limych/ha-temperature-feeling/issues

temperature utility deprecated since 2022.10

temperature_feels_like 0.3.5
Home Assistant 2023.1.4
Supervisor 2022.12.1
Operating System 9.4
Frontend 20230110.0 - latest

2023-01-13 16:27:01.162 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2023.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for temperature_feels_like using this method at custom_components/temperature_feels_like/sensor.py, line 247: temperature = convert_temperature(

2023-01-13 16:27:01.164 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2023.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for temperature_feels_like using this method at custom_components/temperature_feels_like/sensor.py, line 329: convert_temperature(feeling, TEMP_CELSIUS, self.unit_of_measurement), 1

Formulae for calculation?

Is it possible to document how the "feels like" temperature is calculated and also how you get to this particular formulae?

HA 2024.1.0 deprecations

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Updated to HA version 2024.1.0b0 and saw the following warning.

Describe the solution you'd like

Fix the deprecation.

Describe alternatives you've considered

n/a

Additional context

2023-12-28 19:23:27.782 WARNING (MainThread) [homeassistant.const] DEVICE_CLASS_HUMIDITY was used from temperature_feels_like, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.HUMIDITY instead, please create a bug report at https://github.com/Limych/ha-temperature-feeling/issues
2023-12-28 19:23:27.788 WARNING (MainThread) [homeassistant.const] DEVICE_CLASS_TEMPERATURE was used from temperature_feels_like, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorDeviceClass.TEMPERATURE instead, please create a bug report at https://github.com/Limych/ha-temperature-feeling/issues

PS: there is only this template for feature requests, not for a bug report.

'temperature_feels_like' calls `async_track_state_change`

System Health details

...

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of any previous issues..

Describe the issue

Detected that custom integration 'temperature_feels_like' calls async_track_state_change instead of async_track_state_change_event which is deprecated and will be removed in Home Assistant 2025.5 at custom_components/temperature_feels_like/sensor.py, line 200: async_track_state_change(self.hass, list(entities), sensor_state_listener), please create a bug report at https://github.com/Limych/ha-temperature-feeling/issues

Reproduction steps

  1. restarted home assistant

...

Debug logs

.

Diagnostics dump

.

Generate unique ID to enable UI editing

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.