Welcome to the NetDaemon project!
NetDaemon is an application daemon that enables you to write powerful home automation scripts in C# for Home Assistant. This repository contains NetDaemon V5, the latest version of the framework.
NetDaemon was founded by @helto4real in 2020 as a personal project to explore the use of C# in Home Assistant. Early contributions from @Ludeeus helped integrate NetDaemon with Home Assistant. The project gained significant momentum when @FrankBakkerNl joined and introduced the HassModel API, which leverages code generation to create a user-friendly experience.
Currently, @helto4real and @FrankBakkerNl serve as the primary maintainers, though many others have contributed over the years.
To learn how to install and use NetDaemon, visit our official documentation:
NetDaemon allows you to write your automations easily and cleanly using C#.
[NetDaemonApp]
class MyApp
{
public MyApp(Entities entities)
{
LightEntity hallwayLight = entities.Light.HallwayLight;
BinarySensorEntity motionSensor = entities.BinarySensor.HallwayMotionSensor;
// Check state of entities directly
if (motionSensor.IsOn() && hallwayLight.IsOff()){
hallwayLight.TurnOn();
}
// Subscribe to changes in the state of the motion sensor
motionSensor.StateChanges()
.Where(e => e.New?.IsOn() ?? false)
.Subscribe(_ => hallwayLight.TurnOn());
}
}
If you have issues or suggestions, please feel free to:
- Open an issue
- Join our Discord server for support, discussions, and contributions.
Contributions are welcome! If you'd like to help improve NetDaemon, we encourage you to join our Discord server to learn more about how you can contribute to the project.
Check out the Release Notes for detailed information on the latest changes, bug fixes, and new features.
NetDaemon is stable, and we're committed to maintaining that stability by minimizing breaking changes in future releases.
NetDaemon uses the CalVer versioning system for its NuGet packages. The version format is YYYY.WW.PATCH
, where:
YYYY.WW
represents the year and week number (01-52).PATCH
indicates the patch version of the release.
- Visit the NetDaemon Developer Site for development resources.
To automatically upgrade all NuGet packages, use the dotnet-outdated-tool
:
- Install the tool with the following command:
dotnet tool install --global dotnet-outdated-tool
- Run this command to upgrade all packages:
dotnet outdated --pre-release Never --upgrade