I’m a very novice user of HA and I’m trying to set up a trend sensor, that detects a rapid humidity increase, to be used to turn a bathroom fan on. I’m confused on how the “helper” and the config.yaml code work together and what each should contain. I can’t find any simple documentation on this - how the config.yaml part and the helper part work with each other and how to set each up. There are examples of what I want to achieve in other topics, but not a step-by-step explanation of how to do all the various parts of the setup. I have a humidity sensor in the bathroom and I want to switch a fan on when the humidity rises at a certain (high) rate - a common use of the “trend” sensor. I added a “trend” helper and selected the humidity entity of the temp/humidity sensor as the entity to be tracked. Then it asks for the attribute to be tracked. None of the options make sense to me, but I chose “state class” If I open that helper (view settings) it gives me other configuration options including “trend options” which have settings to define a humidity gradient. So I have a binary_sensor. But it looks to me like people put those settings in a code in config.yaml like this
binary_sensor:
- platform: trend
sensors:
start_showering:
entity_id: sensor.nrg_itho_c1f4_humidity
sample_duration: 60
max_samples: 20
min_gradient: 0.083
- surely they don’t go in two places? In the above example, which line refers to the binary sensor and which line refers to the entity tracked by the binary sensor - lines 4 and 5 respectively?
I assume that once I have the binary sensor working I should be able to plot a history graph that shows “on” when the humidity gradient is above the trigger point, and “off” when it is below. Then I would just call this binary sensor in an automation and use its “on” state to trigger the fan.
I long for some more basic HA documentation for less IT-savvy people like myself. There are so many parts to the whole and I find it difficult to get a clear picture of how they interact, and the names of components of these parts aren’t necessarily obvious at face value (e.g. to me, a “sensor” is something physical that detects stuff, but in HA it has a virtual meaning too - these sorts of things trip me up often, all a matter of practice, I guess).