Skip to content

Add intelligent KDK fan control using Singapore weather and ambient light data#76

Draft
Copilot wants to merge 6 commits into
mainfrom
copilot/add-netdaemon-app-living-room
Draft

Add intelligent KDK fan control using Singapore weather and ambient light data#76
Copilot wants to merge 6 commits into
mainfrom
copilot/add-netdaemon-app-living-room

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 16, 2026

Implements autonomous control of living room KDK fan parameters (speed, brightness, color temperature) based on Singapore weather forecasts and local environmental sensors.

Implementation

Single NetDaemon app (LivingRoomKdkIntelligentControl.cs) with reactive subscriptions:

  • Fan speed: Temperature-based (24°C→25%, 26°C→50%, 28°C→75%, 30°C→100%), with rainy weather adjustments
  • Light brightness: Ambient light-based (50 lux→20%, 20→50%, 10→75%, <10→100%)
  • Color temperature: Time/weather-based (evening→2700K warm, hot→5500K cool, day→4000K neutral)

Data Sources

  • Singapore weather: Existing DgsForecast service (data.gov.sg 2hr forecast)
  • Temperature: sensor.daikinap16703_inside_temperature
  • Ambient light: sensor.presence_sensor_fp2_b4c4_light_sensor_light_level
  • Sun position: sun.sun

Control Flow

// Temperature changes trigger fan speed adjustments
_temperatureSensor.StateChanges()
    .Where(_ => !_laundryModeSwitch.IsOn())
    .Throttle(TimeSpan.FromMinutes(2))
    .Subscribe(e => AdjustFanSpeedBasedOnTemperature(e.New?.State));

// Weather forecast adjusts for rain conditions
apiFactory.CreateForecast()
    .Select(f => ExtractBishanForecast(f))
    .DistinctUntilChanged()
    .Subscribe(forecast => AdjustFanBasedOnWeather(forecast));

Manual override via existing input_boolean.liang_yi_mo_shi (laundry mode switch) disables all automation.

Throttling & Safety

  • Temperature: 2min throttle
  • Light sensor: 3min throttle
  • Color temp: 30min interval
  • Null-safe throughout with FirstOrDefault() patterns

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api-open.data.gov.sg
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
  • api.data.gov.sg
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Add a dedicated netdaemon app to intelligently set the living room kdk fan speed, brightness, and tone. Make use of weather and lighting data from public APIs for singapore


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 5 commits February 16, 2026 11:16
Co-authored-by: qin-guan <10321883+qin-guan@users.noreply.github.com>
Co-authored-by: qin-guan <10321883+qin-guan@users.noreply.github.com>
Co-authored-by: qin-guan <10321883+qin-guan@users.noreply.github.com>
Co-authored-by: qin-guan <10321883+qin-guan@users.noreply.github.com>
Co-authored-by: qin-guan <10321883+qin-guan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add netdaemon app for controlling living room fan and lighting Add intelligent KDK fan control using Singapore weather and ambient light data Feb 16, 2026
Copilot AI requested a review from qin-guan February 16, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants