GithubHelp home page GithubHelp logo

homeassistant-generic-hygrostat's People

Contributors

basschipper avatar bruvv avatar disforw avatar fuzzymistborn avatar knodd avatar mullerla avatar nicole-ashley avatar nixon506e 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homeassistant-generic-hygrostat's Issues

Can u remove this warning please

Hello

For all intents and purposes your integration work great for me, thank you!

The only issue that I encounter with it is in the log of home assistant after every home assistant restart.

2023-03-07 10:13:38.683 WARNING (MainThread) [custom_components.generic_hygrostat.binary_sensor] Unable to update humidity from sensor 'sensor.bathroom_humidity' with value 'unavailable'

Note that sensor.bathroom_humidity is a group sensor that has 2 zigbee sensors in it (median value)

Not working and getting an error

So I'm getting this error in the log:

This error originated from a custom integration.

Logger: custom_components.generic_hygrostat.binary_sensor
Source: custom_components/generic_hygrostat/binary_sensor.py:120
Integration: generic_hygrostat (documentation)
First occurred: 11:26:22 AM (1 occurrences)
Last logged: 11:26:22 AM

Unknown humidity sensor 'sensor.bathroom_climate_humidity'

I installed via HACS and put the follwing in my config.yaml

binary_sensor:
- platform: generic_hygrostat
  name: Bathroom Hygrostat
  sensor: sensor.bathroom_climate_humidity # Source humidity sensor
  delta_trigger: 3 # Optional humidity swing to detect. Default = 3
  target_offset: 3 # Optional dehumidification target offset. Default = 3
  min_on_time: 300 # Optional min on time in seconds. Default = 0 seconds
  max_on_time: 2700 # Optional safety max on time in seconds. Default = 7200 seconds
  sample_interval: 300 # Optional time between taking humidity samples in seconds, default 300 seconds
  min_humidity: 30 # Optional minimum humidity to enable dehumidification. Default = 0

We ran the shower today and humidity went way up and it never triggered. On my UI I have the "bathroom hygrostat" on a card and it stayed off the whole time. even when the humidity spiked from 50 (standard) to 80 (during shower)

Any ideas?

'version' key in the manifest file will not be allowed in a future version of HA

I saw this message in my logs today. I'm on HA version 2021.3.3. I am using the latest Generic Hydrostat available in HACS

Logger: homeassistant.loader
Source: loader.py:802
First occurred: 8:08:19 PM (1 occurrences)
Last logged: 8:08:19 PM

No 'version' key in the manifest file for custom integration 'generic_hygrostat'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'generic_hygrostat'

Possibly related to #20

Dashboard UI

Is it possible to use this with the official Humidifier card?

long time to "kick in"

Hi

I use Xiaomi Bluetooth sensors with ESP32 as BLE tracker so i get humidity update in irregular intervals, sometimes few times in minute, sometimes once in few minutes.
That obviously inserts some delay, but the actual delay, from humidity to rise to component recognizing is few minutes more.
Not sure why ?
Xiaomi sensor will report rise, but component will show older values in their log.
After few more sensor updates will component insert new value into its data and start FAN.

Is there a way to fix this ?
How often does component take new value from HA ? Can it be shorter ?

When i have just plain automation with FAN starting when humidity goes above 50% it is much faster. It starts a moment sensors sent value.
This component is smarter and i would like to use it, but need to find out where delay comes from.

Thanks

Ignore negative delta

Components works great; totally happy with it.

However, I noticed the component would also trigger when a sudden drop (negative spike) was detected (open door during a dry winter afternoon)

Is it possible to ignore negative delta's? Or have a switch to ignore those values?

Home Assistant Log Error

Noticed this is the startup log today...

No 'version' key in the manifest file for custom integration 'generic_hygrostat'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'generic_hygrostat'

Unknown sensor

Hi,
Just installed the hygrostat using my Multisensor 6 from AEOTEC (z-wave), and the following error shows up:

Logger: custom_components.generic_hygrostat.binary_sensor
Source: custom_components/generic_hygrostat/binary_sensor.py:85
Integration: generic_hygrostat (documentation)
First occurred: 17.08.03 (1 occurrences)
Last logged: 17.08.03
Unknown humidity sensor 'sensor.bathroom_sensor_humidity'

