#Humidity sensor for washing sequence
1 messages · Page 1 of 1 (latest)
What do you mean by "washing state"?
What are you actually trying to do?
I want to have a binary sensor called for example "Getting_shower"
It will takes into consideration 3 entities:
- Apollo msr-1 occupancy Zone 3
- Humidity sensor
- Bathroom Cabin Door
So when someone is detected in zone3 (cabin place, I set it up it's most of the time accurate)
and
Cabin Door is closed
and
Humidity Sensor trend is going steeply up - this is the reason I need trend
@sick igloo
I have tried a few methods to use humidity to determine if the shower is in use. The most reliable method for me has been to compare the humidity in the bathroom to other nearby humidity sensors.
You can then use a Template binary sensor to combine the humidity, door, and occupancy sensors.
Another, more complicated, but powerful option would be a Bayesian binary sensor.
I will try with trend first
template:
binary_sensor:
- name: "Taking Shower"
state: >
{% set humidity_rising = is_state('binary_sensor.humidity_rising', 'on') %}
{% set occupancy_detected = is_state('sensor.occupancy_zone_3', 'Detected') %}
{% set door_closed = is_state('sensor.bathroom_cabin', 'off') %}
{% set current_humidity = states('sensor.humidity_sensor') | float(0) %}
{% set max_humidity = 85 %} # Set this to your desired max humidity level
{{
(humidity_rising and occupancy_detected and door_closed) or
(is_state('binary_sensor.taking_shower', 'on') and current_humidity < max_humidity and door_closed)
}}
device_class: occupancy
Does this code make any sense?
So I would like to trigger it once, not to trigger, if for example I open the door, then again I close the door
You're using a state-based template binary sensor, so it will be rendered every time any of the entity's in the template update their state. If you want to set specific triggers, you need to switch to a trigger-based configuration. Another option for avoiding state change for a quick door open/close would be to include a delay_off property.
The reason it is unknown is the comments in the 5th line of the template. Jinja comments need to be surrounded in the comment delimiters {# #}.