Skip to content

Releases: net-daemon/netdaemon

Release 0.8.1

22 May 16:38

Choose a tag to compare

Implement the Rx API

Implement the System.Reactive based APIs. This is an alternative implementation to @jvert suggestions (thanks alot for this great idéa).

Since this is a very different aproach a new BaseClass NetDaemonRxApp is provided that implements the Rx style. This is event based and not async/await. All calls post a message on a channel and async code takes care of the async stuff in the background.

More API features will be added coming releases to this API.

Check out my running production automations at showcasing the new API:
https://github.com/helto4real/hassio/tree/master/netdaemon/apps

Example of usage:

// Observable that get state changes 
StateChanges.Subscribe(t=> Log(t.New.State));

// Observable that get all state changes inkluding attributes 
StateAllChanges.Subscribe(t=> Log(t.New.State));

// IEnumerable<EntityState>
var allLights = States.Select(n => n.EntityId.StartsWith("light."));
// Gets single state
var state = State("light.my_light")?.State;

// No async, handled in background
CallService("light", "turn_on", new {entity_id = "light.my_light"});

// Entity now not fluent
// Action on single entity
Entity("light.my_light").TurnOn();
Entity("light.my_light").Toggle();
// Action on multiple entities
Entities("light.my_light", "light.my_light").Toggle();
// Or lambda
Entities(n => n.EntityId.StartsWith("light.").Toggle();

// Merging observables <3
Entities(
    "binary_sensor.tomas_rum_pir",
    "binary_sensor.vardagsrum_pir")
    .StateChanges
    .Subscribe(e =>
    {
        Log("{entity}: {state}({oldstate}, {lastchanged})", e.New.EntityId, e.New.State, e.Old.State, e.New.LastChanged);
    });

// Merging observables all changes including attributes <3
Entities(
    "binary_sensor.tomas_rum_pir",
    "binary_sensor.vardagsrum_pir")
    .StateAllChanges
    .Subscribe(e =>
    {
        Log("{entity}: {state}({oldstate}, {lastchanged})", e.New.EntityId, e.New.State, e.Old.State, e.New.LastChanged);
    });

// Set state
SetState("sensor.thesensor", "on", new {attributex="cool"});
// Set state selecting with Entity Selector
Entity("sensor.x", "sensor.y").SetState("on");

// Merging of entity results

// Schedulers
RunEvery(TimeSpan.FromMinutes(1)).Subscribe(....);

RunDaily("12:00:00").Subscribe(...);

// Events
EventChanges
     .Subscribe(f =>
      {
            Log("event: {domain}.{event} - {data}", f?.Domain??"none", f.Event, f?.Data);
       });

// All events including attribute changes
EventAllChanges
     .Subscribe(f =>
      {
            Log("event: {domain}.{event} - {data}", f?.Domain??"none", f.Event, f?.Data);
       });

Additional information

In order to make application lifecycle easier, all eventlisteners and state handlers are tied to each app-instance. This makes it way more easy to disable individual apps in runtime plus manage lifecykle in the Rx stuff too. More refactorings to come to make it easier for future changes

Pre-release System.Reactive (Rx) support

18 May 10:23
6aab278

Choose a tag to compare

Please see
#118

This is a pre-release of the system.reactive. Please use the stable version if you running into trouble

Prerelease Rx

12 May 20:16

Choose a tag to compare

Prerelease Rx Pre-release
Pre-release
0.6.40

Fixes scheduler to be more robust

0.6.0 Dev release

06 May 19:53
0d421d9

Choose a tag to compare

0.6.0 Dev release Pre-release
Pre-release

This is a pre-release of 0.6.x

Version 0.5.1 beta

05 May 15:16

Choose a tag to compare

A another great release from NetDaemon! This release is as feature complete we wanted it for beta. So this is the first non pre-release verison but you should consider it still a beta stage. From this release the components will have the -beta postfix. (0.5.1-beta), make sure you update your dev environment!

Using Areas

NetDaemon does match the area where the entity´s device is configured. This means it is very easy to do selections on what area that matches.

All binary sensors (PIRS) in the kitchen turn on the light:

Entities(n => n.Area == "kitchen" && n.EntityId.StartsWith("binary_sensor."))
     .WhenStateChange("on").UseEntity("light.light1").TurnOn().Execute();

Or use it directly to turn on all lights in the kitchen area:

Entities(n => n.Area == "kitchen" && n.EntityId.StartsWith("light.")).TurnOn().ExecuteAsync();

You can also use it for selecting the entities to do action on. When pir is on, turn on all lights in the kitchen area:

 Entity("binary_sensor.livingroom_pir")
     .WhenStateChange("on")
          .UseEntities(n => n.Area == "livingroom" && n.EntityId.StartsWith("light."))
                .TurnOn()
                .Execute();

It will alsoe automatically update in the background when the users change the device info or area info.

Changes in docker

The add-on and docker container now share the same image. This is great for maintainability.

Setting own csproj file for NetDaemon

Setting the HASS_RUN_PROJECT_FOLDER=true as environment var will use the daemonapp.csproj file when building the daemon. Use the one from the template repo. This makes it possible to use custom NUGET packages building your apps. For now this does not work in add-on but will be in next release.

Changes in build strategy

Due to support for custom csproj files to build NetDaemon it now builds the whole daemon pre launch of your apps. This will add some time to start NetDaemon but the benefits of being able to use custom projects with own nuget packages is worth it. In future releases there will be only a singe time build for non custom projects.

Areas devrelease 0.4.6 r2

05 May 13:27
32c098b

Choose a tag to compare

Pre-release

Now refresh area information when user makes changes to devices and areas

Areas devrelease 0.4.5

04 May 19:29
9a51647

Choose a tag to compare

Pre-release

Test support for areas

Version 0.4.4

03 May 10:04
5dac82f

Choose a tag to compare

Version 0.4.4 Pre-release
Pre-release

Another devrelease

Version 0.4.3

02 May 19:06
3f7c356

Choose a tag to compare

Version 0.4.3 Pre-release
Pre-release

Test version of the new startup sequence and one common docker container for both normal containers and add-ons.

Ignore will be removed

02 May 13:01

Choose a tag to compare

Pre-release
0.4.2

Trying to add reference instead