My config is:

  • platform: generic_hygrostat
    name: Bathroom Hygrostat
    sensor: sensor.bathroom_sensor_humidity
    #attribute: # Optional use sensor attribute instead of state.
    delta_trigger: 3 # Optional humidity swing to detect. Default = 3
    target_offset: 3 # Optional dehumidification target offset. Default = 3
    min_on_time: 300 # Optional min on time in seconds. Default = 0 seconds
    max_on_time: 7200 # Optional safety max on time in seconds. Default = 7200 seconds
    sample_interval: 300 # Optional time between taking humidity samples in seconds, default 300 seconds
    min_humidity: 30 # Optional minimum humidity to enable dehumidification. Default = 0
    unique_id: bathroom_hygrostat

(this is in my configuration.yaml)

Unknown humidity sensor error

Hi, I had to switch from my previous humidity sensor, generated by a DHT22 connected via MQTT that failed with a new sensor, that is a spare indoor RF sensor I had form my weather station (ecowitt compatible, it's connected to HA with a custom component).
It seems to me that the hygrostat ceased to work and I get this error in the log:

Questo errore ha avuto origine da un'integrazione personalizzata.

Logger: custom_components.generic_hygrostat.binary_sensor
Source: custom_components/generic_hygrostat/binary_sensor.py:85
Integration: generic_hygrostat (documentation)
First occurred: 15:42:28 (1 occurrences)
Last logged: 15:42:28

Unknown humidity sensor 'sensor.indoor_humidity'

but the sensor exitsts and it's sending data, and it looks like this:

state_class: measurement
unit_of_measurement: '%'
device_class: humidity
icon: mdi:water-percent
friendly_name: Indoor Humidity

The previous sensor looked like this:

unit_of_measurement: '%'
icon: mdi:water-percent
friendly_name: sonda_bagno_P1_HR

Paradoxically the old sensor did not have a proper device_class, but worked flawlessly.

Do I have to generate a dummy sensor without the device_class?

turning on at night - how to optimize?

image

as you can see on the picture (last on), the fan (hygrostat) turns on when humidity extremely rises suddenly and is on for 10-20minutes.

but sometimes at night it got triggered even if the humidity rises very slowly and then runs for the 2h hours (maximum rumtime as i understand from settings).

what do i have to fine-tweak to stop that wrong triggering?

Error doing job: Exception in callback async_track_point_in_utc_time.<locals>.run_action(<Job HassJobT...ffff764fcd30>>) at /usr/src/homeassistant/homeassistant/helpers/event.py:129

Running the HACS addon gives the following error on HA 2022.9.7:

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/generic_hygrostat/binary_sensor.py:188
Integration: generic_hygrostat (documentation)
First occurred: 13:39:32 (1 occurrences)
Last logged: 13:39:32

Error doing job: Exception in callback async_track_point_in_utc_time.<locals>.run_action(<Job HassJobT...ffff764fcd30>>) at /usr/src/homeassistant/homeassistant/helpers/event.py:1297
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/helpers/event.py", line 1312, in run_action
    hass.async_run_hass_job(job, utc_point_in_time)
  File "/usr/src/homeassistant/homeassistant/core.py", line 567, in async_run_hass_job
    hassjob.target(*args)
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1373, in interval_listener
    hass.async_run_hass_job(job, now)
  File "/usr/src/homeassistant/homeassistant/core.py", line 567, in async_run_hass_job
    hassjob.target(*args)
  File "/config/custom_components/generic_hygrostat/binary_sensor.py", line 148, in _async_update
    self.update_humidity()
  File "/config/custom_components/generic_hygrostat/binary_sensor.py", line 188, in update_humidity
    self.sensor_humidity = float(sensor.attributes[self.sensor_attribute])
KeyError: 'humidity'

Not working in 2023.6

Hi,

This integration isn't working with 2023.6. My guess it's connected to the step up to Python 3.11.. See error below.

Unexpected exception importing platform custom_components.generic_hygrostat.binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/generic_hygrostat/binary_sensor.py", line 69, in <module>
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'

kind regards
Tyk0s

Don't see target value

Hi Bas,
I have add the Bathroom Hygrostat code to my config and the samples appear but target and max on timer won't show up.
Can you help me with it?
afbeelding

Integration no longer functioning.

Hi,

I have noticed that the hygrostat entities are no longer updating in 2023.6.3 and I have the following error in the home-assistant.log

2023-06-27 10:43:43.139 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback async_track_point_in_utc_time.<locals>.run_action(<Job track ti...1457b7711080>>) at /usr/src/homeassistant/homeassistant/helpers/event.py:1348
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1363, in run_action
    hass.async_run_hass_job(job, utc_point_in_time)
  File "/usr/src/homeassistant/homeassistant/core.py", line 618, in async_run_hass_job
    hassjob.target(*args)
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1452, in interval_listener
    hass.async_run_hass_job(job, now)
  File "/usr/src/homeassistant/homeassistant/core.py", line 618, in async_run_hass_job
    hassjob.target(*args)
  File "/config/custom_components/generic_hygrostat/binary_sensor.py", line 147, in _async_update
    self.update_humidity()
  File "/config/custom_components/generic_hygrostat/binary_sensor.py", line 187, in update_humidity
    self.sensor_humidity = float(sensor.attributes[self.sensor_attribute])
                                 ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'humidity'

I have tried redownloading from HACS and get the same error. I this something that is unique to my installation or are other people having the same issue?

Unknown humidity sensor

I'm getting the following error: 2019-11-12 13:24:56 WARNING (MainThread) [custom_components.generic_hygrostat.binary_sensor] Unknown humidity sensor 'sensor.bathroom_humidity

Configuration of my sensor is as follows (from a Sonoff Tasmota device):

- platform: mqtt
    name: "Bathroom humidity"
    state_topic: home/tele/bathroom/SENSOR
    value_template: "{{ float(value_json.SI7021.Humidity) }}"
    unit_of_measurement: "%"
    device_class: humidity

Entity no longer provided by integration

Hi,
Since May 27 my two generic hygrostat definitions has not been available from the integration (v.0.7.1).
I have tried to restart HA but with no result. There are no errors when I check configuration, and no errors in the mail log file.
Running Home Assistant 2023.5.4, Supervisor 2023.04.1, Operating System 10.1, UI 20230503.3
Has something changed?

Exception Error.

Error that comes when using the integration. My humidity sensor is has no attribute value of humidity. The humidity value is in the state. Is this the problem?
Capture

Logger: homeassistant
Source: custom_components/generic_hygrostat/binary_sensor.py:188
Integration: generic_hygrostat (documentation)
First occurred: 15:32:38 (1 occurrences)
Last logged: 15:32:38

Error doing job: Exception in callback async_track_point_in_utc_time..run_action(>) at /usr/src/homeassistant/homeassistant/helpers/event.py:1305
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/helpers/event.py", line 1320, in run_action
hass.async_run_hass_job(job, utc_point_in_time)
File "/usr/src/homeassistant/homeassistant/core.py", line 574, in async_run_hass_job
hassjob.target(*args)
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1381, in interval_listener
hass.async_run_hass_job(job, now)
File "/usr/src/homeassistant/homeassistant/core.py", line 574, in async_run_hass_job
hassjob.target(*args)
File "/config/custom_components/generic_hygrostat/binary_sensor.py", line 148, in _async_update
self.update_humidity()
File "/config/custom_components/generic_hygrostat/binary_sensor.py", line 188, in update_humidity
self.sensor_humidity = float(sensor.attributes[self.sensor_attribute])
KeyError: 'humidity'

Error when automation run

ha on docker latest 2022.10

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/generic_hygrostat/binary_sensor.py:188
Integration: generic_hygrostat (documentation)
First occurred: 29 October 2022 at 08:16:11 (449 occurrences)
Last logged: 20:36:12

Error doing job: Exception in callback async_track_point_in_utc_time.<locals>.run_action(<Job HassJobT...7fb69ce6dfc0>>) at /usr/src/homeassistant/homeassistant/helpers/event.py:1303
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/helpers/event.py", line 1318, in run_action
    hass.async_run_hass_job(job, utc_point_in_time)
  File "/usr/src/homeassistant/homeassistant/core.py", line 567, in async_run_hass_job
    hassjob.target(*args)
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 1379, in interval_listener
    hass.async_run_hass_job(job, now)
  File "/usr/src/homeassistant/homeassistant/core.py", line 567, in async_run_hass_job
    hassjob.target(*args)
  File "/config/custom_components/generic_hygrostat/binary_sensor.py", line 148, in _async_update
    self.update_humidity()
  File "/config/custom_components/generic_hygrostat/binary_sensor.py", line 188, in update_humidity
    self.sensor_humidity = float(sensor.attributes[self.sensor_attribute])
KeyError: 'humidity'

is set like this:

- platform: generic_hygrostat
  name: Bathroom Hygrostat
  sensor: sensor.bathroom_humidity # Source humidity sensor
  attribute: humidity # Optional use sensor attribute instead of state.
  delta_trigger: 3 # Optional humidity swing to detect. Default = 3
  target_offset: 3 # Optional dehumidification target offset. Default = 3
  min_on_time: 300 # Optional min on time in seconds. Default = 0 seconds
  max_on_time: 7200 # Optional safety max on time in seconds. Default = 7200 seconds
  sample_interval: 300 # Optional time between taking humidity samples in seconds, default 300 seconds
  # min_humidity: 50 # Optional minimum humidity to enable dehumidification. Default = 0
  unique_id: bathroom_hygrostat # Optional ID that uniquely identifies this sensor. Set this to a unique value to allow customization through the UI.

What am I doing wrong or what is to be corrected.

Not working and error

  • Costum component installed from HACS
  • rebooted HA
  • Pasted to Binary_sensor.yaml:
    • platform: generic_hygrostat
      name: Bathroom Hygrostat
      sensor: sensor.datchik_vlazhnosti_sanuzel # Source humidity sensor
      attribute: humidityy # Optional use sensor attribute instead of state.
      delta_trigger: 3 # Optional humidity swing to detect. Default = 3
      target_offset: 3 # Optional dehumidification target offset. Default = 3
      min_on_time: 300 # Optional min on time in seconds. Default = 0 seconds
      max_on_time: 7200 # Optional safety max on time in seconds. Default = 7200 seconds
      sample_interval: 300 # Optional time between taking humidity samples in seconds, default 300 seconds
      min_humidity: 30 # Optional minimum humidity to enable dehumidification. Default = 0
      unique_id: # Optional ID that uniquely identifies this sensor. Set this to a unique va
  • but found an error after check config: Platform error binary_sensor.generic_hygrostat - No module named 'homeassistant.components.generic_hygrostat.binary_sensor'

"Unknown humidity sensor" error and I'm... 90% sure I have the sensor right.

I hope this is actually properly a bug and not a support request. I'm not sure where to look, though. I'm getting this error:

Logger: custom_components.generic_hygrostat.binary_sensor
Source: custom_components/generic_hygrostat/binary_sensor.py:150
Integration: generic_hygrostat ([documentation](https://github.com/basschipper/homeassistant-generic-hygrostat))
First occurred: 11:54:54 AM (1 occurrences)
Last logged: 11:54:54 AM
Unknown humidity sensor 'sensor.4_in_1_sensor_humidity'

and I have this config:

  - platform: sdnotify
  - platform: generic_hygrostat
    name: Bathroom Hygrostat
    sensor: sensor.4_in_1_sensor_humidity # Source humidity sensor
    delta_trigger: 5                      # Optional humidity swing to detect. Default = 3
    target_offset: 5                      # Optional dehumidification target offset. Default = 3
    min_on_time: 120                      # Optional min on time in seconds. Default = 0 seconds
    max_on_time: 7200                     # Optional safety max on time in seconds. Default = 7200 seconds
    sample_interval: 30                   # Optional time between taking humidity samples in seconds, default 300 seconds
    min_humidity: 30                      # Optional minimum humidity to enable dehumidification. Default = 0
    unique_id: bathroom_hygrostat         # Optional ID that uniquely identifies this sensor. Set this to a unique value to allow customization through the UI.

And... sensor.4_in_1_sensor_humidity is a real thing. To make sure there's not a typo I'm missing, I copied from the config and searched in the UI, and I find a matching entity, with history and no obvious errors.

image

Any ideas what's going wrong?

Delay checking sensor on boot

Here's a nice to have / feature request:
I've got an humidity sensor in ZHA. This sensor is not available directly after booting HA. This takes a minute or so.
So every reboot, I see the following error messages in the log:

2021-12-18 15:03:55 WARNING (MainThread) [custom_components.generic_hygrostat.binary_sensor] Unable to update humidity from sensor 'sensor.bathroom_tempsensor_humidity' with value 'unavailable'

I see a log line every 20 seconds. And 7 or 8 of those lines.
Can you maybe delay checking the sensor for a minute or so after booting HA?

My humidistat does not activate

Goodnight all,

First of all, thank you for this work. I installed the package from HACS. I added the following code but it doesn't work. My source is the Netatmo add-on sensor which updates data every 5-6 min on HAOS.

#Gestion de l'humidité de la salle de bain Parentale
binary_sensor:
- platform: generic_hygrostat
  name: Bathroom Hygrostat
  sensor: sensor.station_meteo_module_additionnel_humidity 
  attribute: humidity 
  delta_trigger: 3 
  target_offset: 3 
  min_on_time: 0 
  max_on_time: 7200 
  sample_interval: 300 
  min_humidity: 0 
  unique_id: bathroom_hygrostat 
- id: 63f7571ed5eb47c18563f4ce9423cf48
  alias: Extraction air SDB ON
  trigger:
  - platform: state
    entity_id: binary_sensor.bathroom_hygrostat
    to: 'on'
  action:
  - service: switch.turn_on
    entity_id: fan.extracteur_d_air


- id: ced150b901bc452bace306ccd72f0eca
  alias: Extraction air SDB OFF
  trigger:
  - platform: state
    entity_id: binary_sensor.bathroom_hygrostat
    to: 'off'
  action:
  - service: switch.turn_off
    entity_id: fan.extracteur_d_air

Use entity attribute

Is it possible to use an entities humidity attribute to create a generic hydrostat?
For example I have a thermostat (climate entity), that includes a humidity attribute.

Custom updater section in README.md is confusing

Hi,

Looking at the README.md to see how to install this (fantastic) plugin, I discovered that the section about Custom Updater is outdated :

  • the JSON file has been deleted from the repos more than a year ago
  • Custom Updater repos indicates that it is deprecated

You should remove this section from the README.md because it is a little confusing for newbies like me ;)

Regards

Intervals in what?

As specified in the readme:

  max_on_time: 600 # Optional # Optional safety max on time
  sample_interval: 60 # Optional time between taking humidity samples, default 5 minutes

But what are these? seconds? ms? minutes?

request: reset button for the hygrostat?

I use the the hygrostat to manage the ventilation of the bathroom. Works great, thanx for the hard work!
Our bathroom is not permanently heated, our home heating is generally off at night, and at day it is kind of heated with intervals. This also switches the ventilation on because there is a difference of about 5 to 10 percent in humidity between heated an not heated. But it does not make much sense to ventilate in these situations because the air that gets pulled into the bathroom is of the same humidity, and the automation tries to reach a target that almost can't be reached, so it stays on until max_on_time is reached (and then pauses for a while and switches on again ....).
So I am looking for a way to distinguish between a rise in humidity caused by someone taking a shower and when the temperature drops when the heating swithces off.
I could set the delta_trigger to 8 or 10 (now at 3), but then it would take to long until the ventilation kicks in when someone takes a shower?

I could categorize the 2 situations by their attributes:
someone taking a shower:

  • sudden and large (>15%?) rise in humidity
  • temperature initially stays about the same

heating switches to off:

  • gradual and rather small (<10%) rise in humidity, after:
  • very gradual drop in temperature (the change in temperature precedes the change in humidity)

Or maybe it is the other way around, if I remember my physics lessons from long ago correctly: warm air is more humid than cold air?

My goal is to start the vantilation asap when someone takes a shower, but to keep it off in the 'heating switches to off' (or on?) situation, but I am to unexperienced to realize this in script or code. Maybe something with the temperature?

It already would help a lot when I could manually 'reset' the hygrostat: some kind of button to force the hygrostat to drop the target humidity, and take the current humidity as the 'normal' humidity.

Another question on the side: I am using a Xiaomi Aqara humidity sensor to measure humidity in the bathroom. I have the impression it sometimes reacts rather slow to changes in humidity? Maybe that has to do with the sample frequency or something? Can I configure the sample frequency or rate somewhere? Or should I use anther sensor ( I am limited to devices supported by zigbee2mqtt).

Stopped working abruptly, v0.5.0

Good morning. At some point yesterday, the below warning started popping up. The sensor in question is still attached and injecting data into HA. It's a Aqara sensor through deCONZ should that be relevant. I updated HA Core which rebooted Core, that's all I can think of.

core-2021.8.7
supervisor-2021.06.8
Home Assistant OS 6.2

log:

Logger: custom_components.generic_hygrostat.binary_sensor
Source: custom_components/generic_hygrostat/binary_sensor.py:120
Integration: generic_hygrostat (documentation)
First occurred: 6:57:41 AM (1 occurrences)
Last logged: 6:57:41 AM

Unknown humidity sensor 'sensor.master_bathroom_2'

configuration yaml:

binary_sensor:
- platform: generic_hygrostat
  name: Bathroom Hygrostat
  sensor: sensor.master_bathroom_2 # Source humidity sensor
  delta_trigger: 4 # Optional humidity swing to detect. Default = 3
  target_offset: 0 # Optional dehumidification target offset. Default = 3
  min_on_time: 300 # Optional min on time in seconds. Default = 0 seconds
  max_on_time: 5400 # Optional safety max on time in seconds. Default = 7200 seconds
  sample_interval: 300 # Optional time between taking humidity samples in seconds, default 300 seconds
  min_humidity: 54 # Optional minimum humidity to enable dehumidification. Default = 0

automation yaml:

- id: '1692801842292'
  alias: Master Bath Hygrostat On
  trigger:
    platform: state
    entity_id: binary_sensor.bathroom_hygrostat
    to: 'on'
  action:
  - service: switch.turn_on
    entity_id: switch.mast_bath_dehumidifier
- id: '1692801842293'
  alias: Master Bath Hygrostat Off
  trigger:
    platform: state
    entity_id: binary_sensor.bathroom_hygrostat
    to: 'off'
  action:
  - service: switch.turn_off
    entity_id: switch.mast_bath_dehumidifier

Update required

Hello,

I know this is short, I have to go to work, but wanted to let you know if possible this needs updating, is not working in Home Assistant 2023.6.0, sensor become unavailable.

Log:

2023-06-08 00:11:02.881 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform custom_components.generic_hygrostat.binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/generic_hygrostat/binary_sensor.py", line 69, in <module>
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'
2023-06-08 00:11:02.883 ERROR (MainThread) [homeassistant.config] Platform error: binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/generic_hygrostat/binary_sensor.py", line 69, in <module>
    @asyncio.coroutine
     ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 928, in async_process_component_config
    platform = p_integration.get_platform(domain)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
    raise ImportError(
ImportError: Exception importing custom_components.generic_hygrostat.binary_sensor

Further explanation of setup

In your readme you have examples of a binary sensor with default settings :

attribute: humidity # Optional use sensor attribute instead of state.

delta_trigger: 3 # Optional humidity swing to detect. Default = 3

What is allowed? Is this a swing from the current value to +3. i.e 50 to 53?

target_offset: 3 # Optional dehumidification target offset. Default = 3

What is allowed? Is this a swing from the current value to +3. i.e 50 to 53?

min_on_time: 300 # Optional min on time in seconds. Default = 0 seconds

I assume this is the time when the sensor first turns on. The 300 means it will stay on for 5 minutes?
max_on_time: 7200 # Optional safety max on time in seconds. Default = 7200 seconds
This will shut it off in 2 hours?
sample_interval: 300 # Optional time between taking humidity samples in seconds, default 300 seconds
This takes a sample every 5 minutes? This seems long for a shower.
min_humidity: 30 # Optional minimum humidity to enable dehumidification. Default = 0
This means that it will not turn on below 30?

Are multiple Hygrostat binary sensors setup by using a second, third, etc binary sensor in the yaml file?

My sensor file:
binary_sensor:

  • platform: generic_hygrostat
    name: Bathroom Hygrostat
    sensor: sensor.bill_br_govee5075_humidity # Source humidity sensor
    delta_trigger: 3 # Optional humidity swing to detect. Default = 3
    target_offset: 3 # Optional dehumidification target offset. Default = 3
    min_on_time: 300 # Optional min on time in seconds. Default = 0 seconds
    max_on_time: 7200 # Optional safety max on time in seconds. Default = 7200 seconds
    sample_interval: 300 # Optional time between taking humidity samples in seconds, default 300 seconds
    min_humidity: 30 # Optional minimum humidity to enable dehumidification. Default = 0
    unique_id: bill_bathroom_hygrostat # Optional ID that uniquely identifies this sensor. Set this to a unique value to allow customization through the UI.

This is what the sensor looks like in developers tools.
image
Not sure why it shows null for target?

Track changes in the sensor

This is a feature request:

I have noticed that updates of the sensor don't trigger a switch in the created entity.
It would be an amazing feature if this could be implemented.

input_number

Hello,

Is it possible to let the user pass an input_number value to delta_trigger, target_offset and max_on_time instead of a litteral fix number?

Thanks!

Dashboard UI

Is it possible to use this with the official Humidifier card?

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.