Repository navigation
Built-in Fuzzy Logic Controller Helper #1504
Replies: 1 comment
|
I implemented something link this with the help of AI. I use a lot of helpers so each discrete state (warm/cool) and continues scaler (delta temperature) is visible in the history. Decisions are first separated into state based scenario's and than a scaling formula is applied to regulate the output. A nice example is my ventilation system which calculates the ventilation speed (0%-100%) based on temperature, humidity and CO2.
Based on my experience, tuning this behaviour requires historical insight into all contributing entities. It's easy to include too many values and drown in the complexity. I let AI create dashboards specifically to understand why something is happening, showing the logic layer by layer. I would split the proposal into 4 (mostly independent) steps:
These 4 improvements would put fuzzy logic within reach for most users. I guess a true fuzzy logic helper would be possible, but I think it's difficult to use a bit far from the current helpers. |
Uh oh!
There was an error while loading. Please reload this page.
Context & The Problem
Right now in Home Assistant, when automations need to control an output based on multiple continuous inputs (e.g. fan speed, target water temperature, shade position, or watering duration), users are forced to choose between several awkward approaches:
chooseblocks: Brittle stair-step logic. A room at 23.9°C vs 24.1°C triggers an abrupt step change unless you write dozens of micro-conditions with hysteresis buffers.Human reasoning in home automation is inherently linguistic:
Proposal
Introduce a built-in Fuzzy Logic Controller Helper (e.g.
fuzzy_systemorfuzzy_controller) to Core.A fuzzy controller maps one or more existing numeric entities into continuous outputs using standard linguistic membership curves (triangular, trapezoidal, gaussian) and natural
IF ... AND/OR ... THEN ...rules with linguistic hedges (very,somewhat,not).The integration runs locally, reacts to input entity state changes, and outputs:
0%to100%).rule_strengths, active dominant set) so users can see why an automation made a decision directly in their dashboards.Real-World Use Cases
1. Dynamic Climate & Ceiling Fan Modulation
IF temp IS warm AND humidity IS humid THEN fan_speed IS high2. Adaptive Lighting & Solar Glare (Blinds/Shades)
IF sun_elevation IS low AND outdoor_lux IS very bright THEN blind_tilt IS mostly_closed3. Solar Excess & Heat Pump / EV Modulation
IF solar_export IS high AND battery_soc IS good THEN water_heater_power IS high4. Smart Weather-Aware Irrigation
IF soil IS dry AND forecast_temp IS hot AND rain_history IS low THEN watering_duration IS longArchitecture & Implementation Notes
derivative,threshold,min_max, andfilter(iot_class: calculated,integration_type: helper).scikit-fuzzy).Discussion Points for Core
sensorentity. Should there also be a dedicatednumberorclimatecontrol integration target, or is generating numeric sensor helpers that feed standard automations the cleanest approach?All reactions