Switch methods of rain detection...again... #89
This commit is contained in:
@ -159,38 +159,38 @@ weather:
|
||||
{{ states(result) | float }}
|
||||
precipitation_unit: in
|
||||
|
||||
binary_sensor:
|
||||
- platform: bayesian
|
||||
unique_id: 3e9640d9-57a0-4495-8731-e64b34774065
|
||||
name: Raining Bayesian
|
||||
prior: 0.17
|
||||
probability_threshold: 0.6
|
||||
observations:
|
||||
- entity_id: "sensor.myradar_precip"
|
||||
prob_given_true: 0.99
|
||||
prob_given_false: 0.45
|
||||
platform: "state"
|
||||
to_state: "rain"
|
||||
- entity_id: "sensor.pirateweather_precip"
|
||||
prob_given_true: 0.13
|
||||
prob_given_false: 0.005
|
||||
platform: "state"
|
||||
to_state: "rain"
|
||||
- entity_id: "sensor.openweathermap_precipitation_kind"
|
||||
prob_given_true: 0.75
|
||||
prob_given_false: 0.005
|
||||
platform: "state"
|
||||
to_state: "rain"
|
||||
- entity_id: "sensor.tomorrow_io_stratton_ave_precipitation_type"
|
||||
prob_given_true: 0.99
|
||||
prob_given_false: 0.2
|
||||
platform: "state"
|
||||
to_state: "rain"
|
||||
- entity_id: "sensor.stratton_ave_precipitation"
|
||||
prob_given_true: 0.99
|
||||
prob_given_false: 0.2
|
||||
platform: "numeric_state"
|
||||
above: 0
|
||||
# binary_sensor:
|
||||
# - platform: bayesian
|
||||
# unique_id: 3e9640d9-57a0-4495-8731-e64b34774065
|
||||
# name: Raining Bayesian
|
||||
# prior: 0.17
|
||||
# probability_threshold: 0.6
|
||||
# observations:
|
||||
# - entity_id: "sensor.myradar_precip"
|
||||
# prob_given_true: 0.99
|
||||
# prob_given_false: 0.45
|
||||
# platform: "state"
|
||||
# to_state: "rain"
|
||||
# - entity_id: "sensor.pirateweather_precip"
|
||||
# prob_given_true: 0.13
|
||||
# prob_given_false: 0.005
|
||||
# platform: "state"
|
||||
# to_state: "rain"
|
||||
# - entity_id: "sensor.openweathermap_precipitation_kind"
|
||||
# prob_given_true: 0.75
|
||||
# prob_given_false: 0.005
|
||||
# platform: "state"
|
||||
# to_state: "rain"
|
||||
# - entity_id: "sensor.tomorrow_io_stratton_ave_precipitation_type"
|
||||
# prob_given_true: 0.99
|
||||
# prob_given_false: 0.2
|
||||
# platform: "state"
|
||||
# to_state: "rain"
|
||||
# - entity_id: "sensor.stratton_ave_precipitation"
|
||||
# prob_given_true: 0.99
|
||||
# prob_given_false: 0.2
|
||||
# platform: "numeric_state"
|
||||
# above: 0
|
||||
|
||||
sensor:
|
||||
- platform: weatheralerts
|
||||
@ -353,7 +353,26 @@ template:
|
||||
{% else %}
|
||||
common
|
||||
{% endif %}
|
||||
- name: Raining
|
||||
unique_id: 232b43a4-4598-4315-ab76-42348c11e6ff
|
||||
state: >
|
||||
{{ states('sensor.total_rain_sensors') | int > 1 }}
|
||||
icon: "{{ 'mdi:weather-rainy' if states('sensor.total_rain_sensors') | int > 1 else 'mdi:weather-cloudy' }}"
|
||||
- sensor:
|
||||
- name: Total Rain Sensors
|
||||
unique_id: b7c2e709-8f5c-4263-aa1d-fa8280afcddb
|
||||
state: >
|
||||
{% set sensors = [
|
||||
states.sensor.pirateweather_precip,
|
||||
states.sensor.openweathermap_precipitation_kind,
|
||||
states.sensor.tomorrow_io_stratton_ave_precipitation_type
|
||||
] %}
|
||||
{% set numeric_sensors = [
|
||||
states.sensor.stratton_ave_precipitation
|
||||
] %}
|
||||
{% set c1 = sensors | selectattr('state','eq','rain') | list | count %}
|
||||
{% set c2 = numeric_sensors | map(attribute='state') | map('float') | select('gt',0) | list | count %}
|
||||
{{ (c1 + c2) | int }}
|
||||
- name: Current Forecast
|
||||
unique_id: c0faea33-2ac3-40f1-8558-584c3f5d6b16
|
||||
icon: mdi:weather-sunny
|
||||
|
Reference in New Issue
Block a user