Generated entities
#
Get startedThis is how you use the auto generated entities in NetDaemon.
- Turn on enitity generation, You need to turn on generation of entities. If you run docker use the
HASS_GEN_ENTITIES=True
environment var or if you use Home Assistant add-on use the settinggenerate_entities: true
. - Restart NetDaemon once for the entities to be generated.
- Two genreated files will be created. Use the new api in the file
_EntityExtensionsRx.cs
that will be created in app folder. - Inherit from
GeneratedAppBase
instead of defaultNetDaemonRxApp
and add ausing Netdaemon.Generated.Reactive;
to the app file.
#
Using the entitiesNow you can do several things. All entities has TurnOn/TurnOff/Toggle. All other will inherit the service calls from the domain generated.
All services with a entity_id parameter will be added automatically. Rest you need to add. See examples below.
Examples: