Skip to content

Instantly share code, notes, and snippets.

@HarvsG
Last active November 11, 2024 16:25
Show Gist options
  • Save HarvsG/6810cb930cee094a902578577eb98796 to your computer and use it in GitHub Desktop.
Save HarvsG/6810cb930cee094a902578577eb98796 to your computer and use it in GitHub Desktop.
blueprint:
name: Bayesian Numeric Probability
description: Creates a sensor which holds the numeric probability value from a bayesian binary_sensor
domain: template
source_url: https://gist.githubusercontent.com/HarvsG/6810cb930cee094a902578577eb98796/raw/6305d13cf26b14ccced5ad093ae51cb5cbbe7027/bayesian_probability_sensor.yaml
input:
bayesian_binary_sensor:
name: Bayesian sensor
description: The binary_sensor to have its probability monitored
selector:
entity:
domain: bayesian
variables:
bayesian_binary_sensor: !input bayesian_binary_sensor
sensor:
state: >
{{ state_attr(bayesian_binary_sensor, 'probability') | float }}
availability: "{{ states(bayesian_binary_sensor) not in ('unknown', 'unavailable') }}"
@HarvsG
Copy link
Author

HarvsG commented Nov 11, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment