From b9eb4cf019937f43d6ef87d5480d885a6d44ef2d Mon Sep 17 00:00:00 2001 From: Stephan Maier Date: Tue, 29 Aug 2023 11:37:30 +0200 Subject: [PATCH] Neuerstellung --- .../NetDaemonApps/.config/dotnet-tools.json | 12 + .../NetDaemonApps/.devcontainer/Dockerfile | 4 + .../.devcontainer/devcontainer.json | 12 + NetDaemonApps/NetDaemonApps/.gitignore | 8 + .../NetDaemonApps/.vscode/launch.json | 28 + .../NetDaemonApps/.vscode/tasks.json | 29 + .../NetDaemonApps/AreaControl/AreaControl.cs | 120 + .../NetDaemonApps/AreaControl/Areas/Bath.cs | 16 + .../AreaControl/Areas/Bedroom.cs | 16 + .../AreaControl/Areas/Corridor1stFloor.cs | 16 + .../AreaControl/Areas/Corridor2ndFloor.cs | 16 + .../AreaControl/Areas/CorridorGroundFloor.cs | 16 + .../AreaControl/Areas/EntranceArea.cs | 16 + .../AreaControl/Areas/KidsRoom.cs | 16 + .../AreaControl/Areas/Kitchen.cs | 16 + .../AreaControl/Areas/LivingRoom.cs | 16 + .../NetDaemonApps/AreaControl/Areas/Office.cs | 52 + .../NetDaemonApps/AreaControl/Areas/Studio.cs | 16 + .../AreaControl/Areas/TechnicalRoom.cs | 16 + .../AreaControl/Areas/TmpArea.cs | 125 + NetDaemonApps/NetDaemonApps/ButtonMapping.cs | 19 + NetDaemonApps/NetDaemonApps/Constants.cs | 6 + .../DeviceControl/DeviceControl.cs | 103 + .../DeviceControl/Devices/Deengph001.cs | 26 + .../DeviceControl/Devices/Deengph002.cs | 16 + .../DeviceLib/SilverCrest/SwitchedSocket.cs | 38 + .../NetDaemonApps/DeviceLib/SocketBase.cs | 111 + .../UseeLink/SmartSurgeProtectorSocket.cs | 14 + .../Extensions/EntityExtensions.cs | 32 + NetDaemonApps/NetDaemonApps/GlobalUsings.cs | 10 + .../NetDaemonApps/HomeAssistantGenerated.cs | 7314 +++++++++++++++++ .../NetDaemonApps/Modules/AreaCollection.cs | 40 + .../NetDaemonApps/Modules/DeviceCollection.cs | 30 + .../NetDaemonApps/Modules/DiHelpers.cs | 29 + .../NetDaemonApps/NetDaemonApps.csproj | 55 + NetDaemonApps/NetDaemonApps/NetDaemonApps.sln | 31 + .../NetDaemonCodegen/EntityMetaData.json | 2201 +++++ .../NetDaemonCodegen/ServicesMetaData.json | 6191 ++++++++++++++ .../Properties/launchSettings.json | 12 + NetDaemonApps/NetDaemonApps/README.md | 18 + .../apps/CallServiceEventHandlerApp.cs | 69 + .../NetDaemonApps/apps/IdleSettingApp.cs | 29 + .../NetDaemonApps/apps/NetDaemonAppBase.cs | 25 + .../apps/PersistanceHandlerApp.cs | 23 + NetDaemonApps/NetDaemonApps/apps/Scheduler.cs | 65 + NetDaemonApps/NetDaemonApps/appsettings.json | 23 + NetDaemonApps/NetDaemonApps/program.cs | 39 + .../NetDeamonInterface/AreaControlEnum.cs | 17 + .../CallServiceDataElement.cs | 22 + .../NetDeamonInterface/DeviceControlEnum.cs | 7 + .../NetDeamonInterface/EntityEvents.cs | 104 + .../NetDeamonInterface/IAreaCollection.cs | 6 + .../NetDeamonInterface/IAreaControl.cs | 37 + .../NetDeamonInterface/IDeviceCollection.cs | 8 + .../NetDeamonInterface/IDeviceControl.cs | 18 + .../NetDaemonInterface.csproj | 27 + NetDaemonApps/NetDeamonInterface/StateEnum.cs | 16 + .../NetDeamonInterface/ViewModelBase.cs | 45 + 58 files changed, 17442 insertions(+) create mode 100644 NetDaemonApps/NetDaemonApps/.config/dotnet-tools.json create mode 100644 NetDaemonApps/NetDaemonApps/.devcontainer/Dockerfile create mode 100644 NetDaemonApps/NetDaemonApps/.devcontainer/devcontainer.json create mode 100644 NetDaemonApps/NetDaemonApps/.gitignore create mode 100644 NetDaemonApps/NetDaemonApps/.vscode/launch.json create mode 100644 NetDaemonApps/NetDaemonApps/.vscode/tasks.json create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/AreaControl.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/Bath.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/Bedroom.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/Corridor1stFloor.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/Corridor2ndFloor.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/CorridorGroundFloor.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/EntranceArea.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/KidsRoom.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/Kitchen.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/LivingRoom.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/Office.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/Studio.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/TechnicalRoom.cs create mode 100644 NetDaemonApps/NetDaemonApps/AreaControl/Areas/TmpArea.cs create mode 100644 NetDaemonApps/NetDaemonApps/ButtonMapping.cs create mode 100644 NetDaemonApps/NetDaemonApps/Constants.cs create mode 100644 NetDaemonApps/NetDaemonApps/DeviceControl/DeviceControl.cs create mode 100644 NetDaemonApps/NetDaemonApps/DeviceControl/Devices/Deengph001.cs create mode 100644 NetDaemonApps/NetDaemonApps/DeviceControl/Devices/Deengph002.cs create mode 100644 NetDaemonApps/NetDaemonApps/DeviceLib/SilverCrest/SwitchedSocket.cs create mode 100644 NetDaemonApps/NetDaemonApps/DeviceLib/SocketBase.cs create mode 100644 NetDaemonApps/NetDaemonApps/DeviceLib/UseeLink/SmartSurgeProtectorSocket.cs create mode 100644 NetDaemonApps/NetDaemonApps/Extensions/EntityExtensions.cs create mode 100644 NetDaemonApps/NetDaemonApps/GlobalUsings.cs create mode 100644 NetDaemonApps/NetDaemonApps/HomeAssistantGenerated.cs create mode 100644 NetDaemonApps/NetDaemonApps/Modules/AreaCollection.cs create mode 100644 NetDaemonApps/NetDaemonApps/Modules/DeviceCollection.cs create mode 100644 NetDaemonApps/NetDaemonApps/Modules/DiHelpers.cs create mode 100644 NetDaemonApps/NetDaemonApps/NetDaemonApps.csproj create mode 100644 NetDaemonApps/NetDaemonApps/NetDaemonApps.sln create mode 100644 NetDaemonApps/NetDaemonApps/NetDaemonCodegen/EntityMetaData.json create mode 100644 NetDaemonApps/NetDaemonApps/NetDaemonCodegen/ServicesMetaData.json create mode 100644 NetDaemonApps/NetDaemonApps/Properties/launchSettings.json create mode 100644 NetDaemonApps/NetDaemonApps/README.md create mode 100644 NetDaemonApps/NetDaemonApps/apps/CallServiceEventHandlerApp.cs create mode 100644 NetDaemonApps/NetDaemonApps/apps/IdleSettingApp.cs create mode 100644 NetDaemonApps/NetDaemonApps/apps/NetDaemonAppBase.cs create mode 100644 NetDaemonApps/NetDaemonApps/apps/PersistanceHandlerApp.cs create mode 100644 NetDaemonApps/NetDaemonApps/apps/Scheduler.cs create mode 100644 NetDaemonApps/NetDaemonApps/appsettings.json create mode 100644 NetDaemonApps/NetDaemonApps/program.cs create mode 100644 NetDaemonApps/NetDeamonInterface/AreaControlEnum.cs create mode 100644 NetDaemonApps/NetDeamonInterface/CallServiceDataElement.cs create mode 100644 NetDaemonApps/NetDeamonInterface/DeviceControlEnum.cs create mode 100644 NetDaemonApps/NetDeamonInterface/EntityEvents.cs create mode 100644 NetDaemonApps/NetDeamonInterface/IAreaCollection.cs create mode 100644 NetDaemonApps/NetDeamonInterface/IAreaControl.cs create mode 100644 NetDaemonApps/NetDeamonInterface/IDeviceCollection.cs create mode 100644 NetDaemonApps/NetDeamonInterface/IDeviceControl.cs create mode 100644 NetDaemonApps/NetDeamonInterface/NetDaemonInterface.csproj create mode 100644 NetDaemonApps/NetDeamonInterface/StateEnum.cs create mode 100644 NetDaemonApps/NetDeamonInterface/ViewModelBase.cs diff --git a/NetDaemonApps/NetDaemonApps/.config/dotnet-tools.json b/NetDaemonApps/NetDaemonApps/.config/dotnet-tools.json new file mode 100644 index 0000000..9a42de7 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "joysoftware.netdaemon.hassmodel.codegen": { + "version": "23.26.0", + "commands": [ + "nd-codegen" + ] + } + } +} \ No newline at end of file diff --git a/NetDaemonApps/NetDaemonApps/.devcontainer/Dockerfile b/NetDaemonApps/NetDaemonApps/.devcontainer/Dockerfile new file mode 100644 index 0000000..8d1a022 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/.devcontainer/Dockerfile @@ -0,0 +1,4 @@ +FROM mcr.microsoft.com/dotnet/sdk:6.0 + +ENV PATH="/root/.dotnet/tools:${PATH}" +RUN dotnet tool install -g JoySoftware.NetDaemon.HassModel.CodeGen diff --git a/NetDaemonApps/NetDaemonApps/.devcontainer/devcontainer.json b/NetDaemonApps/NetDaemonApps/.devcontainer/devcontainer.json new file mode 100644 index 0000000..05507f3 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +{ + "name": "NetDaemon App-development", + "dockerFile": "./Dockerfile", + "postCreateCommand": "dotnet restore *.csproj", + "settings": { + "terminal.integrated.shell.linux": "/bin/bash", + "terminal.integrated.fontSize": 10 + }, + "extensions": [ + "ms-dotnettools.csharp" + ] +} diff --git a/NetDaemonApps/NetDaemonApps/.gitignore b/NetDaemonApps/NetDaemonApps/.gitignore new file mode 100644 index 0000000..29c3c21 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/.gitignore @@ -0,0 +1,8 @@ +obj +bin +appsettings.Development.json +.vs +*.gen +.idea +#appsettings.json +#HomeAssistantGenerated.cs diff --git a/NetDaemonApps/NetDaemonApps/.vscode/launch.json b/NetDaemonApps/NetDaemonApps/.vscode/launch.json new file mode 100644 index 0000000..b002edf --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug Apps", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceFolder}/bin/Debug/net6.0/NetDaemonApps.dll", + "args": [], + "cwd": "${workspaceFolder}", + "env": { + "DOTNET_ENVIRONMENT": "Development", + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "stopAtEntry": false, + "logging": { + "moduleLoad": false + } + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach", + "processId": "${command:pickProcess}" + } + ] +} diff --git a/NetDaemonApps/NetDaemonApps/.vscode/tasks.json b/NetDaemonApps/NetDaemonApps/.vscode/tasks.json new file mode 100644 index 0000000..f8523b7 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/.vscode/tasks.json @@ -0,0 +1,29 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/NetDaemonApps.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/NetDaemonApps.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/AreaControl.cs b/NetDaemonApps/NetDaemonApps/AreaControl/AreaControl.cs new file mode 100644 index 0000000..f53472e --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/AreaControl.cs @@ -0,0 +1,120 @@ +using NetDaemonInterface; +using NetDaemonInterface; +using System.Threading; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl +{ + public class AreaControl : IAreaControl + { + internal CancellationTokenSource? CTSAfter; + internal CancellationTokenSource? CTSRun; + internal readonly IHaContext haContext; + internal readonly IScheduler scheduler; + internal readonly IEntities entities; + internal readonly IServices services; + + public AreaControl(IHaContext haContext, IScheduler scheduler) + { + haContext = haContext; + scheduler = scheduler; + entities = new Entities(haContext); + services = new Services(haContext); + } + + /// + /// The after task is designed for an action that needs to be executed after a delay. + /// Starting a new after task will stop the currently running task + /// + /// The delay + /// The action + internal void StartAfterTask(TimeSpan Delay, Action action) + { + CTSAfter?.Cancel(); + CTSAfter = new CancellationTokenSource(); + Task.Run(() => + { + try + { + Task.Delay(Delay).Wait(CTSAfter.Token); + CTSAfter.Token.ThrowIfCancellationRequested(); + action(); + } + catch (OperationCanceledException) + { + // Ignore + } + }); + } + + /// + /// The RunTask is used to execute longer running tasks without blocking the return + /// Starting a new run task will stop the currently running task + /// + /// + internal void StartRunTask(Action action) + { + CTSRun?.Cancel(); + CTSRun = new CancellationTokenSource(); + Task.Run(() => + { + try + { + action(CTSRun.Token); + } + catch (OperationCanceledException) + { + // Ignore + } + }); + } + + /// + /// Helper to be used within a RunTask action, waits for a delay and checks for cancellation + /// + /// The delay + /// The cancellation token + internal void DelayRunTaskAndCheckCancellation(TimeSpan delay, CancellationToken ct) + { + Task.Delay(delay).Wait(ct); + ct.ThrowIfCancellationRequested(); + } + + /// + /// Stops the currently running RunTask + /// + internal void StopAfterTask() + { + CTSAfter?.Cancel(); + } + + /// + /// Stops the currently running RunTask + /// + internal void StopRunTask() + { + CTSRun?.Cancel(); + } + + public virtual void ButtonPressed(string entityId, CallServiceDataElement dataElement) + { + + } + + public virtual void SunDawn() + { + } + + public virtual void SunRising() + { + } + + public virtual void SunDusk() + { + } + + public virtual void SunSetting() + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Bath.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Bath.cs new file mode 100644 index 0000000..d0bc00e --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Bath.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class Bath : AreaControl + { + public Bath(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Bedroom.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Bedroom.cs new file mode 100644 index 0000000..6de7902 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Bedroom.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class Bedroom : AreaControl + { + public Bedroom(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Corridor1stFloor.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Corridor1stFloor.cs new file mode 100644 index 0000000..dd25783 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Corridor1stFloor.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class Corridor1stFloor : AreaControl + { + public Corridor1stFloor(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Corridor2ndFloor.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Corridor2ndFloor.cs new file mode 100644 index 0000000..b166cec --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Corridor2ndFloor.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class Corridor2ndFloor : AreaControl + { + public Corridor2ndFloor(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/CorridorGroundFloor.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/CorridorGroundFloor.cs new file mode 100644 index 0000000..effc9d4 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/CorridorGroundFloor.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class CorridorGroundFloor : AreaControl + { + public CorridorGroundFloor(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/EntranceArea.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/EntranceArea.cs new file mode 100644 index 0000000..51e9b97 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/EntranceArea.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class EntranceArea : AreaControl + { + public EntranceArea(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/KidsRoom.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/KidsRoom.cs new file mode 100644 index 0000000..6624a07 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/KidsRoom.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class KidsRoom : AreaControl + { + public KidsRoom(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Kitchen.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Kitchen.cs new file mode 100644 index 0000000..4188329 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Kitchen.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class Kitchen : AreaControl + { + public Kitchen(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/LivingRoom.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/LivingRoom.cs new file mode 100644 index 0000000..a048dbc --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/LivingRoom.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class LivingRoom : AreaControl + { + public LivingRoom(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Office.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Office.cs new file mode 100644 index 0000000..9d2bc45 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Office.cs @@ -0,0 +1,52 @@ +using NetDaemonInterface; +using NetDaemonInterface; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class Office : AreaControl + { + + public Office(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + + } + + public override void ButtonPressed(string ButtonSensor, CallServiceDataElement dataElement) + { + + } + + /// + /// Morgendämmerung + /// + public override void SunDawn() + { + + } + + /// + /// Sonnenaufgang + /// + public override void SunRising() + { + + } + + /// + /// Abenddämmerung + /// + public override void SunDusk() + { + + } + + /// + /// Sonnenuntergang + /// + public override void SunSetting() + { + + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Studio.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Studio.cs new file mode 100644 index 0000000..05b7fc2 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/Studio.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class Studio : AreaControl + { + public Studio(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/TechnicalRoom.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/TechnicalRoom.cs new file mode 100644 index 0000000..20b475f --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/TechnicalRoom.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class TechnicalRoom : AreaControl + { + public TechnicalRoom(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/AreaControl/Areas/TmpArea.cs b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/TmpArea.cs new file mode 100644 index 0000000..bb9c49a --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/AreaControl/Areas/TmpArea.cs @@ -0,0 +1,125 @@ +using NetDaemonApps.DeviceLib.UseeLink; +using NetDaemonInterface; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace NetDaemonApps.AreaControl.Areas +{ + public class TmpArea : AreaControl + { + private EntityEvents events; + private NotifyServices notifyServices; + + SmartSurgeProtectorSocket socketAllDevices; + Task socketAllDevicesTask; + SmartSurgeProtectorSocket socketTvDvd; + Task socketTvDvDTask; + + public TmpArea(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + events = new EntityEvents(); + events.Click += Events_Click; + events.DoubleClick += Events_DoubleClick; + notifyServices = new NotifyServices(haContext); + + + socketAllDevices = new SmartSurgeProtectorSocket() + { + Input = entities.InputButton.Deengzb002dgStMxBtnonoff, + + Outputs = new List + { + entities.Light.Deengzb002dgStMxLight, // TV + entities.Light.Deengzb002dgStMxLight2, // PC + entities.Light.Deengzb002dgStMxLight3, // DVD + entities.Light.Deengzb002dgStMxLight4, // Wifi + //entities.Light.Deengzb002dgStMxLight5, // USB + }, + + SwitchOnDelayTime = 1000, + SwitchOffTime = 0, + }; + + socketTvDvd = new SmartSurgeProtectorSocket() + { + Input = entities.InputButton.Deengzb002dgStMxBtnonoff, + + Outputs = new List + { + entities.Light.Deengzb002dgStMxLight, // TV + entities.Light.Deengzb002dgStMxLight2, // PC + //entities.Light.Deengzb002dgStMxLight3, // DVD + //entities.Light.Deengzb002dgStMxLight4, // Wifi + //entities.Light.Deengzb002dgStMxLight5, // USB + }, + + SwitchOnDelayTime = 1000, + SwitchOffTime = 0, + }; + + } + + private void Events_DoubleClick(object? sender, EventArgs e) + { + + } + + private void Events_Click(object? sender, EventArgs e) + { + + } + + + public override void ButtonPressed(string ButtonSensor, CallServiceDataElement dataElement) + { + events.VarName = ButtonSensor; + events.Trigger = true; + + // Alle Geräte außer die USB'S einschalten + if (entities.InputButton.Deengzb002dgStMxBtnonoff.EntityId.Equals(ButtonSensor)) + { + socketAllDevicesTask = socketAllDevices.CheckStateAsync(dataElement); + } + + // TV und PC einschalten - der Rest bleibt aus + if (entities.InputButton.Deengzb002dgStMxBtnonoffTvpc.EntityId.Equals(ButtonSensor)) + { + socketTvDvDTask = socketTvDvd.CheckStateAsync(dataElement); + } + } + + + /// + /// Morgendämmerung + /// + public override void SunDawn() + { + notifyServices.Whatsapp("Morgendämmerung"); + } + + /// + /// Sonnenaufgang + /// + public override void SunRising() + { + notifyServices.Whatsapp("Sonnenaufgang"); + } + + /// + /// Abenddämmerung + /// + public override void SunDusk() + { + notifyServices.Whatsapp("Abenddämmerung"); + } + + /// + /// Sonnenuntergang + /// + public override void SunSetting() + { + notifyServices.Whatsapp("Sonnenuntergang"); + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/ButtonMapping.cs b/NetDaemonApps/NetDaemonApps/ButtonMapping.cs new file mode 100644 index 0000000..bf55a7f --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/ButtonMapping.cs @@ -0,0 +1,19 @@ +using NetDaemonInterface; +using System.Collections.Generic; + +namespace NetDaemonApps +{ + public class ButtonMapping + { + public List> mapping; + + public ButtonMapping(IEntities entities) + { + mapping = new() + { + new(AreaControlEnum.TmpArea, entities.InputButton.Deengzb002dgStMxBtnonoff.EntityId), + new(AreaControlEnum.TmpArea, entities.InputButton.Deengzb002dgStMxBtnonoffTvpc.EntityId), + }; + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/Constants.cs b/NetDaemonApps/NetDaemonApps/Constants.cs new file mode 100644 index 0000000..fd898e0 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/Constants.cs @@ -0,0 +1,6 @@ +namespace NetDaemonApps; + +public static class Constants +{ + public static string dateTime_TimeFormat = "HH:mm:ss"; +} diff --git a/NetDaemonApps/NetDaemonApps/DeviceControl/DeviceControl.cs b/NetDaemonApps/NetDaemonApps/DeviceControl/DeviceControl.cs new file mode 100644 index 0000000..38c3b2f --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/DeviceControl/DeviceControl.cs @@ -0,0 +1,103 @@ +using NetDaemonInterface; +using System.Threading; +using System.Threading.Tasks; + +namespace NetDaemonApps.DeviceControl +{ + public class DeviceControl : IDeviceControl + { + internal CancellationTokenSource? CTSAfter; + internal CancellationTokenSource? CTSRun; + internal readonly IHaContext haContext; + internal readonly IScheduler scheduler; + internal readonly IEntities entities; + internal readonly IServices services; + + public DeviceControl(IHaContext haContext, IScheduler scheduler) + { + haContext = haContext; + scheduler = scheduler; + entities = new Entities(haContext); + services = new Services(haContext); + } + + /// + /// The after task is designed for an action that needs to be executed after a delay. + /// Starting a new after task will stop the currently running task + /// + /// The delay + /// The action + internal void StartAfterTask(TimeSpan Delay, Action action) + { + CTSAfter?.Cancel(); + CTSAfter = new CancellationTokenSource(); + Task.Run(() => + { + try + { + Task.Delay(Delay).Wait(CTSAfter.Token); + CTSAfter.Token.ThrowIfCancellationRequested(); + action(); + } + catch (OperationCanceledException) + { + // Ignore + } + }); + } + + /// + /// The RunTask is used to execute longer running tasks without blocking the return + /// Starting a new run task will stop the currently running task + /// + /// + internal void StartRunTask(Action action) + { + CTSRun?.Cancel(); + CTSRun = new CancellationTokenSource(); + Task.Run(() => + { + try + { + action(CTSRun.Token); + } + catch (OperationCanceledException) + { + // Ignore + } + }); + } + + /// + /// Helper to be used within a RunTask action, waits for a delay and checks for cancellation + /// + /// The delay + /// The cancellation token + internal void DelayRunTaskAndCheckCancellation(TimeSpan delay, CancellationToken ct) + { + Task.Delay(delay).Wait(ct); + ct.ThrowIfCancellationRequested(); + } + + /// + /// Stops the currently running RunTask + /// + internal void StopAfterTask() + { + CTSAfter?.Cancel(); + } + + /// + /// Stops the currently running RunTask + /// + internal void StopRunTask() + { + CTSRun?.Cancel(); + } + + public virtual void Idle(IEntities entities, IScheduler scheduler) + { + } + + } +} diff --git a/NetDaemonApps/NetDaemonApps/DeviceControl/Devices/Deengph001.cs b/NetDaemonApps/NetDaemonApps/DeviceControl/Devices/Deengph001.cs new file mode 100644 index 0000000..d08b1ad --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/DeviceControl/Devices/Deengph001.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.DeviceControl.Devices +{ + internal class Deengph001 : DeviceControl + { + public Deengph001(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + + } + + public override void Idle(IEntities entities, IScheduler scheduler) + { + entities.Sensor.Deengph001BatteryLevel.StateChanges() + .Throttle(TimeSpan.FromSeconds(1), scheduler) + .Where(x => x.Old?.State >x.New?.State && x.New?.State <= 25) + .Subscribe(x => new NotifyServices(haContext) + .Whatsapp(x.Entity.EntityId.ToString() + Environment.NewLine + "Akku bei " + x.New.State + " %")); + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/DeviceControl/Devices/Deengph002.cs b/NetDaemonApps/NetDaemonApps/DeviceControl/Devices/Deengph002.cs new file mode 100644 index 0000000..f925b78 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/DeviceControl/Devices/Deengph002.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.DeviceControl.Devices +{ + internal class Deengph002 : DeviceControl + { + public Deengph002(IHaContext haContext, IScheduler scheduler) + : base(haContext, scheduler) + { + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/DeviceLib/SilverCrest/SwitchedSocket.cs b/NetDaemonApps/NetDaemonApps/DeviceLib/SilverCrest/SwitchedSocket.cs new file mode 100644 index 0000000..1081ed8 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/DeviceLib/SilverCrest/SwitchedSocket.cs @@ -0,0 +1,38 @@ +using NetDaemonInterface; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; + +namespace NetDaemonApps.DeviceLib.UseeLink +{ + public class SwitchedSocket : SocketBase + { + private BackgroundWorker worker; + + public SwitchedSocket() + { + worker = new BackgroundWorker(); + worker.DoWork += Worker_DoWork; + } + + private int SwitchOnDelayTime + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + + private void Worker_DoWork(object? sender, DoWorkEventArgs e) + { + Thread.Sleep(SwitchOffTime); + Outputs.ForEach(x => x.TurnOff()); + } + + + /// + /// Steckdose nach Zeit x ms ausschalten. + /// + public int SwitchOffTime { get; set; } = 250; + } +} \ No newline at end of file diff --git a/NetDaemonApps/NetDaemonApps/DeviceLib/SocketBase.cs b/NetDaemonApps/NetDaemonApps/DeviceLib/SocketBase.cs new file mode 100644 index 0000000..c48b6af --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/DeviceLib/SocketBase.cs @@ -0,0 +1,111 @@ +using NetDaemon.HassModel.Entities; +using NetDaemonInterface; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; + +namespace NetDaemonApps.DeviceLib +{ + public class SocketBase + { + private Task switchOnSockets; + private CancellationTokenSource cts; + + public SocketBase() + { + // worker.DoWork += Worker_DoWork; + cts = new CancellationTokenSource(); + } + /// + /// + /// + /// Entitäten von HA + /// Daten aus dem CallService Event + /// + public Task CheckStateAsync(CallServiceDataElement dataElement) + { + return Task.Factory.StartNew(async () => + { + if (Input != null && Outputs != null) // Aus- bzw Eingänge nicht null + { + if (Outputs.All(x => x.IsOff())) // alle Steckdosen ausgeschalten + { + cts = new CancellationTokenSource(); + switchOnSockets = TurnOnSockets(cts.Token); + } + else // min. eine Steckdose eingeschalten + { + if (switchOnSockets != null && !switchOnSockets.IsCompleted && cts != null && !cts.IsCancellationRequested) + cts.Cancel(); + + if (switchOnSockets != null) + Task.WaitAll(switchOnSockets); + + Outputs.ForEach(x => x.TurnOff()); // alle Steckdosen ausschalten + } + } + }); + } + + private Task TurnOnSockets(CancellationToken token = default(CancellationToken)) + { + return Task.Factory.StartNew(() => + { + // alle Steckdosen verzögert einschalten + foreach (var output in Outputs) + { + + // Task abbrechen + if (token.IsCancellationRequested) + { + return; + } + + // Steckdose einschalten + output.TurnOn(); + + if (!output.Equals(Outputs.LastOrDefault())) + Thread.Sleep(SwitchOnDelayTime); // Verzögerung + } + + if (SwitchOffTime > 0) + { + //Thread.Sleep(SwitchOffTime); + Task.WaitAll(TurnOffSockets(token)); + } + }); + } + + private Task TurnOffSockets(CancellationToken token = default(CancellationToken)) + { + return Task.Factory.StartNew(() => + { + Task.WaitAny(Task.Delay(SwitchOffTime, token)); + Outputs.ForEach(x => x.TurnOff()); + }); + } + + /// + /// Eingangs Entitäten, wobei Entitäten [0] die Master-Entitäten. Mit der Master-Entitäten werden alle Ausgänge verzögert geschalten. + /// + public InputButtonEntity Input { get; set; } + + /// + /// Ausgangs Entitäten (die geschalten werden sollen) + /// + public List Outputs { get; set; } + + /// + /// Verzögerungszeit in ms zwischen den Out-Entitäten, wenn alle geschalten werden sollen + /// + public int SwitchOnDelayTime { get; set; } = 500; + + /// + /// Steckdose nach Zeit x ms ausschalten. + /// + public int SwitchOffTime { get; set; } = 250; + } +} diff --git a/NetDaemonApps/NetDaemonApps/DeviceLib/UseeLink/SmartSurgeProtectorSocket.cs b/NetDaemonApps/NetDaemonApps/DeviceLib/UseeLink/SmartSurgeProtectorSocket.cs new file mode 100644 index 0000000..66f513b --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/DeviceLib/UseeLink/SmartSurgeProtectorSocket.cs @@ -0,0 +1,14 @@ +using NetDaemonInterface; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; + +namespace NetDaemonApps.DeviceLib.UseeLink +{ + public class SmartSurgeProtectorSocket : SocketBase + { + } +} diff --git a/NetDaemonApps/NetDaemonApps/Extensions/EntityExtensions.cs b/NetDaemonApps/NetDaemonApps/Extensions/EntityExtensions.cs new file mode 100644 index 0000000..d289a50 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/Extensions/EntityExtensions.cs @@ -0,0 +1,32 @@ +using NetDaemon.HassModel.Entities; + +namespace NetDaemonApps.Extensions +{ + public static class EntityExtensions + { + public static void SetState(this Entity x, IServices services, string state) + { + services.Netdaemon.EntityUpdate(x.EntityId, state: state); + } + + public static bool IsOn(this LightEntity x) + { + return x.State == "on"; + } + + public static bool IsOff(this LightEntity x) + { + return x.State == "off"; + } + + public static bool IsOn(this SwitchEntity x) + { + return x.State == "on"; + } + + public static bool IsOff(this SwitchEntity x) + { + return x.State == "off"; + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/GlobalUsings.cs b/NetDaemonApps/NetDaemonApps/GlobalUsings.cs new file mode 100644 index 0000000..ab3d65c --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/GlobalUsings.cs @@ -0,0 +1,10 @@ +// Common usings for NetDaemon apps +global using HomeAssistantGenerated; +global using Microsoft.Extensions.Logging; +global using NetDaemon.AppModel; +global using NetDaemon.HassModel; +global using NetDaemon.HassModel.Integration; +global using NetDaemonApps.Extensions; +global using System; +global using System.Reactive.Linq; +global using System.Reactive.Concurrency; \ No newline at end of file diff --git a/NetDaemonApps/NetDaemonApps/HomeAssistantGenerated.cs b/NetDaemonApps/NetDaemonApps/HomeAssistantGenerated.cs new file mode 100644 index 0000000..d838af4 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/HomeAssistantGenerated.cs @@ -0,0 +1,7314 @@ +//------------------------------------------------------------------------------ +// +// Generated using NetDaemon CodeGenerator nd-codegen v23.32.0.0 +// At: 2023-08-24T05:36:26.7733651+02:00 +// +// *** Make sure the version of the codegen tool and your nugets Joysoftware.NetDaemon.* have the same version.*** +// You can use following command to keep it up to date with the latest version: +// dotnet tool update JoySoftware.NetDaemon.HassModel.CodeGen +// +// To update this file with latest entities run this command in your project directory: +// dotnet tool run nd-codegen +// +// In the template projects we provided a convenience powershell script that will update +// the codegen and nugets to latest versions update_all_dependencies.ps1. +// +// For more information: https://netdaemon.xyz/docs/v3/hass_model/hass_model_codegen +// For more information about NetDaemon: https://netdaemon.xyz/ +// +//------------------------------------------------------------------------------ +#nullable enable +using System; +using System.Collections.Generic; +using Microsoft.Extensions.DependencyInjection; +using System.Text.Json.Serialization; +using NetDaemon.HassModel; +using NetDaemon.HassModel.Entities; +using NetDaemon.HassModel.Entities.Core; + +namespace HomeAssistantGenerated; +public static class GeneratedExtensions +{ + ///Registers all injectable generated types in the serviceCollection + public static IServiceCollection AddHomeAssistantGenerated(this IServiceCollection serviceCollection) + { + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + serviceCollection.AddTransient(); + return serviceCollection; + } +} + +public interface IEntities +{ + BinarySensorEntities BinarySensor { get; } + + ButtonEntities Button { get; } + + DeviceTrackerEntities DeviceTracker { get; } + + InputBooleanEntities InputBoolean { get; } + + LightEntities Light { get; } + + MediaPlayerEntities MediaPlayer { get; } + + PersonEntities Person { get; } + + SelectEntities Select { get; } + + SensorEntities Sensor { get; } + + SunEntities Sun { get; } + + SwitchEntities Switch { get; } + + UpdateEntities Update { get; } + + WeatherEntities Weather { get; } + + ZoneEntities Zone { get; } + + InputButtonEntities InputButton { get; } + + ImageEntities Image { get; } + + InputNumberEntities InputNumber { get; } + + ScheduleEntities Schedule { get; } + + InputDatetimeEntities InputDatetime { get; } +} + +public partial class Entities : IEntities +{ + private readonly IHaContext _haContext; + public Entities(IHaContext haContext) + { + _haContext = haContext; + } + + public BinarySensorEntities BinarySensor => new(_haContext); + public ButtonEntities Button => new(_haContext); + public DeviceTrackerEntities DeviceTracker => new(_haContext); + public InputBooleanEntities InputBoolean => new(_haContext); + public LightEntities Light => new(_haContext); + public MediaPlayerEntities MediaPlayer => new(_haContext); + public PersonEntities Person => new(_haContext); + public SelectEntities Select => new(_haContext); + public SensorEntities Sensor => new(_haContext); + public SunEntities Sun => new(_haContext); + public SwitchEntities Switch => new(_haContext); + public UpdateEntities Update => new(_haContext); + public WeatherEntities Weather => new(_haContext); + public ZoneEntities Zone => new(_haContext); + public InputButtonEntities InputButton => new(_haContext); + public ImageEntities Image => new(_haContext); + public InputNumberEntities InputNumber => new(_haContext); + public ScheduleEntities Schedule => new(_haContext); + public InputDatetimeEntities InputDatetime => new(_haContext); +} + +public partial class BinarySensorEntities +{ + private readonly IHaContext _haContext; + public BinarySensorEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///FB00-AM-LM WAN-Status + public BinarySensorEntity Deengfb001WanStatus => new(_haContext, "binary_sensor.deengfb001_wan_status"); + ///deengph001 Is charging + public BinarySensorEntity Deengph001IsCharging => new(_haContext, "binary_sensor.deengph001_is_charging"); + ///deengph002 Is Charging + public BinarySensorEntity Deengph002IsCharging => new(_haContext, "binary_sensor.deengph002_is_charging"); + ///FB00-AM-LM Verbinden + public BinarySensorEntity Fb00AmLmVerbinden => new(_haContext, "binary_sensor.fb00_am_lm_verbinden"); + ///FB00-AM-LM Verbindung + public BinarySensorEntity Fb00AmLmVerbindung => new(_haContext, "binary_sensor.fb00_am_lm_verbindung"); + ///RPi Power status + public BinarySensorEntity RpiPowerStatus => new(_haContext, "binary_sensor.rpi_power_status"); + ///Workday Sensor + public BinarySensorEntity WorkdaySensor => new(_haContext, "binary_sensor.workday_sensor"); +} + +public partial class ButtonEntities +{ + private readonly IHaContext _haContext; + public ButtonEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///deengzb002dg-st-mx Identify + public ButtonEntity Deengzb002dgStMxIdentify => new(_haContext, "button.deengzb002dg_st_mx_identify"); + ///FB00-AM-LM Aufräumen + public ButtonEntity Fb00AmLmAufraumen => new(_haContext, "button.fb00_am_lm_aufraumen"); + ///FB00-AM-LM Firmware Update + public ButtonEntity Fb00AmLmFirmwareUpdate => new(_haContext, "button.fb00_am_lm_firmware_update"); + ///FB00-AM-LM Neu starten + public ButtonEntity Fb00AmLmNeuStarten => new(_haContext, "button.fb00_am_lm_neu_starten"); + ///FB00-AM-LM Neu verbinden + public ButtonEntity Fb00AmLmNeuVerbinden => new(_haContext, "button.fb00_am_lm_neu_verbinden"); + ///Google Assistant Geräte synchronisieren + public ButtonEntity SynchronizeDevices => new(_haContext, "button.synchronize_devices"); + ///_TZ3000_kdi2o9m6 TS011F Identify + public ButtonEntity Tz3000Kdi2o9m6Ts011fIdentify => new(_haContext, "button.tz3000_kdi2o9m6_ts011f_identify"); +} + +public partial class DeviceTrackerEntities +{ + private readonly IHaContext _haContext; + public DeviceTrackerEntities(IHaContext haContext) + { + _haContext = haContext; + } + + public DeviceTrackerEntity Accm80317e877768cd21577b => new(_haContext, "device_tracker.accm80317e877768cd21_577b"); + ///deengph002 + public DeviceTrackerEntity Android217ffb982e982cf9 => new(_haContext, "device_tracker.android_217ffb982e982cf9"); + ///android-792e9092fe50e529 + public DeviceTrackerEntity Android792e9092fe50e529 => new(_haContext, "device_tracker.android_792e9092fe50e529"); + public DeviceTrackerEntity Care6ee7 => new(_haContext, "device_tracker.care_6ee7"); + ///deengap001 + public DeviceTrackerEntity Deengap001dns => new(_haContext, "device_tracker.deengap001dns"); + ///deengha001 + public DeviceTrackerEntity Deengha001 => new(_haContext, "device_tracker.deengha001"); + ///deengna001 + public DeviceTrackerEntity Deengna001 => new(_haContext, "device_tracker.deengna001"); + ///deengna002 + public DeviceTrackerEntity Deengna002 => new(_haContext, "device_tracker.deengna002"); + ///deengna002 + public DeviceTrackerEntity Deengna0022 => new(_haContext, "device_tracker.deengna002_2"); + ///deengna003 + public DeviceTrackerEntity Deengna003 => new(_haContext, "device_tracker.deengna003"); + ///deengna003 + public DeviceTrackerEntity Deengna0032 => new(_haContext, "device_tracker.deengna003_2"); + ///deengna004 + public DeviceTrackerEntity Deengna004 => new(_haContext, "device_tracker.deengna004"); + ///deengna004 + public DeviceTrackerEntity Deengna0042 => new(_haContext, "device_tracker.deengna004_2"); + ///deengnb001 + public DeviceTrackerEntity Deengnb001stm => new(_haContext, "device_tracker.deengnb001stm"); + ///deengnb001 + public DeviceTrackerEntity Deengnb001stm2 => new(_haContext, "device_tracker.deengnb001stm_2"); + ///deengnb003lm + public DeviceTrackerEntity Deengnb003lm => new(_haContext, "device_tracker.deengnb003lm"); + ///deengns001 + public DeviceTrackerEntity Deengns001 => new(_haContext, "device_tracker.deengns001"); + ///deengns002 + public DeviceTrackerEntity Deengns002 => new(_haContext, "device_tracker.deengns002"); + ///deengpc001 + public DeviceTrackerEntity Deengpc001 => new(_haContext, "device_tracker.deengpc001"); + ///deengpc001 + public DeviceTrackerEntity Deengpc0012 => new(_haContext, "device_tracker.deengpc001_2"); + ///deengpc002 + public DeviceTrackerEntity Deengpc002 => new(_haContext, "device_tracker.deengpc002"); + ///deengph001 + public DeviceTrackerEntity Deengph001 => new(_haContext, "device_tracker.deengph001"); + ///deengph002 + public DeviceTrackerEntity Deengph002 => new(_haContext, "device_tracker.deengph002"); + ///deengpr001 + public DeviceTrackerEntity Deengpr001 => new(_haContext, "device_tracker.deengpr001"); + ///deengir002 + public DeviceTrackerEntity Deengrs001amln => new(_haContext, "device_tracker.deengrs001amln"); + ///deengsd001 + public DeviceTrackerEntity Deengsd001 => new(_haContext, "device_tracker.deengsd001"); + ///deengir001 + public DeviceTrackerEntity Deengsr002stm => new(_haContext, "device_tracker.deengsr002stm"); + ///deengst001amlm + public DeviceTrackerEntity Deengst001amlm => new(_haContext, "device_tracker.deengst001amlm"); + ///deengtv001 + public DeviceTrackerEntity Deengst002 => new(_haContext, "device_tracker.deengst002"); + ///deengws001 + public DeviceTrackerEntity Deengws001 => new(_haContext, "device_tracker.deengws001"); + public DeviceTrackerEntity Dp20Tovjt1951342ee4 => new(_haContext, "device_tracker.dp_2_0_tovjt195134_2ee4"); + public DeviceTrackerEntity Dp20Tovjx225777016a => new(_haContext, "device_tracker.dp_2_0_tovjx225777_016a"); + public DeviceTrackerEntity Dp20Tovjx37709625cd => new(_haContext, "device_tracker.dp_2_0_tovjx377096_25cd"); + public DeviceTrackerEntity Dp20Tovjx503147Ab20 => new(_haContext, "device_tracker.dp_2_0_tovjx503147_ab20"); + public DeviceTrackerEntity Dp21Togjy0244164639 => new(_haContext, "device_tracker.dp_2_1_togjy024416_4639"); + public DeviceTrackerEntity Dp21Togkx010618675a => new(_haContext, "device_tracker.dp_2_1_togkx010618_675a"); + public DeviceTrackerEntity Dp21Togkx189047Cd97 => new(_haContext, "device_tracker.dp_2_1_togkx189047_cd97"); + public DeviceTrackerEntity Dp21Togkx197117382c => new(_haContext, "device_tracker.dp_2_1_togkx197117_382c"); + public DeviceTrackerEntity Dp21Togky119454C3a5 => new(_haContext, "device_tracker.dp_2_1_togky119454_c3a5"); + public DeviceTrackerEntity Dp21Toglx117325528e => new(_haContext, "device_tracker.dp_2_1_toglx117325_528e"); + public DeviceTrackerEntity Dp21Togly034829B86e => new(_haContext, "device_tracker.dp_2_1_togly034829_b86e"); + public DeviceTrackerEntity Dp21Tognx012049E283 => new(_haContext, "device_tracker.dp_2_1_tognx012049_e283"); + public DeviceTrackerEntity Dp21Tormx105463A20b => new(_haContext, "device_tracker.dp_2_1_tormx105463_a20b"); + public DeviceTrackerEntity Drivedot2919235f => new(_haContext, "device_tracker.drivedot_2919_235f"); + public DeviceTrackerEntity Drivedot3372Ccf3 => new(_haContext, "device_tracker.drivedot_3372_ccf3"); + public DeviceTrackerEntity Drivedot4319C4fb => new(_haContext, "device_tracker.drivedot_4319_c4fb"); + public DeviceTrackerEntity Drivedot6574D1ef => new(_haContext, "device_tracker.drivedot_6574_d1ef"); + public DeviceTrackerEntity Drivedot9703Afa8 => new(_haContext, "device_tracker.drivedot_9703_afa8"); + public DeviceTrackerEntity Ooono3e7d => new(_haContext, "device_tracker.ooono_3e7d"); + public DeviceTrackerEntity Ooono80b1 => new(_haContext, "device_tracker.ooono_80b1"); + ///deengns002 + public DeviceTrackerEntity Pc265eBeffFe1e20f7 => new(_haContext, "device_tracker.pc_265e_beff_fe1e_20f7"); + ///deengph001 + public DeviceTrackerEntity RedmiNote9Pro => new(_haContext, "device_tracker.redmi_note_9_pro"); + public DeviceTrackerEntity Wsbc004011516t9fdc => new(_haContext, "device_tracker.wsbc004011516t_9fdc"); +} + +public partial class InputBooleanEntities +{ + private readonly IHaContext _haContext; + public InputBooleanEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///dev_netdaemon_net_daemon_apps_apps_call_service_event_handler_app + public InputBooleanEntity DevNetdaemonNetDaemonAppsAppsCallServiceEventHandlerApp => new(_haContext, "input_boolean.dev_netdaemon_net_daemon_apps_apps_call_service_event_handler_app"); + ///dev_netdaemon_net_daemon_apps_apps_persistance_handler_app + public InputBooleanEntity DevNetdaemonNetDaemonAppsAppsPersistanceHandlerApp => new(_haContext, "input_boolean.dev_netdaemon_net_daemon_apps_apps_persistance_handler_app"); + ///dev_netdaemon_net_daemon_apps_apps_scheduler + public InputBooleanEntity DevNetdaemonNetDaemonAppsAppsScheduler => new(_haContext, "input_boolean.dev_netdaemon_net_daemon_apps_apps_scheduler"); + ///netdaemon_net_daemon_apps_apps_call_service_event_handler_app + public InputBooleanEntity NetdaemonNetDaemonAppsAppsCallServiceEventHandlerApp => new(_haContext, "input_boolean.netdaemon_net_daemon_apps_apps_call_service_event_handler_app"); + ///netdaemon_net_daemon_apps_apps_deconz_event_handler_app + public InputBooleanEntity NetdaemonNetDaemonAppsAppsDeconzEventHandlerApp => new(_haContext, "input_boolean.netdaemon_net_daemon_apps_apps_deconz_event_handler_app"); + ///netdaemon_net_daemon_apps_apps_notify_handler_app + public InputBooleanEntity NetdaemonNetDaemonAppsAppsNotifyHandlerApp => new(_haContext, "input_boolean.netdaemon_net_daemon_apps_apps_notify_handler_app"); + ///netdaemon_net_daemon_apps_apps_persistance_handler_app + public InputBooleanEntity NetdaemonNetDaemonAppsAppsPersistanceHandlerApp => new(_haContext, "input_boolean.netdaemon_net_daemon_apps_apps_persistance_handler_app"); +} + +public partial class LightEntities +{ + private readonly IHaContext _haContext; + public LightEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///deengzb002dg-st-mx Light + public LightEntity Deengzb002dgStMxLight => new(_haContext, "light.deengzb002dg_st_mx_light"); + ///deengzb002dg-st-mx Light + public LightEntity Deengzb002dgStMxLight2 => new(_haContext, "light.deengzb002dg_st_mx_light_2"); + ///deengzb002dg-st-mx Light + public LightEntity Deengzb002dgStMxLight3 => new(_haContext, "light.deengzb002dg_st_mx_light_3"); + ///deengzb002dg-st-mx Light + public LightEntity Deengzb002dgStMxLight4 => new(_haContext, "light.deengzb002dg_st_mx_light_4"); + ///deengzb002dg-st-mx Light + public LightEntity Deengzb002dgStMxLight5 => new(_haContext, "light.deengzb002dg_st_mx_light_5"); +} + +public partial class MediaPlayerEntities +{ + private readonly IHaContext _haContext; + public MediaPlayerEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///deengir001 + public MediaPlayerEntity Deengir001 => new(_haContext, "media_player.deengir001"); + ///deengir001 + public MediaPlayerEntity Deengir0012 => new(_haContext, "media_player.deengir001_2"); + ///deengir002 + public MediaPlayerEntity Deengir002 => new(_haContext, "media_player.deengir002"); + ///deengir002 + public MediaPlayerEntity Deengir0022 => new(_haContext, "media_player.deengir002_2"); + ///deengsd001 + public MediaPlayerEntity Deengsd001 => new(_haContext, "media_player.deengsd001"); + ///VLC-TELNET + public MediaPlayerEntity VlcTelnet => new(_haContext, "media_player.vlc_telnet"); +} + +public partial class PersonEntities +{ + private readonly IHaContext _haContext; + public PersonEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///admin + public PersonEntity Admin => new(_haContext, "person.admin"); + ///mqtt-user + public PersonEntity MqttUser => new(_haContext, "person.mqtt_user"); + ///Stephan Maier + public PersonEntity StephanMaier => new(_haContext, "person.stephan_maier"); +} + +public partial class SelectEntities +{ + private readonly IHaContext _haContext; + public SelectEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///deengzb002dg-st-mx Start-up behavior + public SelectEntity Deengzb002dgStMxStartUpBehavior => new(_haContext, "select.deengzb002dg_st_mx_start_up_behavior"); + ///deengzb002dg-st-mx Start-up behavior + public SelectEntity Deengzb002dgStMxStartUpBehavior2 => new(_haContext, "select.deengzb002dg_st_mx_start_up_behavior_2"); + ///deengzb002dg-st-mx Start-up behavior + public SelectEntity Deengzb002dgStMxStartUpBehavior3 => new(_haContext, "select.deengzb002dg_st_mx_start_up_behavior_3"); + ///deengzb002dg-st-mx Start-up behavior + public SelectEntity Deengzb002dgStMxStartUpBehavior4 => new(_haContext, "select.deengzb002dg_st_mx_start_up_behavior_4"); + ///deengzb002dg-st-mx Start-up behavior + public SelectEntity Deengzb002dgStMxStartUpBehavior5 => new(_haContext, "select.deengzb002dg_st_mx_start_up_behavior_5"); + ///_TZ3000_kdi2o9m6 TS011F Backlight mode + public SelectEntity Tz3000Kdi2o9m6Ts011fBacklightMode => new(_haContext, "select.tz3000_kdi2o9m6_ts011f_backlight_mode"); + ///_TZ3000_kdi2o9m6 TS011F Power on state + public SelectEntity Tz3000Kdi2o9m6Ts011fPowerOnState => new(_haContext, "select.tz3000_kdi2o9m6_ts011f_power_on_state"); +} + +public partial class SensorEntities +{ + private readonly IHaContext _haContext; + public SensorEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///Canon TR4500 series + public SensorEntity CanonTr4500Series => new(_haContext, "sensor.canon_tr4500_series"); + ///FB00-AM-LM Externe IP + public SensorEntity Deengfb001ExternalIp => new(_haContext, "sensor.deengfb001_external_ip"); + ///deengph001 Battery state + public SensorEntity Deengph001BatteryState => new(_haContext, "sensor.deengph001_battery_state"); + ///deengph001 Charger type + public SensorEntity Deengph001ChargerType => new(_haContext, "sensor.deengph001_charger_type"); + ///deengph001 Next alarm + public SensorEntity Deengph001NextAlarm => new(_haContext, "sensor.deengph001_next_alarm"); + ///deengph002 Battery State + public SensorEntity Deengph002BatteryState => new(_haContext, "sensor.deengph002_battery_state"); + ///deengph002 Charger Type + public SensorEntity Deengph002ChargerType => new(_haContext, "sensor.deengph002_charger_type"); + ///FB00-AM-LM Externe IP + public SensorEntity Fb00AmLmExterneIp => new(_haContext, "sensor.fb00_am_lm_externe_ip"); + ///FB00-AM-LM Externe IPv6 + public SensorEntity Fb00AmLmExterneIpv6 => new(_haContext, "sensor.fb00_am_lm_externe_ipv6"); + ///FB00-AM-LM Letzter Neustart + public SensorEntity Fb00AmLmLetzterNeustart => new(_haContext, "sensor.fb00_am_lm_letzter_neustart"); + ///FB00-AM-LM Verbindungsverfügbarkeit + public SensorEntity Fb00AmLmVerbindungsverfugbarkeit => new(_haContext, "sensor.fb00_am_lm_verbindungsverfugbarkeit"); + ///Fritz!Box 7430 Call Monitor Deengtb100Stm + public SensorEntity FritzBox7430CallMonitorDeengtb100stm => new(_haContext, "sensor.fritz_box_7430_call_monitor_deengtb100stm"); + ///Moon Phase + public SensorEntity MoonPhase => new(_haContext, "sensor.moon_phase"); + ///Sun Nächste Morgendämmerung + public SensorEntity SunNextDawn => new(_haContext, "sensor.sun_next_dawn"); + ///Sun Nächste Abenddämmerung + public SensorEntity SunNextDusk => new(_haContext, "sensor.sun_next_dusk"); + ///Sun Nächste Mitternacht + public SensorEntity SunNextMidnight => new(_haContext, "sensor.sun_next_midnight"); + ///Sun Nächsten Mittag + public SensorEntity SunNextNoon => new(_haContext, "sensor.sun_next_noon"); + ///Sun Nächster Sonnenaufgang + public SensorEntity SunNextRising => new(_haContext, "sensor.sun_next_rising"); + ///Sun Nächster Sonnenuntergang + public SensorEntity SunNextSetting => new(_haContext, "sensor.sun_next_setting"); + ///deengzb002dg-st-mx LQI + public SensorEntity Tz3000Cfnprab5Ts011fLqi => new(_haContext, "sensor.tz3000_cfnprab5_ts011f_lqi"); + ///Geschätzte Entfernung + public NumericSensorEntity Accm80317e877768cd21577bGeschatzteEntfernung => new(_haContext, "sensor.accm80317e877768cd21_577b_geschatzte_entfernung"); + ///Canon TR4500 series Black + public NumericSensorEntity CanonTr4500SeriesBlack => new(_haContext, "sensor.canon_tr4500_series_black"); + ///Canon TR4500 series Color + public NumericSensorEntity CanonTr4500SeriesColor => new(_haContext, "sensor.canon_tr4500_series_color"); + ///Geschätzte Entfernung + public NumericSensorEntity Care6ee7GeschatzteEntfernung => new(_haContext, "sensor.care_6ee7_geschatzte_entfernung"); + ///FB00-AM-LM Download-Geschwindigkeit + public NumericSensorEntity Deengfb001KibSReceived => new(_haContext, "sensor.deengfb001_kib_s_received"); + ///FB00-AM-LM Upload-Geschwindigkeit + public NumericSensorEntity Deengfb001KibSSent => new(_haContext, "sensor.deengfb001_kib_s_sent"); + ///deengph001 Battery level + public NumericSensorEntity Deengph001BatteryLevel => new(_haContext, "sensor.deengph001_battery_level"); + ///deengph001 Battery temperature + public NumericSensorEntity Deengph001BatteryTemperature => new(_haContext, "sensor.deengph001_battery_temperature"); + ///deengph002 Battery Level + public NumericSensorEntity Deengph002BatteryLevel => new(_haContext, "sensor.deengph002_battery_level"); + ///deengph002 Battery Temperature + public NumericSensorEntity Deengph002BatteryTemperature => new(_haContext, "sensor.deengph002_battery_temperature"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp20Tovjt1951342ee4GeschatzteEntfernung => new(_haContext, "sensor.dp_2_0_tovjt195134_2ee4_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp20Tovjx225777016aGeschatzteEntfernung => new(_haContext, "sensor.dp_2_0_tovjx225777_016a_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp20Tovjx37709625cdGeschatzteEntfernung => new(_haContext, "sensor.dp_2_0_tovjx377096_25cd_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp20Tovjx503147Ab20GeschatzteEntfernung => new(_haContext, "sensor.dp_2_0_tovjx503147_ab20_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp21Togjy0244164639GeschatzteEntfernung => new(_haContext, "sensor.dp_2_1_togjy024416_4639_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp21Togkx010618675aGeschatzteEntfernung => new(_haContext, "sensor.dp_2_1_togkx010618_675a_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp21Togkx189047Cd97GeschatzteEntfernung => new(_haContext, "sensor.dp_2_1_togkx189047_cd97_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp21Togkx197117382cGeschatzteEntfernung => new(_haContext, "sensor.dp_2_1_togkx197117_382c_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp21Togky119454C3a5GeschatzteEntfernung => new(_haContext, "sensor.dp_2_1_togky119454_c3a5_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp21Toglx117325528eGeschatzteEntfernung => new(_haContext, "sensor.dp_2_1_toglx117325_528e_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp21Togly034829B86eGeschatzteEntfernung => new(_haContext, "sensor.dp_2_1_togly034829_b86e_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp21Tognx012049E283GeschatzteEntfernung => new(_haContext, "sensor.dp_2_1_tognx012049_e283_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Dp21Tormx105463A20bGeschatzteEntfernung => new(_haContext, "sensor.dp_2_1_tormx105463_a20b_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Drivedot2919235fGeschatzteEntfernung => new(_haContext, "sensor.drivedot_2919_235f_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Drivedot3372Ccf3GeschatzteEntfernung => new(_haContext, "sensor.drivedot_3372_ccf3_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Drivedot4319C4fbGeschatzteEntfernung => new(_haContext, "sensor.drivedot_4319_c4fb_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Drivedot6574D1efGeschatzteEntfernung => new(_haContext, "sensor.drivedot_6574_d1ef_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Drivedot9703Afa8GeschatzteEntfernung => new(_haContext, "sensor.drivedot_9703_afa8_geschatzte_entfernung"); + ///FB00-AM-LM Download-Durchsatz + public NumericSensorEntity Fb00AmLmDownloadDurchsatz => new(_haContext, "sensor.fb00_am_lm_download_durchsatz"); + ///FB00-AM-LM GB empfangen + public NumericSensorEntity Fb00AmLmGbEmpfangen => new(_haContext, "sensor.fb00_am_lm_gb_empfangen"); + ///FB00-AM-LM GB gesendet + public NumericSensorEntity Fb00AmLmGbGesendet => new(_haContext, "sensor.fb00_am_lm_gb_gesendet"); + ///FB00-AM-LM Link-Download-Durchsatz + public NumericSensorEntity Fb00AmLmLinkDownloadDurchsatz => new(_haContext, "sensor.fb00_am_lm_link_download_durchsatz"); + ///FB00-AM-LM Link-Download-Leistungsdämpfung + public NumericSensorEntity Fb00AmLmLinkDownloadLeistungsdampfung => new(_haContext, "sensor.fb00_am_lm_link_download_leistungsdampfung"); + ///FB00-AM-LM Link-Upload-Durchsatz + public NumericSensorEntity Fb00AmLmLinkUploadDurchsatz => new(_haContext, "sensor.fb00_am_lm_link_upload_durchsatz"); + ///FB00-AM-LM Link-Upload-Leistungsdämpfung + public NumericSensorEntity Fb00AmLmLinkUploadLeistungsdampfung => new(_haContext, "sensor.fb00_am_lm_link_upload_leistungsdampfung"); + ///FB00-AM-LM Maximaler Download-Durchsatz der Verbindung + public NumericSensorEntity Fb00AmLmMaximalerDownloadDurchsatzDerVerbindung => new(_haContext, "sensor.fb00_am_lm_maximaler_download_durchsatz_der_verbindung"); + ///FB00-AM-LM Maximaler Upload-Durchsatz der Verbindung + public NumericSensorEntity Fb00AmLmMaximalerUploadDurchsatzDerVerbindung => new(_haContext, "sensor.fb00_am_lm_maximaler_upload_durchsatz_der_verbindung"); + ///FB00-AM-LM Rauschabstand zum Link-Download + public NumericSensorEntity Fb00AmLmRauschabstandZumLinkDownload => new(_haContext, "sensor.fb00_am_lm_rauschabstand_zum_link_download"); + ///FB00-AM-LM Rauschabstand zum Link-Upload + public NumericSensorEntity Fb00AmLmRauschabstandZumLinkUpload => new(_haContext, "sensor.fb00_am_lm_rauschabstand_zum_link_upload"); + ///FB00-AM-LM Upload-Durchsatz + public NumericSensorEntity Fb00AmLmUploadDurchsatz => new(_haContext, "sensor.fb00_am_lm_upload_durchsatz"); + ///hacs + public NumericSensorEntity Hacs => new(_haContext, "sensor.hacs"); + ///FB00-AM-LM Download-Geschwindigkeit + public NumericSensorEntity Internetgatewaydevicev2Deengfb001KibSReceived => new(_haContext, "sensor.internetgatewaydevicev2_deengfb001_kib_s_received"); + ///FB00-AM-LM Upload-Geschwindigkeit + public NumericSensorEntity Internetgatewaydevicev2Deengfb001KibSSent => new(_haContext, "sensor.internetgatewaydevicev2_deengfb001_kib_s_sent"); + ///Geschätzte Entfernung + public NumericSensorEntity Ooono3e7dGeschatzteEntfernung => new(_haContext, "sensor.ooono_3e7d_geschatzte_entfernung"); + ///Geschätzte Entfernung + public NumericSensorEntity Ooono80b1GeschatzteEntfernung => new(_haContext, "sensor.ooono_80b1_geschatzte_entfernung"); + ///Sun Azimut + public NumericSensorEntity SunSolarAzimuth => new(_haContext, "sensor.sun_solar_azimuth"); + ///Sun Sonnenhöhe + public NumericSensorEntity SunSolarElevation => new(_haContext, "sensor.sun_solar_elevation"); + ///deengzb002dg-st-mx RSSI + public NumericSensorEntity Tz3000Cfnprab5Ts011fRssi => new(_haContext, "sensor.tz3000_cfnprab5_ts011f_rssi"); + ///Geschätzte Entfernung + public NumericSensorEntity Wsbc004011516t9fdcGeschatzteEntfernung => new(_haContext, "sensor.wsbc004011516t_9fdc_geschatzte_entfernung"); +} + +public partial class SunEntities +{ + private readonly IHaContext _haContext; + public SunEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///Sun + public SunEntity Sun => new(_haContext, "sun.sun"); +} + +public partial class SwitchEntities +{ + private readonly IHaContext _haContext; + public SwitchEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///deengph002 Internet Access + public SwitchEntity Android217ffb982e982cf9InternetAccess => new(_haContext, "switch.android_217ffb982e982cf9_internet_access"); + ///android-792e9092fe50e529 Internet Access + public SwitchEntity Android792e9092fe50e529InternetAccess => new(_haContext, "switch.android_792e9092fe50e529_internet_access"); + ///deengap001 Internet Access + public SwitchEntity Deengap001dnsInternetAccess => new(_haContext, "switch.deengap001dns_internet_access"); + ///deengha001 Internet Access + public SwitchEntity Deengha001InternetAccess => new(_haContext, "switch.deengha001_internet_access"); + ///deengna001 Internet Access + public SwitchEntity Deengna001InternetAccess => new(_haContext, "switch.deengna001_internet_access"); + ///deengna002 Internet Access + public SwitchEntity Deengna002InternetAccess => new(_haContext, "switch.deengna002_internet_access"); + ///deengna002 Internet Access + public SwitchEntity Deengna002InternetAccess2 => new(_haContext, "switch.deengna002_internet_access_2"); + ///deengna003 Internet Access + public SwitchEntity Deengna003InternetAccess => new(_haContext, "switch.deengna003_internet_access"); + ///deengna003 Internet Access + public SwitchEntity Deengna003InternetAccess2 => new(_haContext, "switch.deengna003_internet_access_2"); + ///deengna004 Internet Access + public SwitchEntity Deengna004InternetAccess => new(_haContext, "switch.deengna004_internet_access"); + ///deengna004 Internet Access + public SwitchEntity Deengna004InternetAccess2 => new(_haContext, "switch.deengna004_internet_access_2"); + ///deengnb001 Internet Access + public SwitchEntity Deengnb001stmInternetAccess => new(_haContext, "switch.deengnb001stm_internet_access"); + ///deengnb001 Internet Access + public SwitchEntity Deengnb001stmInternetAccess2 => new(_haContext, "switch.deengnb001stm_internet_access_2"); + ///deengnb003lm Internet Access + public SwitchEntity Deengnb003lmInternetAccess => new(_haContext, "switch.deengnb003lm_internet_access"); + ///deengns001 Internet Access + public SwitchEntity Deengns001InternetAccess => new(_haContext, "switch.deengns001_internet_access"); + ///deengns002 Internet Access + public SwitchEntity Deengns002InternetAccess => new(_haContext, "switch.deengns002_internet_access"); + ///deengpc001 Internet Access + public SwitchEntity Deengpc001InternetAccess => new(_haContext, "switch.deengpc001_internet_access"); + ///deengpc001 Internet Access + public SwitchEntity Deengpc001InternetAccess2 => new(_haContext, "switch.deengpc001_internet_access_2"); + ///deengpc002 Internet Access + public SwitchEntity Deengpc002InternetAccess => new(_haContext, "switch.deengpc002_internet_access"); + ///deengpr001 Internet Access + public SwitchEntity Deengpr001InternetAccess => new(_haContext, "switch.deengpr001_internet_access"); + ///deengir002 Internet Access + public SwitchEntity Deengrs001amlnInternetAccess => new(_haContext, "switch.deengrs001amln_internet_access"); + ///deengsd001 Internet Access + public SwitchEntity Deengsd001InternetAccess => new(_haContext, "switch.deengsd001_internet_access"); + ///deengir001 Internet Access + public SwitchEntity Deengsr002stmInternetAccess => new(_haContext, "switch.deengsr002stm_internet_access"); + ///deengst001amlm Internet Access + public SwitchEntity Deengst001amlmInternetAccess => new(_haContext, "switch.deengst001amlm_internet_access"); + ///deengtv001 Internet Access + public SwitchEntity Deengst002InternetAccess => new(_haContext, "switch.deengst002_internet_access"); + ///deengws001 Internet Access + public SwitchEntity Deengws001InternetAccess => new(_haContext, "switch.deengws001_internet_access"); + ///FB00-AM-LM Call deflection 0 + public SwitchEntity Fb00AmLmCallDeflection0 => new(_haContext, "switch.fb00_am_lm_call_deflection_0"); + ///FB00-AM-LM Call deflection 1 + public SwitchEntity Fb00AmLmCallDeflection1 => new(_haContext, "switch.fb00_am_lm_call_deflection_1"); + ///FB00-AM-LM Port forward 137-139 + public SwitchEntity Fb00AmLmPortForward137139 => new(_haContext, "switch.fb00_am_lm_port_forward_137_139"); + ///FB00-AM-LM Port forward 443 + public SwitchEntity Fb00AmLmPortForward443 => new(_haContext, "switch.fb00_am_lm_port_forward_443"); + ///FB00-AM-LM Port forward 445 + public SwitchEntity Fb00AmLmPortForward445 => new(_haContext, "switch.fb00_am_lm_port_forward_445"); + ///FB00-AM-LM Wi-Fi deengwl001 + public SwitchEntity Fb00AmLmWiFiDeengwl001 => new(_haContext, "switch.fb00_am_lm_wi_fi_deengwl001"); + ///FB00-AM-LM Wi-Fi FB00-AM-LM Gastzugang + public SwitchEntity Fb00AmLmWiFiFb00AmLmGastzugang => new(_haContext, "switch.fb00_am_lm_wi_fi_fb00_am_lm_gastzugang"); + ///deengns002 Internet Access + public SwitchEntity Pc265eBeffFe1e20f7InternetAccess => new(_haContext, "switch.pc_265e_beff_fe1e_20f7_internet_access"); + ///deengph001 Internet Access + public SwitchEntity RedmiNote9ProInternetAccess => new(_haContext, "switch.redmi_note_9_pro_internet_access"); + ///stm + public SwitchEntity Stm => new(_haContext, "switch.stm"); + ///_TZ3000_kdi2o9m6 TS011F Switch + public SwitchEntity Tz3000Kdi2o9m6Ts011fSwitch => new(_haContext, "switch.tz3000_kdi2o9m6_ts011f_switch"); +} + +public partial class UpdateEntities +{ + private readonly IHaContext _haContext; + public UpdateEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///Duck DNS Update + public UpdateEntity DuckDnsUpdate => new(_haContext, "update.duck_dns_update"); + ///FB00-AM-LM FRITZ!OS + public UpdateEntity Fb00AmLmFritzOs => new(_haContext, "update.fb00_am_lm_fritz_os"); + ///File editor Update + public UpdateEntity FileEditorUpdate => new(_haContext, "update.file_editor_update"); + ///Google Assistant SDK Update + public UpdateEntity GoogleAssistantSdkUpdate => new(_haContext, "update.google_assistant_sdk_update"); + ///Home Assistant Core Update + public UpdateEntity HomeAssistantCoreUpdate => new(_haContext, "update.home_assistant_core_update"); + ///Home Assistant Operating System Update + public UpdateEntity HomeAssistantOperatingSystemUpdate => new(_haContext, "update.home_assistant_operating_system_update"); + ///Home Assistant Supervisor Update + public UpdateEntity HomeAssistantSupervisorUpdate => new(_haContext, "update.home_assistant_supervisor_update"); + ///NetDaemon V3.1 (.NET 7) Update + public UpdateEntity NetdaemonV31Net7Update => new(_haContext, "update.netdaemon_v3_1_net_7_update"); + ///NGINX Home Assistant SSL proxy Update + public UpdateEntity NginxHomeAssistantSslProxyUpdate => new(_haContext, "update.nginx_home_assistant_ssl_proxy_update"); + ///RPC Shutdown Update + public UpdateEntity RpcShutdownUpdate => new(_haContext, "update.rpc_shutdown_update"); + ///Samba share Update + public UpdateEntity SambaShareUpdate => new(_haContext, "update.samba_share_update"); + ///Studio Code Server Update + public UpdateEntity StudioCodeServerUpdate => new(_haContext, "update.studio_code_server_update"); + ///Terminal & SSH Update + public UpdateEntity TerminalSshUpdate => new(_haContext, "update.terminal_ssh_update"); + ///Vaultwarden (Bitwarden) Update + public UpdateEntity VaultwardenBitwardenUpdate => new(_haContext, "update.vaultwarden_bitwarden_update"); + ///VLC Update + public UpdateEntity VlcUpdate => new(_haContext, "update.vlc_update"); +} + +public partial class WeatherEntities +{ + private readonly IHaContext _haContext; + public WeatherEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///Forecast Home + public WeatherEntity ForecastHome => new(_haContext, "weather.forecast_home"); +} + +public partial class ZoneEntities +{ + private readonly IHaContext _haContext; + public ZoneEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///Fondium + public ZoneEntity Fondium => new(_haContext, "zone.fondium"); + ///Home + public ZoneEntity Home => new(_haContext, "zone.home"); + ///Kletterwerk + public ZoneEntity Kletterwerk => new(_haContext, "zone.kletterwerk"); +} + +public partial class InputButtonEntities +{ + private readonly IHaContext _haContext; + public InputButtonEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///deengzb002dg-st-mx.btnOnOff + public InputButtonEntity Deengzb002dgStMxBtnonoff => new(_haContext, "input_button.deengzb002dg_st_mx_btnonoff"); + ///deengzb002dg-st-mx.btnOnOff.TvPc + public InputButtonEntity Deengzb002dgStMxBtnonoffTvpc => new(_haContext, "input_button.deengzb002dg_st_mx_btnonoff_tvpc"); + ///tmp + public InputButtonEntity Tmp => new(_haContext, "input_button.tmp"); + ///tmp2 + public InputButtonEntity Tmp2 => new(_haContext, "input_button.tmp2"); + ///tmp3 + public InputButtonEntity Tmp3 => new(_haContext, "input_button.tmp3"); + ///tmp4 + public InputButtonEntity Tmp4 => new(_haContext, "input_button.tmp4"); + ///tmp5 + public InputButtonEntity Tmp5 => new(_haContext, "input_button.tmp5"); + ///tmp6 + public InputButtonEntity Tmp6 => new(_haContext, "input_button.tmp6"); +} + +public partial class ImageEntities +{ + private readonly IHaContext _haContext; + public ImageEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///FB00-AM-LM FB00-AM-LM Gastzugang + public ImageEntity Fb00AmLmFb00AmLmGastzugang => new(_haContext, "image.fb00_am_lm_fb00_am_lm_gastzugang"); +} + +public partial class InputNumberEntities +{ + private readonly IHaContext _haContext; + public InputNumberEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///test_number + public InputNumberEntity TestNumber => new(_haContext, "input_number.test_number"); +} + +public partial class ScheduleEntities +{ + private readonly IHaContext _haContext; + public ScheduleEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///test + public ScheduleEntity Test => new(_haContext, "schedule.test"); +} + +public partial class InputDatetimeEntities +{ + private readonly IHaContext _haContext; + public InputDatetimeEntities(IHaContext haContext) + { + _haContext = haContext; + } + + ///uhr + public InputDatetimeEntity Uhr => new(_haContext, "input_datetime.uhr"); +} + +public partial record BinarySensorEntity : Entity, BinarySensorAttributes> +{ + public BinarySensorEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public BinarySensorEntity(Entity entity) : base(entity) + { + } +} + +public partial record BinarySensorAttributes +{ + [JsonPropertyName("device_class")] + public string? DeviceClass { get; init; } + + [JsonPropertyName("icon")] + public string? Icon { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } + + [JsonPropertyName("workdays")] + public IReadOnlyList? Workdays { get; init; } + + [JsonPropertyName("excludes")] + public IReadOnlyList? Excludes { get; init; } + + [JsonPropertyName("days_offset")] + public double? DaysOffset { get; init; } +} + +public partial record ButtonEntity : Entity, ButtonAttributes> +{ + public ButtonEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public ButtonEntity(Entity entity) : base(entity) + { + } +} + +public partial record ButtonAttributes +{ + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } + + [JsonPropertyName("device_class")] + public string? DeviceClass { get; init; } + + [JsonPropertyName("icon")] + public string? Icon { get; init; } +} + +public partial record DeviceTrackerEntity : Entity, DeviceTrackerAttributes> +{ + public DeviceTrackerEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public DeviceTrackerEntity(Entity entity) : base(entity) + { + } +} + +public partial record DeviceTrackerAttributes +{ + [JsonPropertyName("source_type")] + public string? SourceType { get; init; } + + [JsonPropertyName("latitude")] + public double? Latitude { get; init; } + + [JsonPropertyName("longitude")] + public double? Longitude { get; init; } + + [JsonPropertyName("gps_accuracy")] + public double? GpsAccuracy { get; init; } + + [JsonPropertyName("altitude")] + public double? Altitude { get; init; } + + [JsonPropertyName("course")] + public double? Course { get; init; } + + [JsonPropertyName("speed")] + public double? Speed { get; init; } + + [JsonPropertyName("vertical_accuracy")] + public double? VerticalAccuracy { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } + + [JsonPropertyName("ip")] + public string? Ip { get; init; } + + [JsonPropertyName("mac")] + public string? Mac { get; init; } + + [JsonPropertyName("host_name")] + public string? HostName { get; init; } + + [JsonPropertyName("last_time_reachable")] + public string? LastTimeReachable { get; init; } + + [JsonPropertyName("icon")] + public string? Icon { get; init; } + + [JsonPropertyName("connected_to")] + public string? ConnectedTo { get; init; } + + [JsonPropertyName("connection_type")] + public string? ConnectionType { get; init; } + + [JsonPropertyName("ssid")] + public string? Ssid { get; init; } + + [JsonPropertyName("restored")] + public bool? Restored { get; init; } + + [JsonPropertyName("supported_features")] + public double? SupportedFeatures { get; init; } + + [JsonPropertyName("uuid")] + public string? Uuid { get; init; } + + [JsonPropertyName("major")] + public double? Major { get; init; } + + [JsonPropertyName("minor")] + public double? Minor { get; init; } + + [JsonPropertyName("source")] + public string? Source { get; init; } +} + +public partial record InputBooleanEntity : Entity, InputBooleanAttributes> +{ + public InputBooleanEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public InputBooleanEntity(Entity entity) : base(entity) + { + } +} + +public partial record InputBooleanAttributes +{ + [JsonPropertyName("editable")] + public bool? Editable { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } +} + +public partial record LightEntity : Entity, LightAttributes> +{ + public LightEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public LightEntity(Entity entity) : base(entity) + { + } +} + +public partial record LightAttributes +{ + [JsonPropertyName("supported_color_modes")] + public IReadOnlyList? SupportedColorModes { get; init; } + + [JsonPropertyName("off_with_transition")] + public bool? OffWithTransition { get; init; } + + [JsonPropertyName("off_brightness")] + public object? OffBrightness { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } + + [JsonPropertyName("supported_features")] + public double? SupportedFeatures { get; init; } + + [JsonPropertyName("color_mode")] + public string? ColorMode { get; init; } +} + +public partial record MediaPlayerEntity : Entity, MediaPlayerAttributes> +{ + public MediaPlayerEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public MediaPlayerEntity(Entity entity) : base(entity) + { + } +} + +public partial record MediaPlayerAttributes +{ + [JsonPropertyName("volume_level")] + public double? VolumeLevel { get; init; } + + [JsonPropertyName("media_content_type")] + public string? MediaContentType { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } + + [JsonPropertyName("supported_features")] + public double? SupportedFeatures { get; init; } + + [JsonPropertyName("device_class")] + public string? DeviceClass { get; init; } + + [JsonPropertyName("source_list")] + public IReadOnlyList? SourceList { get; init; } + + [JsonPropertyName("sound_mode_list")] + public IReadOnlyList? SoundModeList { get; init; } + + [JsonPropertyName("is_volume_muted")] + public bool? IsVolumeMuted { get; init; } + + [JsonPropertyName("media_content_id")] + public string? MediaContentId { get; init; } + + [JsonPropertyName("media_duration")] + public double? MediaDuration { get; init; } + + [JsonPropertyName("media_position")] + public double? MediaPosition { get; init; } + + [JsonPropertyName("media_position_updated_at")] + public string? MediaPositionUpdatedAt { get; init; } + + [JsonPropertyName("media_track")] + public double? MediaTrack { get; init; } + + [JsonPropertyName("shuffle")] + public bool? Shuffle { get; init; } + + [JsonPropertyName("repeat")] + public string? Repeat { get; init; } +} + +public partial record PersonEntity : Entity, PersonAttributes> +{ + public PersonEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public PersonEntity(Entity entity) : base(entity) + { + } +} + +public partial record PersonAttributes +{ + [JsonPropertyName("editable")] + public bool? Editable { get; init; } + + [JsonPropertyName("id")] + public string? Id { get; init; } + + [JsonPropertyName("latitude")] + public double? Latitude { get; init; } + + [JsonPropertyName("longitude")] + public double? Longitude { get; init; } + + [JsonPropertyName("gps_accuracy")] + public double? GpsAccuracy { get; init; } + + [JsonPropertyName("source")] + public string? Source { get; init; } + + [JsonPropertyName("user_id")] + public string? UserId { get; init; } + + [JsonPropertyName("device_trackers")] + public IReadOnlyList? DeviceTrackers { get; init; } + + [JsonPropertyName("entity_picture")] + public string? EntityPicture { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } +} + +public partial record SelectEntity : Entity, SelectAttributes> +{ + public SelectEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public SelectEntity(Entity entity) : base(entity) + { + } +} + +public partial record SelectAttributes +{ + [JsonPropertyName("options")] + public IReadOnlyList? Options { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } +} + +public partial record SensorEntity : Entity, SensorAttributes> +{ + public SensorEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public SensorEntity(Entity entity) : base(entity) + { + } +} + +public partial record SensorAttributes +{ + [JsonPropertyName("device_class")] + public string? DeviceClass { get; init; } + + [JsonPropertyName("icon")] + public string? Icon { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } + + [JsonPropertyName("options")] + public IReadOnlyList? Options { get; init; } + + [JsonPropertyName("info")] + public string? Info { get; init; } + + [JsonPropertyName("serial")] + public object? Serial { get; init; } + + [JsonPropertyName("location")] + public string? Location { get; init; } + + [JsonPropertyName("state_message")] + public object? StateMessage { get; init; } + + [JsonPropertyName("state_reason")] + public object? StateReason { get; init; } + + [JsonPropertyName("command_set")] + public string? CommandSet { get; init; } + + [JsonPropertyName("uri_supported")] + public IReadOnlyList? UriSupported { get; init; } + + [JsonPropertyName("state_class")] + public string? StateClass { get; init; } +} + +public partial record NumericSensorEntity : NumericEntity, NumericSensorAttributes> +{ + public NumericSensorEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public NumericSensorEntity(Entity entity) : base(entity) + { + } +} + +public partial record NumericSensorAttributes +{ + [JsonPropertyName("marker_high_level")] + public double? MarkerHighLevel { get; init; } + + [JsonPropertyName("marker_low_level")] + public double? MarkerLowLevel { get; init; } + + [JsonPropertyName("marker_type")] + public string? MarkerType { get; init; } + + [JsonPropertyName("unit_of_measurement")] + public string? UnitOfMeasurement { get; init; } + + [JsonPropertyName("icon")] + public string? Icon { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } + + [JsonPropertyName("device_class")] + public string? DeviceClass { get; init; } + + [JsonPropertyName("state_class")] + public string? StateClass { get; init; } + + [JsonPropertyName("repositories")] + public IReadOnlyList? Repositories { get; init; } + + [JsonPropertyName("uuid")] + public string? Uuid { get; init; } + + [JsonPropertyName("major")] + public double? Major { get; init; } + + [JsonPropertyName("minor")] + public double? Minor { get; init; } + + [JsonPropertyName("source")] + public string? Source { get; init; } + + [JsonPropertyName("restored")] + public bool? Restored { get; init; } + + [JsonPropertyName("supported_features")] + public double? SupportedFeatures { get; init; } +} + +public partial record SunEntity : Entity, SunAttributes> +{ + public SunEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public SunEntity(Entity entity) : base(entity) + { + } +} + +public partial record SunAttributes +{ + [JsonPropertyName("next_dawn")] + public string? NextDawn { get; init; } + + [JsonPropertyName("next_dusk")] + public string? NextDusk { get; init; } + + [JsonPropertyName("next_midnight")] + public string? NextMidnight { get; init; } + + [JsonPropertyName("next_noon")] + public string? NextNoon { get; init; } + + [JsonPropertyName("next_rising")] + public string? NextRising { get; init; } + + [JsonPropertyName("next_setting")] + public string? NextSetting { get; init; } + + [JsonPropertyName("elevation")] + public double? Elevation { get; init; } + + [JsonPropertyName("azimuth")] + public double? Azimuth { get; init; } + + [JsonPropertyName("rising")] + public bool? Rising { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } +} + +public partial record SwitchEntity : Entity, SwitchAttributes> +{ + public SwitchEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public SwitchEntity(Entity entity) : base(entity) + { + } +} + +public partial record SwitchAttributes +{ + [JsonPropertyName("type")] + public string? Type { get; init; } + + [JsonPropertyName("number")] + public string? Number { get; init; } + + [JsonPropertyName("deflection_to_number")] + public object? DeflectionToNumber { get; init; } + + [JsonPropertyName("mode")] + public string? Mode { get; init; } + + [JsonPropertyName("outgoing")] + public object? Outgoing { get; init; } + + [JsonPropertyName("phonebook_id")] + public object? PhonebookId { get; init; } + + [JsonPropertyName("icon")] + public string? Icon { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } + + [JsonPropertyName("internal_ip")] + public string? InternalIp { get; init; } + + [JsonPropertyName("internal_port")] + public double? InternalPort { get; init; } + + [JsonPropertyName("external_port")] + public object? ExternalPort { get; init; } + + [JsonPropertyName("protocol")] + public string? Protocol { get; init; } + + [JsonPropertyName("description")] + public string? Description { get; init; } + + [JsonPropertyName("standard")] + public string? Standard { get; init; } + + [JsonPropertyName("bssid")] + public string? Bssid { get; init; } + + [JsonPropertyName("mac_address_control")] + public bool? MacAddressControl { get; init; } + + [JsonPropertyName("restored")] + public bool? Restored { get; init; } + + [JsonPropertyName("supported_features")] + public double? SupportedFeatures { get; init; } +} + +public partial record UpdateEntity : Entity, UpdateAttributes> +{ + public UpdateEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public UpdateEntity(Entity entity) : base(entity) + { + } +} + +public partial record UpdateAttributes +{ + [JsonPropertyName("auto_update")] + public bool? AutoUpdate { get; init; } + + [JsonPropertyName("installed_version")] + public string? InstalledVersion { get; init; } + + [JsonPropertyName("in_progress")] + public bool? InProgress { get; init; } + + [JsonPropertyName("latest_version")] + public string? LatestVersion { get; init; } + + [JsonPropertyName("release_summary")] + public string? ReleaseSummary { get; init; } + + [JsonPropertyName("release_url")] + public string? ReleaseUrl { get; init; } + + [JsonPropertyName("skipped_version")] + public object? SkippedVersion { get; init; } + + [JsonPropertyName("title")] + public string? Title { get; init; } + + [JsonPropertyName("entity_picture")] + public string? EntityPicture { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } + + [JsonPropertyName("supported_features")] + public double? SupportedFeatures { get; init; } +} + +public partial record WeatherEntity : Entity, WeatherAttributes> +{ + public WeatherEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public WeatherEntity(Entity entity) : base(entity) + { + } +} + +public partial record WeatherAttributes +{ + [JsonPropertyName("temperature")] + public double? Temperature { get; init; } + + [JsonPropertyName("temperature_unit")] + public string? TemperatureUnit { get; init; } + + [JsonPropertyName("humidity")] + public double? Humidity { get; init; } + + [JsonPropertyName("cloud_coverage")] + public double? CloudCoverage { get; init; } + + [JsonPropertyName("pressure")] + public double? Pressure { get; init; } + + [JsonPropertyName("pressure_unit")] + public string? PressureUnit { get; init; } + + [JsonPropertyName("wind_bearing")] + public double? WindBearing { get; init; } + + [JsonPropertyName("wind_speed")] + public double? WindSpeed { get; init; } + + [JsonPropertyName("wind_speed_unit")] + public string? WindSpeedUnit { get; init; } + + [JsonPropertyName("visibility_unit")] + public string? VisibilityUnit { get; init; } + + [JsonPropertyName("precipitation_unit")] + public string? PrecipitationUnit { get; init; } + + [JsonPropertyName("forecast")] + public IReadOnlyList? Forecast { get; init; } + + [JsonPropertyName("attribution")] + public string? Attribution { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } +} + +public partial record ZoneEntity : Entity, ZoneAttributes> +{ + public ZoneEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public ZoneEntity(Entity entity) : base(entity) + { + } +} + +public partial record ZoneAttributes +{ + [JsonPropertyName("latitude")] + public double? Latitude { get; init; } + + [JsonPropertyName("longitude")] + public double? Longitude { get; init; } + + [JsonPropertyName("radius")] + public double? Radius { get; init; } + + [JsonPropertyName("passive")] + public bool? Passive { get; init; } + + [JsonPropertyName("persons")] + public IReadOnlyList? Persons { get; init; } + + [JsonPropertyName("editable")] + public bool? Editable { get; init; } + + [JsonPropertyName("icon")] + public string? Icon { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } +} + +public partial record InputButtonEntity : Entity, InputButtonAttributes> +{ + public InputButtonEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public InputButtonEntity(Entity entity) : base(entity) + { + } +} + +public partial record InputButtonAttributes +{ + [JsonPropertyName("editable")] + public bool? Editable { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } +} + +public partial record ImageEntity : Entity, ImageAttributes> +{ + public ImageEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public ImageEntity(Entity entity) : base(entity) + { + } +} + +public partial record ImageAttributes +{ + [JsonPropertyName("access_token")] + public string? AccessToken { get; init; } + + [JsonPropertyName("entity_picture")] + public string? EntityPicture { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } +} + +public partial record InputNumberEntity : NumericEntity, InputNumberAttributes> +{ + public InputNumberEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public InputNumberEntity(Entity entity) : base(entity) + { + } +} + +public partial record InputNumberAttributes +{ + [JsonPropertyName("initial")] + public object? Initial { get; init; } + + [JsonPropertyName("editable")] + public bool? Editable { get; init; } + + [JsonPropertyName("min")] + public double? Min { get; init; } + + [JsonPropertyName("max")] + public double? Max { get; init; } + + [JsonPropertyName("step")] + public double? Step { get; init; } + + [JsonPropertyName("mode")] + public string? Mode { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } +} + +public partial record ScheduleEntity : Entity, ScheduleAttributes> +{ + public ScheduleEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public ScheduleEntity(Entity entity) : base(entity) + { + } +} + +public partial record ScheduleAttributes +{ + [JsonPropertyName("editable")] + public bool? Editable { get; init; } + + [JsonPropertyName("next_event")] + public string? NextEvent { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } +} + +public partial record InputDatetimeEntity : Entity, InputDatetimeAttributes> +{ + public InputDatetimeEntity(IHaContext haContext, string entityId) : base(haContext, entityId) + { + } + + public InputDatetimeEntity(Entity entity) : base(entity) + { + } +} + +public partial record InputDatetimeAttributes +{ + [JsonPropertyName("has_date")] + public bool? HasDate { get; init; } + + [JsonPropertyName("has_time")] + public bool? HasTime { get; init; } + + [JsonPropertyName("editable")] + public bool? Editable { get; init; } + + [JsonPropertyName("hour")] + public double? Hour { get; init; } + + [JsonPropertyName("minute")] + public double? Minute { get; init; } + + [JsonPropertyName("second")] + public double? Second { get; init; } + + [JsonPropertyName("timestamp")] + public double? Timestamp { get; init; } + + [JsonPropertyName("friendly_name")] + public string? FriendlyName { get; init; } +} + +public interface IServices +{ + AlarmControlPanelServices AlarmControlPanel { get; } + + AutomationServices Automation { get; } + + ButtonServices Button { get; } + + CameraServices Camera { get; } + + CastServices Cast { get; } + + ClimateServices Climate { get; } + + CloudServices Cloud { get; } + + ConversationServices Conversation { get; } + + CounterServices Counter { get; } + + CoverServices Cover { get; } + + DeviceTrackerServices DeviceTracker { get; } + + FanServices Fan { get; } + + FritzServices Fritz { get; } + + FrontendServices Frontend { get; } + + GoogleAssistantServices GoogleAssistant { get; } + + HassioServices Hassio { get; } + + HomeassistantServices Homeassistant { get; } + + HumidifierServices Humidifier { get; } + + InputBooleanServices InputBoolean { get; } + + InputButtonServices InputButton { get; } + + InputDatetimeServices InputDatetime { get; } + + InputNumberServices InputNumber { get; } + + InputSelectServices InputSelect { get; } + + InputTextServices InputText { get; } + + LightServices Light { get; } + + LockServices Lock { get; } + + LogbookServices Logbook { get; } + + LoggerServices Logger { get; } + + MediaPlayerServices MediaPlayer { get; } + + MqttServices Mqtt { get; } + + NetdaemonServices Netdaemon { get; } + + NotifyServices Notify { get; } + + NumberServices Number { get; } + + PersistentNotificationServices PersistentNotification { get; } + + PersonServices Person { get; } + + RecorderServices Recorder { get; } + + RestServices Rest { get; } + + SceneServices Scene { get; } + + ScheduleServices Schedule { get; } + + ScriptServices Script { get; } + + SelectServices Select { get; } + + SirenServices Siren { get; } + + SwitchServices Switch { get; } + + SystemLogServices SystemLog { get; } + + TextServices Text { get; } + + TimerServices Timer { get; } + + TtsServices Tts { get; } + + UpdateServices Update { get; } + + VacuumServices Vacuum { get; } + + WaterHeaterServices WaterHeater { get; } + + ZhaServices Zha { get; } + + ZoneServices Zone { get; } +} + +public partial class Services : IServices +{ + private readonly IHaContext _haContext; + public Services(IHaContext haContext) + { + _haContext = haContext; + } + + public AlarmControlPanelServices AlarmControlPanel => new(_haContext); + public AutomationServices Automation => new(_haContext); + public ButtonServices Button => new(_haContext); + public CameraServices Camera => new(_haContext); + public CastServices Cast => new(_haContext); + public ClimateServices Climate => new(_haContext); + public CloudServices Cloud => new(_haContext); + public ConversationServices Conversation => new(_haContext); + public CounterServices Counter => new(_haContext); + public CoverServices Cover => new(_haContext); + public DeviceTrackerServices DeviceTracker => new(_haContext); + public FanServices Fan => new(_haContext); + public FritzServices Fritz => new(_haContext); + public FrontendServices Frontend => new(_haContext); + public GoogleAssistantServices GoogleAssistant => new(_haContext); + public HassioServices Hassio => new(_haContext); + public HomeassistantServices Homeassistant => new(_haContext); + public HumidifierServices Humidifier => new(_haContext); + public InputBooleanServices InputBoolean => new(_haContext); + public InputButtonServices InputButton => new(_haContext); + public InputDatetimeServices InputDatetime => new(_haContext); + public InputNumberServices InputNumber => new(_haContext); + public InputSelectServices InputSelect => new(_haContext); + public InputTextServices InputText => new(_haContext); + public LightServices Light => new(_haContext); + public LockServices Lock => new(_haContext); + public LogbookServices Logbook => new(_haContext); + public LoggerServices Logger => new(_haContext); + public MediaPlayerServices MediaPlayer => new(_haContext); + public MqttServices Mqtt => new(_haContext); + public NetdaemonServices Netdaemon => new(_haContext); + public NotifyServices Notify => new(_haContext); + public NumberServices Number => new(_haContext); + public PersistentNotificationServices PersistentNotification => new(_haContext); + public PersonServices Person => new(_haContext); + public RecorderServices Recorder => new(_haContext); + public RestServices Rest => new(_haContext); + public SceneServices Scene => new(_haContext); + public ScheduleServices Schedule => new(_haContext); + public ScriptServices Script => new(_haContext); + public SelectServices Select => new(_haContext); + public SirenServices Siren => new(_haContext); + public SwitchServices Switch => new(_haContext); + public SystemLogServices SystemLog => new(_haContext); + public TextServices Text => new(_haContext); + public TimerServices Timer => new(_haContext); + public TtsServices Tts => new(_haContext); + public UpdateServices Update => new(_haContext); + public VacuumServices Vacuum => new(_haContext); + public WaterHeaterServices WaterHeater => new(_haContext); + public ZhaServices Zha => new(_haContext); + public ZoneServices Zone => new(_haContext); +} + +public partial class AlarmControlPanelServices +{ + private readonly IHaContext _haContext; + public AlarmControlPanelServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Sets the alarm to: _armed, no one home_. + ///The target for this service call + public void AlarmArmAway(ServiceTarget target, AlarmControlPanelAlarmArmAwayParameters data) + { + _haContext.CallService("alarm_control_panel", "alarm_arm_away", target, data); + } + + ///Sets the alarm to: _armed, no one home_. + ///The target for this service call + ///Code to arm the alarm. eg: 1234 + public void AlarmArmAway(ServiceTarget target, string? code = null) + { + _haContext.CallService("alarm_control_panel", "alarm_arm_away", target, new AlarmControlPanelAlarmArmAwayParameters { Code = code }); + } + + ///Arms the alarm while allowing to bypass a custom area. + ///The target for this service call + public void AlarmArmCustomBypass(ServiceTarget target, AlarmControlPanelAlarmArmCustomBypassParameters data) + { + _haContext.CallService("alarm_control_panel", "alarm_arm_custom_bypass", target, data); + } + + ///Arms the alarm while allowing to bypass a custom area. + ///The target for this service call + ///Code to arm the alarm. eg: 1234 + public void AlarmArmCustomBypass(ServiceTarget target, string? code = null) + { + _haContext.CallService("alarm_control_panel", "alarm_arm_custom_bypass", target, new AlarmControlPanelAlarmArmCustomBypassParameters { Code = code }); + } + + ///Sets the alarm to: _armed, but someone is home_. + ///The target for this service call + public void AlarmArmHome(ServiceTarget target, AlarmControlPanelAlarmArmHomeParameters data) + { + _haContext.CallService("alarm_control_panel", "alarm_arm_home", target, data); + } + + ///Sets the alarm to: _armed, but someone is home_. + ///The target for this service call + ///Code to arm the alarm. eg: 1234 + public void AlarmArmHome(ServiceTarget target, string? code = null) + { + _haContext.CallService("alarm_control_panel", "alarm_arm_home", target, new AlarmControlPanelAlarmArmHomeParameters { Code = code }); + } + + ///Sets the alarm to: _armed for the night_. + ///The target for this service call + public void AlarmArmNight(ServiceTarget target, AlarmControlPanelAlarmArmNightParameters data) + { + _haContext.CallService("alarm_control_panel", "alarm_arm_night", target, data); + } + + ///Sets the alarm to: _armed for the night_. + ///The target for this service call + ///Code to arm the alarm. eg: 1234 + public void AlarmArmNight(ServiceTarget target, string? code = null) + { + _haContext.CallService("alarm_control_panel", "alarm_arm_night", target, new AlarmControlPanelAlarmArmNightParameters { Code = code }); + } + + ///Sets the alarm to: _armed for vacation_. + ///The target for this service call + public void AlarmArmVacation(ServiceTarget target, AlarmControlPanelAlarmArmVacationParameters data) + { + _haContext.CallService("alarm_control_panel", "alarm_arm_vacation", target, data); + } + + ///Sets the alarm to: _armed for vacation_. + ///The target for this service call + ///Code to arm the alarm. eg: 1234 + public void AlarmArmVacation(ServiceTarget target, string? code = null) + { + _haContext.CallService("alarm_control_panel", "alarm_arm_vacation", target, new AlarmControlPanelAlarmArmVacationParameters { Code = code }); + } + + ///Disarms the alarm. + ///The target for this service call + public void AlarmDisarm(ServiceTarget target, AlarmControlPanelAlarmDisarmParameters data) + { + _haContext.CallService("alarm_control_panel", "alarm_disarm", target, data); + } + + ///Disarms the alarm. + ///The target for this service call + ///Code to disarm the alarm. eg: 1234 + public void AlarmDisarm(ServiceTarget target, string? code = null) + { + _haContext.CallService("alarm_control_panel", "alarm_disarm", target, new AlarmControlPanelAlarmDisarmParameters { Code = code }); + } + + ///Enables an external alarm trigger. + ///The target for this service call + public void AlarmTrigger(ServiceTarget target, AlarmControlPanelAlarmTriggerParameters data) + { + _haContext.CallService("alarm_control_panel", "alarm_trigger", target, data); + } + + ///Enables an external alarm trigger. + ///The target for this service call + ///Code to arm the alarm. eg: 1234 + public void AlarmTrigger(ServiceTarget target, string? code = null) + { + _haContext.CallService("alarm_control_panel", "alarm_trigger", target, new AlarmControlPanelAlarmTriggerParameters { Code = code }); + } +} + +public partial record AlarmControlPanelAlarmArmAwayParameters +{ + ///Code to arm the alarm. eg: 1234 + [JsonPropertyName("code")] + public string? Code { get; init; } +} + +public partial record AlarmControlPanelAlarmArmCustomBypassParameters +{ + ///Code to arm the alarm. eg: 1234 + [JsonPropertyName("code")] + public string? Code { get; init; } +} + +public partial record AlarmControlPanelAlarmArmHomeParameters +{ + ///Code to arm the alarm. eg: 1234 + [JsonPropertyName("code")] + public string? Code { get; init; } +} + +public partial record AlarmControlPanelAlarmArmNightParameters +{ + ///Code to arm the alarm. eg: 1234 + [JsonPropertyName("code")] + public string? Code { get; init; } +} + +public partial record AlarmControlPanelAlarmArmVacationParameters +{ + ///Code to arm the alarm. eg: 1234 + [JsonPropertyName("code")] + public string? Code { get; init; } +} + +public partial record AlarmControlPanelAlarmDisarmParameters +{ + ///Code to disarm the alarm. eg: 1234 + [JsonPropertyName("code")] + public string? Code { get; init; } +} + +public partial record AlarmControlPanelAlarmTriggerParameters +{ + ///Code to arm the alarm. eg: 1234 + [JsonPropertyName("code")] + public string? Code { get; init; } +} + +public partial class AutomationServices +{ + private readonly IHaContext _haContext; + public AutomationServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Reloads the automation configuration. + public void Reload() + { + _haContext.CallService("automation", "reload", null); + } + + ///Toggles (enable / disable) an automation. + ///The target for this service call + public void Toggle(ServiceTarget target) + { + _haContext.CallService("automation", "toggle", target); + } + + ///Triggers the actions of an automation. + ///The target for this service call + public void Trigger(ServiceTarget target, AutomationTriggerParameters data) + { + _haContext.CallService("automation", "trigger", target, data); + } + + ///Triggers the actions of an automation. + ///The target for this service call + ///Defines whether or not the conditions will be skipped. + public void Trigger(ServiceTarget target, bool? skipCondition = null) + { + _haContext.CallService("automation", "trigger", target, new AutomationTriggerParameters { SkipCondition = skipCondition }); + } + + ///Disables an automation. + ///The target for this service call + public void TurnOff(ServiceTarget target, AutomationTurnOffParameters data) + { + _haContext.CallService("automation", "turn_off", target, data); + } + + ///Disables an automation. + ///The target for this service call + ///Stops currently running actions. + public void TurnOff(ServiceTarget target, bool? stopActions = null) + { + _haContext.CallService("automation", "turn_off", target, new AutomationTurnOffParameters { StopActions = stopActions }); + } + + ///Enables an automation. + ///The target for this service call + public void TurnOn(ServiceTarget target) + { + _haContext.CallService("automation", "turn_on", target); + } +} + +public partial record AutomationTriggerParameters +{ + ///Defines whether or not the conditions will be skipped. + [JsonPropertyName("skip_condition")] + public bool? SkipCondition { get; init; } +} + +public partial record AutomationTurnOffParameters +{ + ///Stops currently running actions. + [JsonPropertyName("stop_actions")] + public bool? StopActions { get; init; } +} + +public partial class ButtonServices +{ + private readonly IHaContext _haContext; + public ButtonServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Press the button entity. + ///The target for this service call + public void Press(ServiceTarget target) + { + _haContext.CallService("button", "press", target); + } +} + +public partial class CameraServices +{ + private readonly IHaContext _haContext; + public CameraServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Disables the motion detection. + ///The target for this service call + public void DisableMotionDetection(ServiceTarget target) + { + _haContext.CallService("camera", "disable_motion_detection", target); + } + + ///Enables the motion detection. + ///The target for this service call + public void EnableMotionDetection(ServiceTarget target) + { + _haContext.CallService("camera", "enable_motion_detection", target); + } + + ///Plays the camera stream on a supported media player. + ///The target for this service call + public void PlayStream(ServiceTarget target, CameraPlayStreamParameters data) + { + _haContext.CallService("camera", "play_stream", target, data); + } + + ///Plays the camera stream on a supported media player. + ///The target for this service call + ///Media players to stream to. + ///Stream format supported by the media player. + public void PlayStream(ServiceTarget target, string mediaPlayer, object? format = null) + { + _haContext.CallService("camera", "play_stream", target, new CameraPlayStreamParameters { MediaPlayer = mediaPlayer, Format = format }); + } + + ///Creates a recording of a live camera feed. + ///The target for this service call + public void Record(ServiceTarget target, CameraRecordParameters data) + { + _haContext.CallService("camera", "record", target, data); + } + + ///Creates a recording of a live camera feed. + ///The target for this service call + ///Template of a filename. Variable available is `entity_id`. Must be mp4. eg: /tmp/snapshot_{{ entity_id.name }}.mp4 + ///Planned duration of the recording. The actual duration may vary. + ///Planned lookback period to include in the recording (in addition to the duration). Only available if there is currently an active HLS stream. The actual length of the lookback period may vary. + public void Record(ServiceTarget target, string filename, long? duration = null, long? lookback = null) + { + _haContext.CallService("camera", "record", target, new CameraRecordParameters { Filename = filename, Duration = duration, Lookback = lookback }); + } + + ///Takes a snapshot from a camera. + ///The target for this service call + public void Snapshot(ServiceTarget target, CameraSnapshotParameters data) + { + _haContext.CallService("camera", "snapshot", target, data); + } + + ///Takes a snapshot from a camera. + ///The target for this service call + ///Template of a filename. Variable available is `entity_id`. eg: /tmp/snapshot_{{ entity_id.name }}.jpg + public void Snapshot(ServiceTarget target, string filename) + { + _haContext.CallService("camera", "snapshot", target, new CameraSnapshotParameters { Filename = filename }); + } + + ///Turns off the camera. + ///The target for this service call + public void TurnOff(ServiceTarget target) + { + _haContext.CallService("camera", "turn_off", target); + } + + ///Turns on the camera. + ///The target for this service call + public void TurnOn(ServiceTarget target) + { + _haContext.CallService("camera", "turn_on", target); + } +} + +public partial record CameraPlayStreamParameters +{ + ///Media players to stream to. + [JsonPropertyName("media_player")] + public string? MediaPlayer { get; init; } + + ///Stream format supported by the media player. + [JsonPropertyName("format")] + public object? Format { get; init; } +} + +public partial record CameraRecordParameters +{ + ///Template of a filename. Variable available is `entity_id`. Must be mp4. eg: /tmp/snapshot_{{ entity_id.name }}.mp4 + [JsonPropertyName("filename")] + public string? Filename { get; init; } + + ///Planned duration of the recording. The actual duration may vary. + [JsonPropertyName("duration")] + public long? Duration { get; init; } + + ///Planned lookback period to include in the recording (in addition to the duration). Only available if there is currently an active HLS stream. The actual length of the lookback period may vary. + [JsonPropertyName("lookback")] + public long? Lookback { get; init; } +} + +public partial record CameraSnapshotParameters +{ + ///Template of a filename. Variable available is `entity_id`. eg: /tmp/snapshot_{{ entity_id.name }}.jpg + [JsonPropertyName("filename")] + public string? Filename { get; init; } +} + +public partial class CastServices +{ + private readonly IHaContext _haContext; + public CastServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Shows a dashboard view on a Chromecast device. + public void ShowLovelaceView(CastShowLovelaceViewParameters data) + { + _haContext.CallService("cast", "show_lovelace_view", null, data); + } + + ///Shows a dashboard view on a Chromecast device. + ///Media player entity to show the dashboard view on. + ///The URL path of the dashboard to show. eg: lovelace-cast + ///The path of the dashboard view to show. eg: downstairs + public void ShowLovelaceView(string entityId, string dashboardPath, string? viewPath = null) + { + _haContext.CallService("cast", "show_lovelace_view", null, new CastShowLovelaceViewParameters { EntityId = entityId, DashboardPath = dashboardPath, ViewPath = viewPath }); + } +} + +public partial record CastShowLovelaceViewParameters +{ + ///Media player entity to show the dashboard view on. + [JsonPropertyName("entity_id")] + public string? EntityId { get; init; } + + ///The URL path of the dashboard to show. eg: lovelace-cast + [JsonPropertyName("dashboard_path")] + public string? DashboardPath { get; init; } + + ///The path of the dashboard view to show. eg: downstairs + [JsonPropertyName("view_path")] + public string? ViewPath { get; init; } +} + +public partial class ClimateServices +{ + private readonly IHaContext _haContext; + public ClimateServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Turns auxiliary heater on/off. + ///The target for this service call + public void SetAuxHeat(ServiceTarget target, ClimateSetAuxHeatParameters data) + { + _haContext.CallService("climate", "set_aux_heat", target, data); + } + + ///Turns auxiliary heater on/off. + ///The target for this service call + ///New value of auxiliary heater. + public void SetAuxHeat(ServiceTarget target, bool auxHeat) + { + _haContext.CallService("climate", "set_aux_heat", target, new ClimateSetAuxHeatParameters { AuxHeat = auxHeat }); + } + + ///Sets fan operation mode. + ///The target for this service call + public void SetFanMode(ServiceTarget target, ClimateSetFanModeParameters data) + { + _haContext.CallService("climate", "set_fan_mode", target, data); + } + + ///Sets fan operation mode. + ///The target for this service call + ///Fan operation mode. eg: low + public void SetFanMode(ServiceTarget target, string fanMode) + { + _haContext.CallService("climate", "set_fan_mode", target, new ClimateSetFanModeParameters { FanMode = fanMode }); + } + + ///Sets target humidity. + ///The target for this service call + public void SetHumidity(ServiceTarget target, ClimateSetHumidityParameters data) + { + _haContext.CallService("climate", "set_humidity", target, data); + } + + ///Sets target humidity. + ///The target for this service call + ///Target humidity. + public void SetHumidity(ServiceTarget target, long humidity) + { + _haContext.CallService("climate", "set_humidity", target, new ClimateSetHumidityParameters { Humidity = humidity }); + } + + ///Sets HVAC operation mode. + ///The target for this service call + public void SetHvacMode(ServiceTarget target, ClimateSetHvacModeParameters data) + { + _haContext.CallService("climate", "set_hvac_mode", target, data); + } + + ///Sets HVAC operation mode. + ///The target for this service call + ///HVAC operation mode. + public void SetHvacMode(ServiceTarget target, object? hvacMode = null) + { + _haContext.CallService("climate", "set_hvac_mode", target, new ClimateSetHvacModeParameters { HvacMode = hvacMode }); + } + + ///Sets preset mode. + ///The target for this service call + public void SetPresetMode(ServiceTarget target, ClimateSetPresetModeParameters data) + { + _haContext.CallService("climate", "set_preset_mode", target, data); + } + + ///Sets preset mode. + ///The target for this service call + ///Preset mode. eg: away + public void SetPresetMode(ServiceTarget target, string presetMode) + { + _haContext.CallService("climate", "set_preset_mode", target, new ClimateSetPresetModeParameters { PresetMode = presetMode }); + } + + ///Sets swing operation mode. + ///The target for this service call + public void SetSwingMode(ServiceTarget target, ClimateSetSwingModeParameters data) + { + _haContext.CallService("climate", "set_swing_mode", target, data); + } + + ///Sets swing operation mode. + ///The target for this service call + ///Swing operation mode. eg: horizontal + public void SetSwingMode(ServiceTarget target, string swingMode) + { + _haContext.CallService("climate", "set_swing_mode", target, new ClimateSetSwingModeParameters { SwingMode = swingMode }); + } + + ///Sets target temperature. + ///The target for this service call + public void SetTemperature(ServiceTarget target, ClimateSetTemperatureParameters data) + { + _haContext.CallService("climate", "set_temperature", target, data); + } + + ///Sets target temperature. + ///The target for this service call + ///Target temperature. + ///High target temperature. + ///Low target temperature. + ///HVAC operation mode. + public void SetTemperature(ServiceTarget target, double? temperature = null, double? targetTempHigh = null, double? targetTempLow = null, object? hvacMode = null) + { + _haContext.CallService("climate", "set_temperature", target, new ClimateSetTemperatureParameters { Temperature = temperature, TargetTempHigh = targetTempHigh, TargetTempLow = targetTempLow, HvacMode = hvacMode }); + } + + ///Turns climate device off. + ///The target for this service call + public void TurnOff(ServiceTarget target) + { + _haContext.CallService("climate", "turn_off", target); + } + + ///Turns climate device on. + ///The target for this service call + public void TurnOn(ServiceTarget target) + { + _haContext.CallService("climate", "turn_on", target); + } +} + +public partial record ClimateSetAuxHeatParameters +{ + ///New value of auxiliary heater. + [JsonPropertyName("aux_heat")] + public bool? AuxHeat { get; init; } +} + +public partial record ClimateSetFanModeParameters +{ + ///Fan operation mode. eg: low + [JsonPropertyName("fan_mode")] + public string? FanMode { get; init; } +} + +public partial record ClimateSetHumidityParameters +{ + ///Target humidity. + [JsonPropertyName("humidity")] + public long? Humidity { get; init; } +} + +public partial record ClimateSetHvacModeParameters +{ + ///HVAC operation mode. + [JsonPropertyName("hvac_mode")] + public object? HvacMode { get; init; } +} + +public partial record ClimateSetPresetModeParameters +{ + ///Preset mode. eg: away + [JsonPropertyName("preset_mode")] + public string? PresetMode { get; init; } +} + +public partial record ClimateSetSwingModeParameters +{ + ///Swing operation mode. eg: horizontal + [JsonPropertyName("swing_mode")] + public string? SwingMode { get; init; } +} + +public partial record ClimateSetTemperatureParameters +{ + ///Target temperature. + [JsonPropertyName("temperature")] + public double? Temperature { get; init; } + + ///High target temperature. + [JsonPropertyName("target_temp_high")] + public double? TargetTempHigh { get; init; } + + ///Low target temperature. + [JsonPropertyName("target_temp_low")] + public double? TargetTempLow { get; init; } + + ///HVAC operation mode. + [JsonPropertyName("hvac_mode")] + public object? HvacMode { get; init; } +} + +public partial class CloudServices +{ + private readonly IHaContext _haContext; + public CloudServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Makes the instance UI accessible from outside of the local network by using Home Assistant Cloud. + public void RemoteConnect() + { + _haContext.CallService("cloud", "remote_connect", null); + } + + ///Disconnects the Home Assistant UI from the Home Assistant Cloud. You will no longer be able to access your Home Assistant instance from outside your local network. + public void RemoteDisconnect() + { + _haContext.CallService("cloud", "remote_disconnect", null); + } +} + +public partial class ConversationServices +{ + private readonly IHaContext _haContext; + public ConversationServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Launches a conversation from a transcribed text. + public void Process(ConversationProcessParameters data) + { + _haContext.CallService("conversation", "process", null, data); + } + + ///Launches a conversation from a transcribed text. + ///Transcribed text input. eg: Turn all lights on + ///Language of text. Defaults to server language. eg: NL + ///Conversation agent to process your request. The conversation agent is the brains of your assistant. It processes the incoming text commands. eg: homeassistant + public void Process(string text, string? language = null, object? agentId = null) + { + _haContext.CallService("conversation", "process", null, new ConversationProcessParameters { Text = text, Language = language, AgentId = agentId }); + } + + public void Reload() + { + _haContext.CallService("conversation", "reload", null); + } +} + +public partial record ConversationProcessParameters +{ + ///Transcribed text input. eg: Turn all lights on + [JsonPropertyName("text")] + public string? Text { get; init; } + + ///Language of text. Defaults to server language. eg: NL + [JsonPropertyName("language")] + public string? Language { get; init; } + + ///Conversation agent to process your request. The conversation agent is the brains of your assistant. It processes the incoming text commands. eg: homeassistant + [JsonPropertyName("agent_id")] + public object? AgentId { get; init; } +} + +public partial class CounterServices +{ + private readonly IHaContext _haContext; + public CounterServices(IHaContext haContext) + { + _haContext = haContext; + } + + public void Configure() + { + _haContext.CallService("counter", "configure", null); + } + + ///Decrements a counter. + ///The target for this service call + public void Decrement(ServiceTarget target) + { + _haContext.CallService("counter", "decrement", target); + } + + ///Increments a counter. + ///The target for this service call + public void Increment(ServiceTarget target) + { + _haContext.CallService("counter", "increment", target); + } + + ///Resets a counter. + ///The target for this service call + public void Reset(ServiceTarget target) + { + _haContext.CallService("counter", "reset", target); + } + + ///Sets the counter value. + ///The target for this service call + public void SetValue(ServiceTarget target, CounterSetValueParameters data) + { + _haContext.CallService("counter", "set_value", target, data); + } + + ///Sets the counter value. + ///The target for this service call + ///The new counter value the entity should be set to. + public void SetValue(ServiceTarget target, long value) + { + _haContext.CallService("counter", "set_value", target, new CounterSetValueParameters { Value = value }); + } +} + +public partial record CounterSetValueParameters +{ + ///The new counter value the entity should be set to. + [JsonPropertyName("value")] + public long? Value { get; init; } +} + +public partial class CoverServices +{ + private readonly IHaContext _haContext; + public CoverServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Closes a cover. + ///The target for this service call + public void CloseCover(ServiceTarget target) + { + _haContext.CallService("cover", "close_cover", target); + } + + ///Tilts a cover to close. + ///The target for this service call + public void CloseCoverTilt(ServiceTarget target) + { + _haContext.CallService("cover", "close_cover_tilt", target); + } + + ///Opens a cover. + ///The target for this service call + public void OpenCover(ServiceTarget target) + { + _haContext.CallService("cover", "open_cover", target); + } + + ///Tilts a cover open. + ///The target for this service call + public void OpenCoverTilt(ServiceTarget target) + { + _haContext.CallService("cover", "open_cover_tilt", target); + } + + ///Moves a cover to a specific position. + ///The target for this service call + public void SetCoverPosition(ServiceTarget target, CoverSetCoverPositionParameters data) + { + _haContext.CallService("cover", "set_cover_position", target, data); + } + + ///Moves a cover to a specific position. + ///The target for this service call + ///Target position. + public void SetCoverPosition(ServiceTarget target, long position) + { + _haContext.CallService("cover", "set_cover_position", target, new CoverSetCoverPositionParameters { Position = position }); + } + + ///Moves a cover tilt to a specific position. + ///The target for this service call + public void SetCoverTiltPosition(ServiceTarget target, CoverSetCoverTiltPositionParameters data) + { + _haContext.CallService("cover", "set_cover_tilt_position", target, data); + } + + ///Moves a cover tilt to a specific position. + ///The target for this service call + ///Target tilt positition. + public void SetCoverTiltPosition(ServiceTarget target, long tiltPosition) + { + _haContext.CallService("cover", "set_cover_tilt_position", target, new CoverSetCoverTiltPositionParameters { TiltPosition = tiltPosition }); + } + + ///Stops the cover movement. + ///The target for this service call + public void StopCover(ServiceTarget target) + { + _haContext.CallService("cover", "stop_cover", target); + } + + ///Stops a tilting cover movement. + ///The target for this service call + public void StopCoverTilt(ServiceTarget target) + { + _haContext.CallService("cover", "stop_cover_tilt", target); + } + + ///Toggles a cover open/closed. + ///The target for this service call + public void Toggle(ServiceTarget target) + { + _haContext.CallService("cover", "toggle", target); + } + + ///Toggles a cover tilt open/closed. + ///The target for this service call + public void ToggleCoverTilt(ServiceTarget target) + { + _haContext.CallService("cover", "toggle_cover_tilt", target); + } +} + +public partial record CoverSetCoverPositionParameters +{ + ///Target position. + [JsonPropertyName("position")] + public long? Position { get; init; } +} + +public partial record CoverSetCoverTiltPositionParameters +{ + ///Target tilt positition. + [JsonPropertyName("tilt_position")] + public long? TiltPosition { get; init; } +} + +public partial class DeviceTrackerServices +{ + private readonly IHaContext _haContext; + public DeviceTrackerServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Records a seen tracked device. + public void See(DeviceTrackerSeeParameters data) + { + _haContext.CallService("device_tracker", "see", null, data); + } + + ///Records a seen tracked device. + ///MAC address of the device. eg: FF:FF:FF:FF:FF:FF + ///ID of the device (find the ID in `known_devices.yaml`). eg: phonedave + ///Hostname of the device. eg: Dave + ///Name of the location where the device is located. The options are: `home`, `not_home`, or the name of the zone. eg: home + ///GPS coordinates where the device is located, specified by latitude and longitude (for example: [51.513845, -0.100539]). eg: [51.509802, -0.086692] + ///Accuracy of the GPS coordinates. + ///Battery level of the device. + public void See(string? mac = null, string? devId = null, string? hostName = null, string? locationName = null, object? gps = null, long? gpsAccuracy = null, long? battery = null) + { + _haContext.CallService("device_tracker", "see", null, new DeviceTrackerSeeParameters { Mac = mac, DevId = devId, HostName = hostName, LocationName = locationName, Gps = gps, GpsAccuracy = gpsAccuracy, Battery = battery }); + } +} + +public partial record DeviceTrackerSeeParameters +{ + ///MAC address of the device. eg: FF:FF:FF:FF:FF:FF + [JsonPropertyName("mac")] + public string? Mac { get; init; } + + ///ID of the device (find the ID in `known_devices.yaml`). eg: phonedave + [JsonPropertyName("dev_id")] + public string? DevId { get; init; } + + ///Hostname of the device. eg: Dave + [JsonPropertyName("host_name")] + public string? HostName { get; init; } + + ///Name of the location where the device is located. The options are: `home`, `not_home`, or the name of the zone. eg: home + [JsonPropertyName("location_name")] + public string? LocationName { get; init; } + + ///GPS coordinates where the device is located, specified by latitude and longitude (for example: [51.513845, -0.100539]). eg: [51.509802, -0.086692] + [JsonPropertyName("gps")] + public object? Gps { get; init; } + + ///Accuracy of the GPS coordinates. + [JsonPropertyName("gps_accuracy")] + public long? GpsAccuracy { get; init; } + + ///Battery level of the device. + [JsonPropertyName("battery")] + public long? Battery { get; init; } +} + +public partial class FanServices +{ + private readonly IHaContext _haContext; + public FanServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Decreases the speed of the fan. + ///The target for this service call + public void DecreaseSpeed(ServiceTarget target, FanDecreaseSpeedParameters data) + { + _haContext.CallService("fan", "decrease_speed", target, data); + } + + ///Decreases the speed of the fan. + ///The target for this service call + ///Decreases the speed by a percentage step. + public void DecreaseSpeed(ServiceTarget target, long? percentageStep = null) + { + _haContext.CallService("fan", "decrease_speed", target, new FanDecreaseSpeedParameters { PercentageStep = percentageStep }); + } + + ///Increases the speed of the fan. + ///The target for this service call + public void IncreaseSpeed(ServiceTarget target, FanIncreaseSpeedParameters data) + { + _haContext.CallService("fan", "increase_speed", target, data); + } + + ///Increases the speed of the fan. + ///The target for this service call + ///Increases the speed by a percentage step. + public void IncreaseSpeed(ServiceTarget target, long? percentageStep = null) + { + _haContext.CallService("fan", "increase_speed", target, new FanIncreaseSpeedParameters { PercentageStep = percentageStep }); + } + + ///Controls oscillatation of the fan. + ///The target for this service call + public void Oscillate(ServiceTarget target, FanOscillateParameters data) + { + _haContext.CallService("fan", "oscillate", target, data); + } + + ///Controls oscillatation of the fan. + ///The target for this service call + ///Turn on/off oscillation. + public void Oscillate(ServiceTarget target, bool oscillating) + { + _haContext.CallService("fan", "oscillate", target, new FanOscillateParameters { Oscillating = oscillating }); + } + + ///Sets the fan rotation direction. + ///The target for this service call + public void SetDirection(ServiceTarget target, FanSetDirectionParameters data) + { + _haContext.CallService("fan", "set_direction", target, data); + } + + ///Sets the fan rotation direction. + ///The target for this service call + ///Direction to rotate. + public void SetDirection(ServiceTarget target, object direction) + { + _haContext.CallService("fan", "set_direction", target, new FanSetDirectionParameters { Direction = direction }); + } + + ///Sets the fan speed. + ///The target for this service call + public void SetPercentage(ServiceTarget target, FanSetPercentageParameters data) + { + _haContext.CallService("fan", "set_percentage", target, data); + } + + ///Sets the fan speed. + ///The target for this service call + ///Speed of the fan. + public void SetPercentage(ServiceTarget target, long percentage) + { + _haContext.CallService("fan", "set_percentage", target, new FanSetPercentageParameters { Percentage = percentage }); + } + + ///Sets preset mode. + ///The target for this service call + public void SetPresetMode(ServiceTarget target, FanSetPresetModeParameters data) + { + _haContext.CallService("fan", "set_preset_mode", target, data); + } + + ///Sets preset mode. + ///The target for this service call + ///Preset mode. eg: auto + public void SetPresetMode(ServiceTarget target, string presetMode) + { + _haContext.CallService("fan", "set_preset_mode", target, new FanSetPresetModeParameters { PresetMode = presetMode }); + } + + ///Toggles the fan on/off. + ///The target for this service call + public void Toggle(ServiceTarget target) + { + _haContext.CallService("fan", "toggle", target); + } + + ///Turns fan off. + ///The target for this service call + public void TurnOff(ServiceTarget target) + { + _haContext.CallService("fan", "turn_off", target); + } + + ///Turns fan on. + ///The target for this service call + public void TurnOn(ServiceTarget target, FanTurnOnParameters data) + { + _haContext.CallService("fan", "turn_on", target, data); + } + + ///Turns fan on. + ///The target for this service call + ///Speed of the fan. + ///Preset mode. eg: auto + public void TurnOn(ServiceTarget target, long? percentage = null, string? presetMode = null) + { + _haContext.CallService("fan", "turn_on", target, new FanTurnOnParameters { Percentage = percentage, PresetMode = presetMode }); + } +} + +public partial record FanDecreaseSpeedParameters +{ + ///Decreases the speed by a percentage step. + [JsonPropertyName("percentage_step")] + public long? PercentageStep { get; init; } +} + +public partial record FanIncreaseSpeedParameters +{ + ///Increases the speed by a percentage step. + [JsonPropertyName("percentage_step")] + public long? PercentageStep { get; init; } +} + +public partial record FanOscillateParameters +{ + ///Turn on/off oscillation. + [JsonPropertyName("oscillating")] + public bool? Oscillating { get; init; } +} + +public partial record FanSetDirectionParameters +{ + ///Direction to rotate. + [JsonPropertyName("direction")] + public object? Direction { get; init; } +} + +public partial record FanSetPercentageParameters +{ + ///Speed of the fan. + [JsonPropertyName("percentage")] + public long? Percentage { get; init; } +} + +public partial record FanSetPresetModeParameters +{ + ///Preset mode. eg: auto + [JsonPropertyName("preset_mode")] + public string? PresetMode { get; init; } +} + +public partial record FanTurnOnParameters +{ + ///Speed of the fan. + [JsonPropertyName("percentage")] + public long? Percentage { get; init; } + + ///Preset mode. eg: auto + [JsonPropertyName("preset_mode")] + public string? PresetMode { get; init; } +} + +public partial class FritzServices +{ + private readonly IHaContext _haContext; + public FritzServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Remove FRITZ!Box stale device_tracker entities. + public void Cleanup(FritzCleanupParameters data) + { + _haContext.CallService("fritz", "cleanup", null, data); + } + + ///Remove FRITZ!Box stale device_tracker entities. + ///Select the Fritz!Box to check. + public void Cleanup(string deviceId) + { + _haContext.CallService("fritz", "cleanup", null, new FritzCleanupParameters { DeviceId = deviceId }); + } + + ///Reboots your FRITZ!Box. + public void Reboot(FritzRebootParameters data) + { + _haContext.CallService("fritz", "reboot", null, data); + } + + ///Reboots your FRITZ!Box. + ///Select the Fritz!Box to reboot. + public void Reboot(string deviceId) + { + _haContext.CallService("fritz", "reboot", null, new FritzRebootParameters { DeviceId = deviceId }); + } + + ///Reconnects your FRITZ!Box internet connection. + public void Reconnect(FritzReconnectParameters data) + { + _haContext.CallService("fritz", "reconnect", null, data); + } + + ///Reconnects your FRITZ!Box internet connection. + ///Select the Fritz!Box to reconnect. + public void Reconnect(string deviceId) + { + _haContext.CallService("fritz", "reconnect", null, new FritzReconnectParameters { DeviceId = deviceId }); + } + + ///Sets a new password for the guest Wi-Fi. The password must be between 8 and 63 characters long. If no additional parameter is set, the password will be auto-generated with a length of 12 characters. + public void SetGuestWifiPassword(FritzSetGuestWifiPasswordParameters data) + { + _haContext.CallService("fritz", "set_guest_wifi_password", null, data); + } + + ///Sets a new password for the guest Wi-Fi. The password must be between 8 and 63 characters long. If no additional parameter is set, the password will be auto-generated with a length of 12 characters. + ///Select the Fritz!Box to configure. + ///New password for the guest Wi-Fi. + ///Length of the new password. The password will be auto-generated, if no password is set. + public void SetGuestWifiPassword(string deviceId, string? password = null, long? length = null) + { + _haContext.CallService("fritz", "set_guest_wifi_password", null, new FritzSetGuestWifiPasswordParameters { DeviceId = deviceId, Password = password, Length = length }); + } +} + +public partial record FritzCleanupParameters +{ + ///Select the Fritz!Box to check. + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } +} + +public partial record FritzRebootParameters +{ + ///Select the Fritz!Box to reboot. + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } +} + +public partial record FritzReconnectParameters +{ + ///Select the Fritz!Box to reconnect. + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } +} + +public partial record FritzSetGuestWifiPasswordParameters +{ + ///Select the Fritz!Box to configure. + [JsonPropertyName("device_id")] + public string? DeviceId { get; init; } + + ///New password for the guest Wi-Fi. + [JsonPropertyName("password")] + public string? Password { get; init; } + + ///Length of the new password. The password will be auto-generated, if no password is set. + [JsonPropertyName("length")] + public long? Length { get; init; } +} + +public partial class FrontendServices +{ + private readonly IHaContext _haContext; + public FrontendServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Reloads themes from the YAML-configuration. + public void ReloadThemes() + { + _haContext.CallService("frontend", "reload_themes", null); + } + + ///Sets the default theme Home Assistant uses. Can be overridden by a user. + public void SetTheme(FrontendSetThemeParameters data) + { + _haContext.CallService("frontend", "set_theme", null, data); + } + + ///Sets the default theme Home Assistant uses. Can be overridden by a user. + ///Name of a theme. eg: default + ///Theme mode. + public void SetTheme(object name, object? mode = null) + { + _haContext.CallService("frontend", "set_theme", null, new FrontendSetThemeParameters { Name = name, Mode = mode }); + } +} + +public partial record FrontendSetThemeParameters +{ + ///Name of a theme. eg: default + [JsonPropertyName("name")] + public object? Name { get; init; } + + ///Theme mode. + [JsonPropertyName("mode")] + public object? Mode { get; init; } +} + +public partial class GoogleAssistantServices +{ + private readonly IHaContext _haContext; + public GoogleAssistantServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Sends a request_sync command to Google. + public void RequestSync(GoogleAssistantRequestSyncParameters data) + { + _haContext.CallService("google_assistant", "request_sync", null, data); + } + + ///Sends a request_sync command to Google. + ///Only needed for automations. Specific Home Assistant user id (not username, ID in configuration > users > under username) to sync with Google Assistant. Do not need when you call this service through Home Assistant front end or API. Used in automation script or other place where context.user_id is missing. + public void RequestSync(string? agentUserId = null) + { + _haContext.CallService("google_assistant", "request_sync", null, new GoogleAssistantRequestSyncParameters { AgentUserId = agentUserId }); + } +} + +public partial record GoogleAssistantRequestSyncParameters +{ + ///Only needed for automations. Specific Home Assistant user id (not username, ID in configuration > users > under username) to sync with Google Assistant. Do not need when you call this service through Home Assistant front end or API. Used in automation script or other place where context.user_id is missing. + [JsonPropertyName("agent_user_id")] + public string? AgentUserId { get; init; } +} + +public partial class HassioServices +{ + private readonly IHaContext _haContext; + public HassioServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Restarts an add-on. + public void AddonRestart(HassioAddonRestartParameters data) + { + _haContext.CallService("hassio", "addon_restart", null, data); + } + + ///Restarts an add-on. + ///The add-on slug. eg: core_ssh + public void AddonRestart(object addon) + { + _haContext.CallService("hassio", "addon_restart", null, new HassioAddonRestartParameters { Addon = addon }); + } + + ///Starts an add-on. + public void AddonStart(HassioAddonStartParameters data) + { + _haContext.CallService("hassio", "addon_start", null, data); + } + + ///Starts an add-on. + ///The add-on slug. eg: core_ssh + public void AddonStart(object addon) + { + _haContext.CallService("hassio", "addon_start", null, new HassioAddonStartParameters { Addon = addon }); + } + + ///Writes data to add-on stdin. + public void AddonStdin(HassioAddonStdinParameters data) + { + _haContext.CallService("hassio", "addon_stdin", null, data); + } + + ///Writes data to add-on stdin. + ///The add-on slug. eg: core_ssh + public void AddonStdin(object addon) + { + _haContext.CallService("hassio", "addon_stdin", null, new HassioAddonStdinParameters { Addon = addon }); + } + + ///Stops an add-on. + public void AddonStop(HassioAddonStopParameters data) + { + _haContext.CallService("hassio", "addon_stop", null, data); + } + + ///Stops an add-on. + ///The add-on slug. eg: core_ssh + public void AddonStop(object addon) + { + _haContext.CallService("hassio", "addon_stop", null, new HassioAddonStopParameters { Addon = addon }); + } + + ///Updates an add-on. This service should be used with caution since add-on updates can contain breaking changes. It is highly recommended that you review release notes/change logs before updating an add-on. + public void AddonUpdate(HassioAddonUpdateParameters data) + { + _haContext.CallService("hassio", "addon_update", null, data); + } + + ///Updates an add-on. This service should be used with caution since add-on updates can contain breaking changes. It is highly recommended that you review release notes/change logs before updating an add-on. + ///The add-on slug. eg: core_ssh + public void AddonUpdate(object addon) + { + _haContext.CallService("hassio", "addon_update", null, new HassioAddonUpdateParameters { Addon = addon }); + } + + ///Creates a full backup. + public void BackupFull(HassioBackupFullParameters data) + { + _haContext.CallService("hassio", "backup_full", null, data); + } + + ///Creates a full backup. + ///Optional (default = current date and time). eg: Backup 1 + ///Password to protect the backup with. eg: password + ///Compresses the backup files. + ///Name of a backup network storage to host backups. eg: my_backup_mount + public void BackupFull(string? name = null, string? password = null, bool? compressed = null, object? location = null) + { + _haContext.CallService("hassio", "backup_full", null, new HassioBackupFullParameters { Name = name, Password = password, Compressed = compressed, Location = location }); + } + + ///Creates a partial backup. + public void BackupPartial(HassioBackupPartialParameters data) + { + _haContext.CallService("hassio", "backup_partial", null, data); + } + + ///Creates a partial backup. + ///Includes Home Assistant settings in the backup. + ///List of add-ons to include in the backup. Use the name slug of the add-on. eg: ["core_ssh","core_samba","core_mosquitto"] + ///List of directories to include in the backup. eg: ["homeassistant","share"] + ///Optional (default = current date and time). eg: Partial backup 1 + ///Password to protect the backup with. eg: password + ///Compresses the backup files. + ///Name of a backup network storage to host backups. eg: my_backup_mount + public void BackupPartial(bool? homeassistant = null, object? addons = null, object? folders = null, string? name = null, string? password = null, bool? compressed = null, object? location = null) + { + _haContext.CallService("hassio", "backup_partial", null, new HassioBackupPartialParameters { Homeassistant = homeassistant, Addons = addons, Folders = folders, Name = name, Password = password, Compressed = compressed, Location = location }); + } + + ///Reboots the host system. + public void HostReboot() + { + _haContext.CallService("hassio", "host_reboot", null); + } + + ///Powers off the host system. + public void HostShutdown() + { + _haContext.CallService("hassio", "host_shutdown", null); + } + + ///Restores from full backup. + public void RestoreFull(HassioRestoreFullParameters data) + { + _haContext.CallService("hassio", "restore_full", null, data); + } + + ///Restores from full backup. + ///Slug of backup to restore from. + ///Optional password. eg: password + public void RestoreFull(string slug, string? password = null) + { + _haContext.CallService("hassio", "restore_full", null, new HassioRestoreFullParameters { Slug = slug, Password = password }); + } + + ///Restores from a partial backup. + public void RestorePartial(HassioRestorePartialParameters data) + { + _haContext.CallService("hassio", "restore_partial", null, data); + } + + ///Restores from a partial backup. + ///Slug of backup to restore from. + ///Restores Home Assistant. + ///List of directories to include in the backup. eg: ["homeassistant","share"] + ///List of add-ons to include in the backup. Use the name slug of the add-on. eg: ["core_ssh","core_samba","core_mosquitto"] + ///Optional password. eg: password + public void RestorePartial(string slug, bool? homeassistant = null, object? folders = null, object? addons = null, string? password = null) + { + _haContext.CallService("hassio", "restore_partial", null, new HassioRestorePartialParameters { Slug = slug, Homeassistant = homeassistant, Folders = folders, Addons = addons, Password = password }); + } +} + +public partial record HassioAddonRestartParameters +{ + ///The add-on slug. eg: core_ssh + [JsonPropertyName("addon")] + public object? Addon { get; init; } +} + +public partial record HassioAddonStartParameters +{ + ///The add-on slug. eg: core_ssh + [JsonPropertyName("addon")] + public object? Addon { get; init; } +} + +public partial record HassioAddonStdinParameters +{ + ///The add-on slug. eg: core_ssh + [JsonPropertyName("addon")] + public object? Addon { get; init; } +} + +public partial record HassioAddonStopParameters +{ + ///The add-on slug. eg: core_ssh + [JsonPropertyName("addon")] + public object? Addon { get; init; } +} + +public partial record HassioAddonUpdateParameters +{ + ///The add-on slug. eg: core_ssh + [JsonPropertyName("addon")] + public object? Addon { get; init; } +} + +public partial record HassioBackupFullParameters +{ + ///Optional (default = current date and time). eg: Backup 1 + [JsonPropertyName("name")] + public string? Name { get; init; } + + ///Password to protect the backup with. eg: password + [JsonPropertyName("password")] + public string? Password { get; init; } + + ///Compresses the backup files. + [JsonPropertyName("compressed")] + public bool? Compressed { get; init; } + + ///Name of a backup network storage to host backups. eg: my_backup_mount + [JsonPropertyName("location")] + public object? Location { get; init; } +} + +public partial record HassioBackupPartialParameters +{ + ///Includes Home Assistant settings in the backup. + [JsonPropertyName("homeassistant")] + public bool? Homeassistant { get; init; } + + ///List of add-ons to include in the backup. Use the name slug of the add-on. eg: ["core_ssh","core_samba","core_mosquitto"] + [JsonPropertyName("addons")] + public object? Addons { get; init; } + + ///List of directories to include in the backup. eg: ["homeassistant","share"] + [JsonPropertyName("folders")] + public object? Folders { get; init; } + + ///Optional (default = current date and time). eg: Partial backup 1 + [JsonPropertyName("name")] + public string? Name { get; init; } + + ///Password to protect the backup with. eg: password + [JsonPropertyName("password")] + public string? Password { get; init; } + + ///Compresses the backup files. + [JsonPropertyName("compressed")] + public bool? Compressed { get; init; } + + ///Name of a backup network storage to host backups. eg: my_backup_mount + [JsonPropertyName("location")] + public object? Location { get; init; } +} + +public partial record HassioRestoreFullParameters +{ + ///Slug of backup to restore from. + [JsonPropertyName("slug")] + public string? Slug { get; init; } + + ///Optional password. eg: password + [JsonPropertyName("password")] + public string? Password { get; init; } +} + +public partial record HassioRestorePartialParameters +{ + ///Slug of backup to restore from. + [JsonPropertyName("slug")] + public string? Slug { get; init; } + + ///Restores Home Assistant. + [JsonPropertyName("homeassistant")] + public bool? Homeassistant { get; init; } + + ///List of directories to include in the backup. eg: ["homeassistant","share"] + [JsonPropertyName("folders")] + public object? Folders { get; init; } + + ///List of add-ons to include in the backup. Use the name slug of the add-on. eg: ["core_ssh","core_samba","core_mosquitto"] + [JsonPropertyName("addons")] + public object? Addons { get; init; } + + ///Optional password. eg: password + [JsonPropertyName("password")] + public string? Password { get; init; } +} + +public partial class HomeassistantServices +{ + private readonly IHaContext _haContext; + public HomeassistantServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Checks the Home Assistant YAML-configuration files for errors. Errors will be shown in the Home Assistant logs. + public void CheckConfig() + { + _haContext.CallService("homeassistant", "check_config", null); + } + + public void ReloadAll() + { + _haContext.CallService("homeassistant", "reload_all", null); + } + + ///Reloads the specified config entry. + ///The target for this service call + public void ReloadConfigEntry(ServiceTarget target, HomeassistantReloadConfigEntryParameters data) + { + _haContext.CallService("homeassistant", "reload_config_entry", target, data); + } + + ///Reloads the specified config entry. + ///The target for this service call + ///The configuration entry ID of the entry to be reloaded. eg: 8955375327824e14ba89e4b29cc3ec9a + public void ReloadConfigEntry(ServiceTarget target, string? entryId = null) + { + _haContext.CallService("homeassistant", "reload_config_entry", target, new HomeassistantReloadConfigEntryParameters { EntryId = entryId }); + } + + ///Reloads the core configuration from the YAML-configuration. + public void ReloadCoreConfig() + { + _haContext.CallService("homeassistant", "reload_core_config", null); + } + + ///Reloads Jinja2 templates found in the `custom_templates` folder in your config. New values will be applied on the next render of the template. + public void ReloadCustomTemplates() + { + _haContext.CallService("homeassistant", "reload_custom_templates", null); + } + + ///Restarts Home Assistant. + public void Restart() + { + _haContext.CallService("homeassistant", "restart", null); + } + + ///Saves the persistent states immediately. Maintains the normal periodic saving interval. + public void SavePersistentStates() + { + _haContext.CallService("homeassistant", "save_persistent_states", null); + } + + ///Updates the Home Assistant location. + public void SetLocation(HomeassistantSetLocationParameters data) + { + _haContext.CallService("homeassistant", "set_location", null, data); + } + + ///Updates the Home Assistant location. + ///Latitude of your location. eg: 32.87336 + ///Longitude of your location. eg: 117.22743 + public void SetLocation(string latitude, string longitude) + { + _haContext.CallService("homeassistant", "set_location", null, new HomeassistantSetLocationParameters { Latitude = latitude, Longitude = longitude }); + } + + ///Stops Home Assistant. + public void Stop() + { + _haContext.CallService("homeassistant", "stop", null); + } + + ///Generic service to toggle devices on/off under any domain. + ///The target for this service call + public void Toggle(ServiceTarget target) + { + _haContext.CallService("homeassistant", "toggle", target); + } + + ///Generic service to turn devices off under any domain. + ///The target for this service call + public void TurnOff(ServiceTarget target) + { + _haContext.CallService("homeassistant", "turn_off", target); + } + + ///Generic service to turn devices on under any domain. + ///The target for this service call + public void TurnOn(ServiceTarget target) + { + _haContext.CallService("homeassistant", "turn_on", target); + } + + ///Forces one or more entities to update its data. + ///The target for this service call + public void UpdateEntity(ServiceTarget target) + { + _haContext.CallService("homeassistant", "update_entity", target); + } +} + +public partial record HomeassistantReloadConfigEntryParameters +{ + ///The configuration entry ID of the entry to be reloaded. eg: 8955375327824e14ba89e4b29cc3ec9a + [JsonPropertyName("entry_id")] + public string? EntryId { get; init; } +} + +public partial record HomeassistantSetLocationParameters +{ + ///Latitude of your location. eg: 32.87336 + [JsonPropertyName("latitude")] + public string? Latitude { get; init; } + + ///Longitude of your location. eg: 117.22743 + [JsonPropertyName("longitude")] + public string? Longitude { get; init; } +} + +public partial class HumidifierServices +{ + private readonly IHaContext _haContext; + public HumidifierServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Sets the target humidity. + ///The target for this service call + public void SetHumidity(ServiceTarget target, HumidifierSetHumidityParameters data) + { + _haContext.CallService("humidifier", "set_humidity", target, data); + } + + ///Sets the target humidity. + ///The target for this service call + ///Target humidity. + public void SetHumidity(ServiceTarget target, long humidity) + { + _haContext.CallService("humidifier", "set_humidity", target, new HumidifierSetHumidityParameters { Humidity = humidity }); + } + + ///Sets the humidifier operation mode. + ///The target for this service call + public void SetMode(ServiceTarget target, HumidifierSetModeParameters data) + { + _haContext.CallService("humidifier", "set_mode", target, data); + } + + ///Sets the humidifier operation mode. + ///The target for this service call + ///Operation mode. For example, _normal_, _eco_, or _away_. For a list of possible values, refer to the integration documentation. eg: away + public void SetMode(ServiceTarget target, string mode) + { + _haContext.CallService("humidifier", "set_mode", target, new HumidifierSetModeParameters { Mode = mode }); + } + + ///Toggles the humidifier on/off. + ///The target for this service call + public void Toggle(ServiceTarget target) + { + _haContext.CallService("humidifier", "toggle", target); + } + + ///Turns the humidifier off. + ///The target for this service call + public void TurnOff(ServiceTarget target) + { + _haContext.CallService("humidifier", "turn_off", target); + } + + ///Turns the humidifier on. + ///The target for this service call + public void TurnOn(ServiceTarget target) + { + _haContext.CallService("humidifier", "turn_on", target); + } +} + +public partial record HumidifierSetHumidityParameters +{ + ///Target humidity. + [JsonPropertyName("humidity")] + public long? Humidity { get; init; } +} + +public partial record HumidifierSetModeParameters +{ + ///Operation mode. For example, _normal_, _eco_, or _away_. For a list of possible values, refer to the integration documentation. eg: away + [JsonPropertyName("mode")] + public string? Mode { get; init; } +} + +public partial class InputBooleanServices +{ + private readonly IHaContext _haContext; + public InputBooleanServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Reloads helpers from the YAML-configuration. + public void Reload() + { + _haContext.CallService("input_boolean", "reload", null); + } + + ///Toggles the helper on/off. + ///The target for this service call + public void Toggle(ServiceTarget target) + { + _haContext.CallService("input_boolean", "toggle", target); + } + + ///Turns off the helper. + ///The target for this service call + public void TurnOff(ServiceTarget target) + { + _haContext.CallService("input_boolean", "turn_off", target); + } + + ///Turns on the helper. + ///The target for this service call + public void TurnOn(ServiceTarget target) + { + _haContext.CallService("input_boolean", "turn_on", target); + } +} + +public partial class InputButtonServices +{ + private readonly IHaContext _haContext; + public InputButtonServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Mimics the physical button press on the device. + ///The target for this service call + public void Press(ServiceTarget target) + { + _haContext.CallService("input_button", "press", target); + } + + public void Reload() + { + _haContext.CallService("input_button", "reload", null); + } +} + +public partial class InputDatetimeServices +{ + private readonly IHaContext _haContext; + public InputDatetimeServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Reloads helpers from the YAML-configuration. + public void Reload() + { + _haContext.CallService("input_datetime", "reload", null); + } + + ///Sets the date and/or time. + ///The target for this service call + public void SetDatetime(ServiceTarget target, InputDatetimeSetDatetimeParameters data) + { + _haContext.CallService("input_datetime", "set_datetime", target, data); + } + + ///Sets the date and/or time. + ///The target for this service call + ///The target date. eg: "2019-04-20" + ///The target time. eg: "05:04:20" + ///The target date & time. eg: "2019-04-20 05:04:20" + ///The target date & time, expressed by a UNIX timestamp. + public void SetDatetime(ServiceTarget target, string? date = null, DateTime? time = null, string? datetime = null, long? timestamp = null) + { + _haContext.CallService("input_datetime", "set_datetime", target, new InputDatetimeSetDatetimeParameters { Date = date, Time = time, Datetime = datetime, Timestamp = timestamp }); + } +} + +public partial record InputDatetimeSetDatetimeParameters +{ + ///The target date. eg: "2019-04-20" + [JsonPropertyName("date")] + public string? Date { get; init; } + + ///The target time. eg: "05:04:20" + [JsonPropertyName("time")] + public DateTime? Time { get; init; } + + ///The target date & time. eg: "2019-04-20 05:04:20" + [JsonPropertyName("datetime")] + public string? Datetime { get; init; } + + ///The target date & time, expressed by a UNIX timestamp. + [JsonPropertyName("timestamp")] + public long? Timestamp { get; init; } +} + +public partial class InputNumberServices +{ + private readonly IHaContext _haContext; + public InputNumberServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Decrements the current value by 1 step. + ///The target for this service call + public void Decrement(ServiceTarget target) + { + _haContext.CallService("input_number", "decrement", target); + } + + ///Increments the value by 1 step. + ///The target for this service call + public void Increment(ServiceTarget target) + { + _haContext.CallService("input_number", "increment", target); + } + + ///Reloads helpers from the YAML-configuration. + public void Reload() + { + _haContext.CallService("input_number", "reload", null); + } + + ///Sets the value. + ///The target for this service call + public void SetValue(ServiceTarget target, InputNumberSetValueParameters data) + { + _haContext.CallService("input_number", "set_value", target, data); + } + + ///Sets the value. + ///The target for this service call + ///The target value. + public void SetValue(ServiceTarget target, double value) + { + _haContext.CallService("input_number", "set_value", target, new InputNumberSetValueParameters { Value = value }); + } +} + +public partial record InputNumberSetValueParameters +{ + ///The target value. + [JsonPropertyName("value")] + public double? Value { get; init; } +} + +public partial class InputSelectServices +{ + private readonly IHaContext _haContext; + public InputSelectServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Reloads helpers from the YAML-configuration. + public void Reload() + { + _haContext.CallService("input_select", "reload", null); + } + + ///Selects the first option. + ///The target for this service call + public void SelectFirst(ServiceTarget target) + { + _haContext.CallService("input_select", "select_first", target); + } + + ///Selects the last option. + ///The target for this service call + public void SelectLast(ServiceTarget target) + { + _haContext.CallService("input_select", "select_last", target); + } + + ///Select the next option. + ///The target for this service call + public void SelectNext(ServiceTarget target, InputSelectSelectNextParameters data) + { + _haContext.CallService("input_select", "select_next", target, data); + } + + ///Select the next option. + ///The target for this service call + ///If the option should cycle from the last to the first option on the list. + public void SelectNext(ServiceTarget target, bool? cycle = null) + { + _haContext.CallService("input_select", "select_next", target, new InputSelectSelectNextParameters { Cycle = cycle }); + } + + ///Selects an option. + ///The target for this service call + public void SelectOption(ServiceTarget target, InputSelectSelectOptionParameters data) + { + _haContext.CallService("input_select", "select_option", target, data); + } + + ///Selects an option. + ///The target for this service call + ///Option to be selected. eg: "Item A" + public void SelectOption(ServiceTarget target, string option) + { + _haContext.CallService("input_select", "select_option", target, new InputSelectSelectOptionParameters { Option = option }); + } + + ///Selects the previous option. + ///The target for this service call + public void SelectPrevious(ServiceTarget target, InputSelectSelectPreviousParameters data) + { + _haContext.CallService("input_select", "select_previous", target, data); + } + + ///Selects the previous option. + ///The target for this service call + ///If the option should cycle from the last to the first option on the list. + public void SelectPrevious(ServiceTarget target, bool? cycle = null) + { + _haContext.CallService("input_select", "select_previous", target, new InputSelectSelectPreviousParameters { Cycle = cycle }); + } + + ///Sets the options. + ///The target for this service call + public void SetOptions(ServiceTarget target, InputSelectSetOptionsParameters data) + { + _haContext.CallService("input_select", "set_options", target, data); + } + + ///Sets the options. + ///The target for this service call + ///List of options. eg: ["Item A", "Item B", "Item C"] + public void SetOptions(ServiceTarget target, object options) + { + _haContext.CallService("input_select", "set_options", target, new InputSelectSetOptionsParameters { Options = options }); + } +} + +public partial record InputSelectSelectNextParameters +{ + ///If the option should cycle from the last to the first option on the list. + [JsonPropertyName("cycle")] + public bool? Cycle { get; init; } +} + +public partial record InputSelectSelectOptionParameters +{ + ///Option to be selected. eg: "Item A" + [JsonPropertyName("option")] + public string? Option { get; init; } +} + +public partial record InputSelectSelectPreviousParameters +{ + ///If the option should cycle from the last to the first option on the list. + [JsonPropertyName("cycle")] + public bool? Cycle { get; init; } +} + +public partial record InputSelectSetOptionsParameters +{ + ///List of options. eg: ["Item A", "Item B", "Item C"] + [JsonPropertyName("options")] + public object? Options { get; init; } +} + +public partial class InputTextServices +{ + private readonly IHaContext _haContext; + public InputTextServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Reloads helpers from the YAML-configuration. + public void Reload() + { + _haContext.CallService("input_text", "reload", null); + } + + ///Sets the value. + ///The target for this service call + public void SetValue(ServiceTarget target, InputTextSetValueParameters data) + { + _haContext.CallService("input_text", "set_value", target, data); + } + + ///Sets the value. + ///The target for this service call + ///The target value. eg: This is an example text + public void SetValue(ServiceTarget target, string value) + { + _haContext.CallService("input_text", "set_value", target, new InputTextSetValueParameters { Value = value }); + } +} + +public partial record InputTextSetValueParameters +{ + ///The target value. eg: This is an example text + [JsonPropertyName("value")] + public string? Value { get; init; } +} + +public partial class LightServices +{ + private readonly IHaContext _haContext; + public LightServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Toggles one or more lights, from on to off, or, off to on, based on their current state. + ///The target for this service call + public void Toggle(ServiceTarget target, LightToggleParameters data) + { + _haContext.CallService("light", "toggle", target, data); + } + + ///Toggles one or more lights, from on to off, or, off to on, based on their current state. + ///The target for this service call + ///Duration it takes to get to next state. + ///The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue. eg: [255, 100, 100] + ///A human-readable color name. + ///Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100. eg: [300, 70] + ///Color in XY-format. A list of two decimal numbers between 0 and 1. eg: [0.52, 0.43] + ///Color temperature in mireds. + ///Color temperature in Kelvin. + ///Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness. + ///Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness. + ///Set the light to white mode. + ///Name of a light profile to use. eg: relax + ///Tell light to flash, can be either value short or long. + ///Light effect. + public void Toggle(ServiceTarget target, long? transition = null, object? rgbColor = null, object? colorName = null, object? hsColor = null, object? xyColor = null, object? colorTemp = null, long? kelvin = null, long? brightness = null, long? brightnessPct = null, object? white = null, string? profile = null, object? flash = null, string? effect = null) + { + _haContext.CallService("light", "toggle", target, new LightToggleParameters { Transition = transition, RgbColor = rgbColor, ColorName = colorName, HsColor = hsColor, XyColor = xyColor, ColorTemp = colorTemp, Kelvin = kelvin, Brightness = brightness, BrightnessPct = brightnessPct, White = white, Profile = profile, Flash = flash, Effect = effect }); + } + + ///Turn off one or more lights. + ///The target for this service call + public void TurnOff(ServiceTarget target, LightTurnOffParameters data) + { + _haContext.CallService("light", "turn_off", target, data); + } + + ///Turn off one or more lights. + ///The target for this service call + ///Duration it takes to get to next state. + ///Tell light to flash, can be either value short or long. + public void TurnOff(ServiceTarget target, long? transition = null, object? flash = null) + { + _haContext.CallService("light", "turn_off", target, new LightTurnOffParameters { Transition = transition, Flash = flash }); + } + + ///Turn on one or more lights and adjust properties of the light, even when they are turned on already. + ///The target for this service call + public void TurnOn(ServiceTarget target, LightTurnOnParameters data) + { + _haContext.CallService("light", "turn_on", target, data); + } + + ///Turn on one or more lights and adjust properties of the light, even when they are turned on already. + ///The target for this service call + ///Duration it takes to get to next state. + ///The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue. + ///The color in RGBW format. A list of four integers between 0 and 255 representing the values of red, green, blue, and white. eg: [255, 100, 100, 50] + ///The color in RGBWW format. A list of five integers between 0 and 255 representing the values of red, green, blue, cold white, and warm white. eg: [255, 100, 100, 50, 70] + ///A human-readable color name. + ///Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100. eg: [300, 70] + ///Color in XY-format. A list of two decimal numbers between 0 and 1. eg: [0.52, 0.43] + ///Color temperature in mireds. + ///Color temperature in Kelvin. + ///Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness. + ///Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness. + ///Change brightness by an amount. + ///Change brightness by a percentage. + ///Set the light to white mode. + ///Name of a light profile to use. eg: relax + ///Tell light to flash, can be either value short or long. + ///Light effect. + public void TurnOn(ServiceTarget target, long? transition = null, object? rgbColor = null, object? rgbwColor = null, object? rgbwwColor = null, object? colorName = null, object? hsColor = null, object? xyColor = null, object? colorTemp = null, long? kelvin = null, long? brightness = null, long? brightnessPct = null, long? brightnessStep = null, long? brightnessStepPct = null, object? white = null, string? profile = null, object? flash = null, string? effect = null) + { + _haContext.CallService("light", "turn_on", target, new LightTurnOnParameters { Transition = transition, RgbColor = rgbColor, RgbwColor = rgbwColor, RgbwwColor = rgbwwColor, ColorName = colorName, HsColor = hsColor, XyColor = xyColor, ColorTemp = colorTemp, Kelvin = kelvin, Brightness = brightness, BrightnessPct = brightnessPct, BrightnessStep = brightnessStep, BrightnessStepPct = brightnessStepPct, White = white, Profile = profile, Flash = flash, Effect = effect }); + } +} + +public partial record LightToggleParameters +{ + ///Duration it takes to get to next state. + [JsonPropertyName("transition")] + public long? Transition { get; init; } + + ///The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue. eg: [255, 100, 100] + [JsonPropertyName("rgb_color")] + public object? RgbColor { get; init; } + + ///A human-readable color name. + [JsonPropertyName("color_name")] + public object? ColorName { get; init; } + + ///Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100. eg: [300, 70] + [JsonPropertyName("hs_color")] + public object? HsColor { get; init; } + + ///Color in XY-format. A list of two decimal numbers between 0 and 1. eg: [0.52, 0.43] + [JsonPropertyName("xy_color")] + public object? XyColor { get; init; } + + ///Color temperature in mireds. + [JsonPropertyName("color_temp")] + public object? ColorTemp { get; init; } + + ///Color temperature in Kelvin. + [JsonPropertyName("kelvin")] + public long? Kelvin { get; init; } + + ///Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness. + [JsonPropertyName("brightness")] + public long? Brightness { get; init; } + + ///Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness. + [JsonPropertyName("brightness_pct")] + public long? BrightnessPct { get; init; } + + ///Set the light to white mode. + [JsonPropertyName("white")] + public object? White { get; init; } + + ///Name of a light profile to use. eg: relax + [JsonPropertyName("profile")] + public string? Profile { get; init; } + + ///Tell light to flash, can be either value short or long. + [JsonPropertyName("flash")] + public object? Flash { get; init; } + + ///Light effect. + [JsonPropertyName("effect")] + public string? Effect { get; init; } +} + +public partial record LightTurnOffParameters +{ + ///Duration it takes to get to next state. + [JsonPropertyName("transition")] + public long? Transition { get; init; } + + ///Tell light to flash, can be either value short or long. + [JsonPropertyName("flash")] + public object? Flash { get; init; } +} + +public partial record LightTurnOnParameters +{ + ///Duration it takes to get to next state. + [JsonPropertyName("transition")] + public long? Transition { get; init; } + + ///The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue. + [JsonPropertyName("rgb_color")] + public object? RgbColor { get; init; } + + ///The color in RGBW format. A list of four integers between 0 and 255 representing the values of red, green, blue, and white. eg: [255, 100, 100, 50] + [JsonPropertyName("rgbw_color")] + public object? RgbwColor { get; init; } + + ///The color in RGBWW format. A list of five integers between 0 and 255 representing the values of red, green, blue, cold white, and warm white. eg: [255, 100, 100, 50, 70] + [JsonPropertyName("rgbww_color")] + public object? RgbwwColor { get; init; } + + ///A human-readable color name. + [JsonPropertyName("color_name")] + public object? ColorName { get; init; } + + ///Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100. eg: [300, 70] + [JsonPropertyName("hs_color")] + public object? HsColor { get; init; } + + ///Color in XY-format. A list of two decimal numbers between 0 and 1. eg: [0.52, 0.43] + [JsonPropertyName("xy_color")] + public object? XyColor { get; init; } + + ///Color temperature in mireds. + [JsonPropertyName("color_temp")] + public object? ColorTemp { get; init; } + + ///Color temperature in Kelvin. + [JsonPropertyName("kelvin")] + public long? Kelvin { get; init; } + + ///Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness. + [JsonPropertyName("brightness")] + public long? Brightness { get; init; } + + ///Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness. + [JsonPropertyName("brightness_pct")] + public long? BrightnessPct { get; init; } + + ///Change brightness by an amount. + [JsonPropertyName("brightness_step")] + public long? BrightnessStep { get; init; } + + ///Change brightness by a percentage. + [JsonPropertyName("brightness_step_pct")] + public long? BrightnessStepPct { get; init; } + + ///Set the light to white mode. + [JsonPropertyName("white")] + public object? White { get; init; } + + ///Name of a light profile to use. eg: relax + [JsonPropertyName("profile")] + public string? Profile { get; init; } + + ///Tell light to flash, can be either value short or long. + [JsonPropertyName("flash")] + public object? Flash { get; init; } + + ///Light effect. + [JsonPropertyName("effect")] + public string? Effect { get; init; } +} + +public partial class LockServices +{ + private readonly IHaContext _haContext; + public LockServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Locks a lock. + ///The target for this service call + public void Lock(ServiceTarget target, LockLockParameters data) + { + _haContext.CallService("lock", "lock", target, data); + } + + ///Locks a lock. + ///The target for this service call + ///Code used to lock the lock. eg: 1234 + public void Lock(ServiceTarget target, string? code = null) + { + _haContext.CallService("lock", "lock", target, new LockLockParameters { Code = code }); + } + + ///Opens a lock. + ///The target for this service call + public void Open(ServiceTarget target, LockOpenParameters data) + { + _haContext.CallService("lock", "open", target, data); + } + + ///Opens a lock. + ///The target for this service call + ///Code used to open the lock. eg: 1234 + public void Open(ServiceTarget target, string? code = null) + { + _haContext.CallService("lock", "open", target, new LockOpenParameters { Code = code }); + } + + ///Unlocks a lock. + ///The target for this service call + public void Unlock(ServiceTarget target, LockUnlockParameters data) + { + _haContext.CallService("lock", "unlock", target, data); + } + + ///Unlocks a lock. + ///The target for this service call + ///Code used to unlock the lock. eg: 1234 + public void Unlock(ServiceTarget target, string? code = null) + { + _haContext.CallService("lock", "unlock", target, new LockUnlockParameters { Code = code }); + } +} + +public partial record LockLockParameters +{ + ///Code used to lock the lock. eg: 1234 + [JsonPropertyName("code")] + public string? Code { get; init; } +} + +public partial record LockOpenParameters +{ + ///Code used to open the lock. eg: 1234 + [JsonPropertyName("code")] + public string? Code { get; init; } +} + +public partial record LockUnlockParameters +{ + ///Code used to unlock the lock. eg: 1234 + [JsonPropertyName("code")] + public string? Code { get; init; } +} + +public partial class LogbookServices +{ + private readonly IHaContext _haContext; + public LogbookServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Creates a custom entry in the logbook. + public void Log(LogbookLogParameters data) + { + _haContext.CallService("logbook", "log", null, data); + } + + ///Creates a custom entry in the logbook. + ///Custom name for an entity, can be referenced using an `entity_id`. eg: Kitchen + ///Message of the logbook entry. eg: is being used + ///Entity to reference in the logbook entry. + ///Determines which icon is used in the logbook entry. The icon illustrates the integration domain related to this logbook entry. eg: light + public void Log(string name, string message, string? entityId = null, string? domain = null) + { + _haContext.CallService("logbook", "log", null, new LogbookLogParameters { Name = name, Message = message, EntityId = entityId, Domain = domain }); + } +} + +public partial record LogbookLogParameters +{ + ///Custom name for an entity, can be referenced using an `entity_id`. eg: Kitchen + [JsonPropertyName("name")] + public string? Name { get; init; } + + ///Message of the logbook entry. eg: is being used + [JsonPropertyName("message")] + public string? Message { get; init; } + + ///Entity to reference in the logbook entry. + [JsonPropertyName("entity_id")] + public string? EntityId { get; init; } + + ///Determines which icon is used in the logbook entry. The icon illustrates the integration domain related to this logbook entry. eg: light + [JsonPropertyName("domain")] + public string? Domain { get; init; } +} + +public partial class LoggerServices +{ + private readonly IHaContext _haContext; + public LoggerServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Sets the default log level for integrations. + public void SetDefaultLevel(LoggerSetDefaultLevelParameters data) + { + _haContext.CallService("logger", "set_default_level", null, data); + } + + ///Sets the default log level for integrations. + ///Default severity level for all integrations. + public void SetDefaultLevel(object? level = null) + { + _haContext.CallService("logger", "set_default_level", null, new LoggerSetDefaultLevelParameters { Level = level }); + } + + ///Sets the log level for one or more integrations. + public void SetLevel() + { + _haContext.CallService("logger", "set_level", null); + } +} + +public partial record LoggerSetDefaultLevelParameters +{ + ///Default severity level for all integrations. + [JsonPropertyName("level")] + public object? Level { get; init; } +} + +public partial class MediaPlayerServices +{ + private readonly IHaContext _haContext; + public MediaPlayerServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Clears the playlist. + ///The target for this service call + public void ClearPlaylist(ServiceTarget target) + { + _haContext.CallService("media_player", "clear_playlist", target); + } + + ///Groups media players together for synchronous playback. Only works on supported multiroom audio systems. + ///The target for this service call + public void Join(ServiceTarget target, MediaPlayerJoinParameters data) + { + _haContext.CallService("media_player", "join", target, data); + } + + ///Groups media players together for synchronous playback. Only works on supported multiroom audio systems. + ///The target for this service call + ///The players which will be synced with the playback specified in `target`. eg: - media_player.multiroom_player2 - media_player.multiroom_player3 + public void Join(ServiceTarget target, string groupMembers) + { + _haContext.CallService("media_player", "join", target, new MediaPlayerJoinParameters { GroupMembers = groupMembers }); + } + + ///Selects the next track. + ///The target for this service call + public void MediaNextTrack(ServiceTarget target) + { + _haContext.CallService("media_player", "media_next_track", target); + } + + ///Pauses. + ///The target for this service call + public void MediaPause(ServiceTarget target) + { + _haContext.CallService("media_player", "media_pause", target); + } + + ///Starts playing. + ///The target for this service call + public void MediaPlay(ServiceTarget target) + { + _haContext.CallService("media_player", "media_play", target); + } + + ///Toggles play/pause. + ///The target for this service call + public void MediaPlayPause(ServiceTarget target) + { + _haContext.CallService("media_player", "media_play_pause", target); + } + + ///Selects the previous track. + ///The target for this service call + public void MediaPreviousTrack(ServiceTarget target) + { + _haContext.CallService("media_player", "media_previous_track", target); + } + + ///Allows you to go to a different part of the media that is currently playing. + ///The target for this service call + public void MediaSeek(ServiceTarget target, MediaPlayerMediaSeekParameters data) + { + _haContext.CallService("media_player", "media_seek", target, data); + } + + ///Allows you to go to a different part of the media that is currently playing. + ///The target for this service call + ///Target position in the currently playing media. The format is platform dependent. + public void MediaSeek(ServiceTarget target, double seekPosition) + { + _haContext.CallService("media_player", "media_seek", target, new MediaPlayerMediaSeekParameters { SeekPosition = seekPosition }); + } + + ///Stops playing. + ///The target for this service call + public void MediaStop(ServiceTarget target) + { + _haContext.CallService("media_player", "media_stop", target); + } + + ///Starts playing specified media. + ///The target for this service call + public void PlayMedia(ServiceTarget target, MediaPlayerPlayMediaParameters data) + { + _haContext.CallService("media_player", "play_media", target, data); + } + + ///Starts playing specified media. + ///The target for this service call + ///The ID of the content to play. Platform dependent. eg: https://home-assistant.io/images/cast/splash.png + ///The type of the content to play. Such as image, music, tv show, video, episode, channel, or playlist. eg: music + ///If the content should be played now or be added to the queue. + ///If the media should be played as an announcement. eg: true + public void PlayMedia(ServiceTarget target, string mediaContentId, string mediaContentType, object? enqueue = null, bool? announce = null) + { + _haContext.CallService("media_player", "play_media", target, new MediaPlayerPlayMediaParameters { MediaContentId = mediaContentId, MediaContentType = mediaContentType, Enqueue = enqueue, Announce = announce }); + } + + ///Playback mode that plays the media in a loop. + ///The target for this service call + public void RepeatSet(ServiceTarget target, MediaPlayerRepeatSetParameters data) + { + _haContext.CallService("media_player", "repeat_set", target, data); + } + + ///Playback mode that plays the media in a loop. + ///The target for this service call + ///Repeat mode to set. + public void RepeatSet(ServiceTarget target, object repeat) + { + _haContext.CallService("media_player", "repeat_set", target, new MediaPlayerRepeatSetParameters { Repeat = repeat }); + } + + ///Selects a specific sound mode. + ///The target for this service call + public void SelectSoundMode(ServiceTarget target, MediaPlayerSelectSoundModeParameters data) + { + _haContext.CallService("media_player", "select_sound_mode", target, data); + } + + ///Selects a specific sound mode. + ///The target for this service call + ///Name of the sound mode to switch to. eg: Music + public void SelectSoundMode(ServiceTarget target, string? soundMode = null) + { + _haContext.CallService("media_player", "select_sound_mode", target, new MediaPlayerSelectSoundModeParameters { SoundMode = soundMode }); + } + + ///Sends the media player the command to change input source. + ///The target for this service call + public void SelectSource(ServiceTarget target, MediaPlayerSelectSourceParameters data) + { + _haContext.CallService("media_player", "select_source", target, data); + } + + ///Sends the media player the command to change input source. + ///The target for this service call + ///Name of the source to switch to. Platform dependent. eg: video1 + public void SelectSource(ServiceTarget target, string source) + { + _haContext.CallService("media_player", "select_source", target, new MediaPlayerSelectSourceParameters { Source = source }); + } + + ///Playback mode that selects the media in randomized order. + ///The target for this service call + public void ShuffleSet(ServiceTarget target, MediaPlayerShuffleSetParameters data) + { + _haContext.CallService("media_player", "shuffle_set", target, data); + } + + ///Playback mode that selects the media in randomized order. + ///The target for this service call + ///Whether or not shuffle mode is enabled. + public void ShuffleSet(ServiceTarget target, bool shuffle) + { + _haContext.CallService("media_player", "shuffle_set", target, new MediaPlayerShuffleSetParameters { Shuffle = shuffle }); + } + + ///Toggles a media player on/off. + ///The target for this service call + public void Toggle(ServiceTarget target) + { + _haContext.CallService("media_player", "toggle", target); + } + + ///Turns off the power of the media player. + ///The target for this service call + public void TurnOff(ServiceTarget target) + { + _haContext.CallService("media_player", "turn_off", target); + } + + ///Turns on the power of the media player. + ///The target for this service call + public void TurnOn(ServiceTarget target) + { + _haContext.CallService("media_player", "turn_on", target); + } + + ///Removes the player from a group. Only works on platforms which support player groups. + ///The target for this service call + public void Unjoin(ServiceTarget target) + { + _haContext.CallService("media_player", "unjoin", target); + } + + ///Turns down the volume. + ///The target for this service call + public void VolumeDown(ServiceTarget target) + { + _haContext.CallService("media_player", "volume_down", target); + } + + ///Mutes or unmutes the media player. + ///The target for this service call + public void VolumeMute(ServiceTarget target, MediaPlayerVolumeMuteParameters data) + { + _haContext.CallService("media_player", "volume_mute", target, data); + } + + ///Mutes or unmutes the media player. + ///The target for this service call + ///Defines whether or not it is muted. + public void VolumeMute(ServiceTarget target, bool isVolumeMuted) + { + _haContext.CallService("media_player", "volume_mute", target, new MediaPlayerVolumeMuteParameters { IsVolumeMuted = isVolumeMuted }); + } + + ///Sets the volume level. + ///The target for this service call + public void VolumeSet(ServiceTarget target, MediaPlayerVolumeSetParameters data) + { + _haContext.CallService("media_player", "volume_set", target, data); + } + + ///Sets the volume level. + ///The target for this service call + ///The volume. 0 is inaudible, 1 is the maximum volume. + public void VolumeSet(ServiceTarget target, double volumeLevel) + { + _haContext.CallService("media_player", "volume_set", target, new MediaPlayerVolumeSetParameters { VolumeLevel = volumeLevel }); + } + + ///Turns up the volume. + ///The target for this service call + public void VolumeUp(ServiceTarget target) + { + _haContext.CallService("media_player", "volume_up", target); + } +} + +public partial record MediaPlayerJoinParameters +{ + ///The players which will be synced with the playback specified in `target`. eg: - media_player.multiroom_player2 - media_player.multiroom_player3 + [JsonPropertyName("group_members")] + public string? GroupMembers { get; init; } +} + +public partial record MediaPlayerMediaSeekParameters +{ + ///Target position in the currently playing media. The format is platform dependent. + [JsonPropertyName("seek_position")] + public double? SeekPosition { get; init; } +} + +public partial record MediaPlayerPlayMediaParameters +{ + ///The ID of the content to play. Platform dependent. eg: https://home-assistant.io/images/cast/splash.png + [JsonPropertyName("media_content_id")] + public string? MediaContentId { get; init; } + + ///The type of the content to play. Such as image, music, tv show, video, episode, channel, or playlist. eg: music + [JsonPropertyName("media_content_type")] + public string? MediaContentType { get; init; } + + ///If the content should be played now or be added to the queue. + [JsonPropertyName("enqueue")] + public object? Enqueue { get; init; } + + ///If the media should be played as an announcement. eg: true + [JsonPropertyName("announce")] + public bool? Announce { get; init; } +} + +public partial record MediaPlayerRepeatSetParameters +{ + ///Repeat mode to set. + [JsonPropertyName("repeat")] + public object? Repeat { get; init; } +} + +public partial record MediaPlayerSelectSoundModeParameters +{ + ///Name of the sound mode to switch to. eg: Music + [JsonPropertyName("sound_mode")] + public string? SoundMode { get; init; } +} + +public partial record MediaPlayerSelectSourceParameters +{ + ///Name of the source to switch to. Platform dependent. eg: video1 + [JsonPropertyName("source")] + public string? Source { get; init; } +} + +public partial record MediaPlayerShuffleSetParameters +{ + ///Whether or not shuffle mode is enabled. + [JsonPropertyName("shuffle")] + public bool? Shuffle { get; init; } +} + +public partial record MediaPlayerVolumeMuteParameters +{ + ///Defines whether or not it is muted. + [JsonPropertyName("is_volume_muted")] + public bool? IsVolumeMuted { get; init; } +} + +public partial record MediaPlayerVolumeSetParameters +{ + ///The volume. 0 is inaudible, 1 is the maximum volume. + [JsonPropertyName("volume_level")] + public double? VolumeLevel { get; init; } +} + +public partial class MqttServices +{ + private readonly IHaContext _haContext; + public MqttServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Writes all messages on a specific topic into the `mqtt_dump.txt` file in your configuration folder. + public void Dump(MqttDumpParameters data) + { + _haContext.CallService("mqtt", "dump", null, data); + } + + ///Writes all messages on a specific topic into the `mqtt_dump.txt` file in your configuration folder. + ///Topic to listen to. eg: OpenZWave/# + ///How long we should listen for messages in seconds. + public void Dump(string? topic = null, long? duration = null) + { + _haContext.CallService("mqtt", "dump", null, new MqttDumpParameters { Topic = topic, Duration = duration }); + } + + ///Publishes a message to an MQTT topic. + public void Publish(MqttPublishParameters data) + { + _haContext.CallService("mqtt", "publish", null, data); + } + + ///Publishes a message to an MQTT topic. + ///Topic to publish to. eg: /homeassistant/hello + ///The payload to publish. eg: This is great + ///Template to render as a payload value. If a payload is provided, the template is ignored. eg: {{ states('sensor.temperature') }} + ///Quality of Service to use. O. At most once. 1: At least once. 2: Exactly once. + ///If the message should have the retain flag set. If set, the broker stores the most recent message on a topic. + public void Publish(string topic, string? payload = null, object? payloadTemplate = null, object? qos = null, bool? retain = null) + { + _haContext.CallService("mqtt", "publish", null, new MqttPublishParameters { Topic = topic, Payload = payload, PayloadTemplate = payloadTemplate, Qos = qos, Retain = retain }); + } + + ///Reloads MQTT entities from the YAML-configuration. + public void Reload() + { + _haContext.CallService("mqtt", "reload", null); + } +} + +public partial record MqttDumpParameters +{ + ///Topic to listen to. eg: OpenZWave/# + [JsonPropertyName("topic")] + public string? Topic { get; init; } + + ///How long we should listen for messages in seconds. + [JsonPropertyName("duration")] + public long? Duration { get; init; } +} + +public partial record MqttPublishParameters +{ + ///Topic to publish to. eg: /homeassistant/hello + [JsonPropertyName("topic")] + public string? Topic { get; init; } + + ///The payload to publish. eg: This is great + [JsonPropertyName("payload")] + public string? Payload { get; init; } + + ///Template to render as a payload value. If a payload is provided, the template is ignored. eg: {{ states('sensor.temperature') }} + [JsonPropertyName("payload_template")] + public object? PayloadTemplate { get; init; } + + ///Quality of Service to use. O. At most once. 1: At least once. 2: Exactly once. + [JsonPropertyName("qos")] + public object? Qos { get; init; } + + ///If the message should have the retain flag set. If set, the broker stores the most recent message on a topic. + [JsonPropertyName("retain")] + public bool? Retain { get; init; } +} + +public partial class NetdaemonServices +{ + private readonly IHaContext _haContext; + public NetdaemonServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Create an entity + public void EntityCreate(NetdaemonEntityCreateParameters data) + { + _haContext.CallService("netdaemon", "entity_create", null, data); + } + + ///Create an entity + ///The entity ID of the entity eg: sensor.awesome + ///The state of the entity eg: Lorem ipsum + ///The icon for the entity eg: mdi:rocket-launch-outline + ///The unit of measurement for the entity + ///List of options for a select entity + ///The attributes of the entity + public void EntityCreate(object? entityId = null, object? state = null, object? icon = null, object? unit = null, object? options = null, object? attributes = null) + { + _haContext.CallService("netdaemon", "entity_create", null, new NetdaemonEntityCreateParameters { EntityId = entityId, State = state, Icon = icon, Unit = unit, Options = options, Attributes = attributes }); + } + + ///Remove an entity + public void EntityRemove(NetdaemonEntityRemoveParameters data) + { + _haContext.CallService("netdaemon", "entity_remove", null, data); + } + + ///Remove an entity + ///The entity ID of the entity eg: sensor.awesome + public void EntityRemove(object? entityId = null) + { + _haContext.CallService("netdaemon", "entity_remove", null, new NetdaemonEntityRemoveParameters { EntityId = entityId }); + } + + ///Update an entity + public void EntityUpdate(NetdaemonEntityUpdateParameters data) + { + _haContext.CallService("netdaemon", "entity_update", null, data); + } + + ///Update an entity + ///The entity ID of the entity eg: sensor.awesome + ///The state of the entity eg: Lorem ipsum + ///The icon for the entity eg: mdi:rocket-launch-outline + ///The unit of measurement for the entity + ///List of options for a select entity + ///The attributes of the entity + public void EntityUpdate(object? entityId = null, object? state = null, object? icon = null, object? unit = null, object? options = null, object? attributes = null) + { + _haContext.CallService("netdaemon", "entity_update", null, new NetdaemonEntityUpdateParameters { EntityId = entityId, State = state, Icon = icon, Unit = unit, Options = options, Attributes = attributes }); + } + + ///Register a new service for netdaemon, used by the daemon and not to be used by users + public void RegisterService(NetdaemonRegisterServiceParameters data) + { + _haContext.CallService("netdaemon", "register_service", null, data); + } + + ///Register a new service for netdaemon, used by the daemon and not to be used by users + ///The name of the service to register + ///The class that implements the service call + ///The method to call + public void RegisterService(object? service = null, object? @class = null, object? @method = null) + { + _haContext.CallService("netdaemon", "register_service", null, new NetdaemonRegisterServiceParameters { Service = service, Class = @class, Method = @method }); + } + + public void ReloadApps() + { + _haContext.CallService("netdaemon", "reload_apps", null); + } +} + +public partial record NetdaemonEntityCreateParameters +{ + ///The entity ID of the entity eg: sensor.awesome + [JsonPropertyName("entity_id")] + public object? EntityId { get; init; } + + ///The state of the entity eg: Lorem ipsum + [JsonPropertyName("state")] + public object? State { get; init; } + + ///The icon for the entity eg: mdi:rocket-launch-outline + [JsonPropertyName("icon")] + public object? Icon { get; init; } + + ///The unit of measurement for the entity + [JsonPropertyName("unit")] + public object? Unit { get; init; } + + ///List of options for a select entity + [JsonPropertyName("options")] + public object? Options { get; init; } + + ///The attributes of the entity + [JsonPropertyName("attributes")] + public object? Attributes { get; init; } +} + +public partial record NetdaemonEntityRemoveParameters +{ + ///The entity ID of the entity eg: sensor.awesome + [JsonPropertyName("entity_id")] + public object? EntityId { get; init; } +} + +public partial record NetdaemonEntityUpdateParameters +{ + ///The entity ID of the entity eg: sensor.awesome + [JsonPropertyName("entity_id")] + public object? EntityId { get; init; } + + ///The state of the entity eg: Lorem ipsum + [JsonPropertyName("state")] + public object? State { get; init; } + + ///The icon for the entity eg: mdi:rocket-launch-outline + [JsonPropertyName("icon")] + public object? Icon { get; init; } + + ///The unit of measurement for the entity + [JsonPropertyName("unit")] + public object? Unit { get; init; } + + ///List of options for a select entity + [JsonPropertyName("options")] + public object? Options { get; init; } + + ///The attributes of the entity + [JsonPropertyName("attributes")] + public object? Attributes { get; init; } +} + +public partial record NetdaemonRegisterServiceParameters +{ + ///The name of the service to register + [JsonPropertyName("service")] + public object? Service { get; init; } + + ///The class that implements the service call + [JsonPropertyName("class")] + public object? Class { get; init; } + + ///The method to call + [JsonPropertyName("method")] + public object? Method { get; init; } +} + +public partial class NotifyServices +{ + private readonly IHaContext _haContext; + public NotifyServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Sends a notification message using the mobile_app_deengph001 integration. + public void MobileAppDeengph001(NotifyMobileAppDeengph001Parameters data) + { + _haContext.CallService("notify", "mobile_app_deengph001", null, data); + } + + ///Sends a notification message using the mobile_app_deengph001 integration. + /// eg: The garage door has been open for 10 minutes. + /// eg: Your Garage Door Friend + /// eg: platform specific + /// eg: platform specific + public void MobileAppDeengph001(string message, string? title = null, object? target = null, object? data = null) + { + _haContext.CallService("notify", "mobile_app_deengph001", null, new NotifyMobileAppDeengph001Parameters { Message = message, Title = title, Target = target, Data = data }); + } + + ///Sends a notification message using the mobile_app_deengph002 integration. + public void MobileAppDeengph002(NotifyMobileAppDeengph002Parameters data) + { + _haContext.CallService("notify", "mobile_app_deengph002", null, data); + } + + ///Sends a notification message using the mobile_app_deengph002 integration. + /// eg: The garage door has been open for 10 minutes. + /// eg: Your Garage Door Friend + /// eg: platform specific + /// eg: platform specific + public void MobileAppDeengph002(string message, string? title = null, object? target = null, object? data = null) + { + _haContext.CallService("notify", "mobile_app_deengph002", null, new NotifyMobileAppDeengph002Parameters { Message = message, Title = title, Target = target, Data = data }); + } + + ///Sends a notification message using the notify service. + public void Notify(NotifyNotifyParameters data) + { + _haContext.CallService("notify", "notify", null, data); + } + + ///Sends a notification message using the notify service. + /// eg: The garage door has been open for 10 minutes. + /// eg: Your Garage Door Friend + /// eg: platform specific + /// eg: platform specific + public void Notify(string message, string? title = null, object? target = null, object? data = null) + { + _haContext.CallService("notify", "notify", null, new NotifyNotifyParameters { Message = message, Title = title, Target = target, Data = data }); + } + + ///Sends a notification that is visible in the **Notifications** panel. + public void PersistentNotification(NotifyPersistentNotificationParameters data) + { + _haContext.CallService("notify", "persistent_notification", null, data); + } + + ///Sends a notification that is visible in the **Notifications** panel. + ///Message body of the notification. eg: The garage door has been open for 10 minutes. + ///Title of the notification. eg: Your Garage Door Friend + ///Some integrations provide extended functionality. For information on how to use _data_, refer to the integration documentation.. eg: platform specific + public void PersistentNotification(string message, string? title = null, object? data = null) + { + _haContext.CallService("notify", "persistent_notification", null, new NotifyPersistentNotificationParameters { Message = message, Title = title, Data = data }); + } + + ///Sends a notification message using the whatsapp service. + public void Whatsapp(NotifyWhatsappParameters data) + { + _haContext.CallService("notify", "whatsapp", null, data); + } + + ///Sends a notification message using the whatsapp service. + /// eg: The garage door has been open for 10 minutes. + /// eg: Your Garage Door Friend + /// eg: platform specific + /// eg: platform specific + public void Whatsapp(string message, string? title = null, object? target = null, object? data = null) + { + _haContext.CallService("notify", "whatsapp", null, new NotifyWhatsappParameters { Message = message, Title = title, Target = target, Data = data }); + } +} + +public partial record NotifyMobileAppDeengph001Parameters +{ + /// eg: The garage door has been open for 10 minutes. + [JsonPropertyName("message")] + public string? Message { get; init; } + + /// eg: Your Garage Door Friend + [JsonPropertyName("title")] + public string? Title { get; init; } + + /// eg: platform specific + [JsonPropertyName("target")] + public object? Target { get; init; } + + /// eg: platform specific + [JsonPropertyName("data")] + public object? Data { get; init; } +} + +public partial record NotifyMobileAppDeengph002Parameters +{ + /// eg: The garage door has been open for 10 minutes. + [JsonPropertyName("message")] + public string? Message { get; init; } + + /// eg: Your Garage Door Friend + [JsonPropertyName("title")] + public string? Title { get; init; } + + /// eg: platform specific + [JsonPropertyName("target")] + public object? Target { get; init; } + + /// eg: platform specific + [JsonPropertyName("data")] + public object? Data { get; init; } +} + +public partial record NotifyNotifyParameters +{ + /// eg: The garage door has been open for 10 minutes. + [JsonPropertyName("message")] + public string? Message { get; init; } + + /// eg: Your Garage Door Friend + [JsonPropertyName("title")] + public string? Title { get; init; } + + /// eg: platform specific + [JsonPropertyName("target")] + public object? Target { get; init; } + + /// eg: platform specific + [JsonPropertyName("data")] + public object? Data { get; init; } +} + +public partial record NotifyPersistentNotificationParameters +{ + ///Message body of the notification. eg: The garage door has been open for 10 minutes. + [JsonPropertyName("message")] + public string? Message { get; init; } + + ///Title of the notification. eg: Your Garage Door Friend + [JsonPropertyName("title")] + public string? Title { get; init; } + + ///Some integrations provide extended functionality. For information on how to use _data_, refer to the integration documentation.. eg: platform specific + [JsonPropertyName("data")] + public object? Data { get; init; } +} + +public partial record NotifyWhatsappParameters +{ + /// eg: The garage door has been open for 10 minutes. + [JsonPropertyName("message")] + public string? Message { get; init; } + + /// eg: Your Garage Door Friend + [JsonPropertyName("title")] + public string? Title { get; init; } + + /// eg: platform specific + [JsonPropertyName("target")] + public object? Target { get; init; } + + /// eg: platform specific + [JsonPropertyName("data")] + public object? Data { get; init; } +} + +public partial class NumberServices +{ + private readonly IHaContext _haContext; + public NumberServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Sets the value of a number. + ///The target for this service call + public void SetValue(ServiceTarget target, NumberSetValueParameters data) + { + _haContext.CallService("number", "set_value", target, data); + } + + ///Sets the value of a number. + ///The target for this service call + ///The target value to set. eg: 42 + public void SetValue(ServiceTarget target, string? value = null) + { + _haContext.CallService("number", "set_value", target, new NumberSetValueParameters { Value = value }); + } +} + +public partial record NumberSetValueParameters +{ + ///The target value to set. eg: 42 + [JsonPropertyName("value")] + public string? Value { get; init; } +} + +public partial class PersistentNotificationServices +{ + private readonly IHaContext _haContext; + public PersistentNotificationServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Shows a notification on the **Notifications** panel. + public void Create(PersistentNotificationCreateParameters data) + { + _haContext.CallService("persistent_notification", "create", null, data); + } + + ///Shows a notification on the **Notifications** panel. + ///Message body of the notification. eg: Please check your configuration.yaml. + ///Optional title of the notification. eg: Test notification + ///ID of the notification. This new notification will overwrite an existing notification with the same ID. eg: 1234 + public void Create(string message, string? title = null, string? notificationId = null) + { + _haContext.CallService("persistent_notification", "create", null, new PersistentNotificationCreateParameters { Message = message, Title = title, NotificationId = notificationId }); + } + + ///Removes a notification from the **Notifications** panel. + public void Dismiss(PersistentNotificationDismissParameters data) + { + _haContext.CallService("persistent_notification", "dismiss", null, data); + } + + ///Removes a notification from the **Notifications** panel. + ///ID of the notification to be removed. eg: 1234 + public void Dismiss(string notificationId) + { + _haContext.CallService("persistent_notification", "dismiss", null, new PersistentNotificationDismissParameters { NotificationId = notificationId }); + } + + ///Removes all notifications from the **Notifications** panel. + public void DismissAll() + { + _haContext.CallService("persistent_notification", "dismiss_all", null); + } +} + +public partial record PersistentNotificationCreateParameters +{ + ///Message body of the notification. eg: Please check your configuration.yaml. + [JsonPropertyName("message")] + public string? Message { get; init; } + + ///Optional title of the notification. eg: Test notification + [JsonPropertyName("title")] + public string? Title { get; init; } + + ///ID of the notification. This new notification will overwrite an existing notification with the same ID. eg: 1234 + [JsonPropertyName("notification_id")] + public string? NotificationId { get; init; } +} + +public partial record PersistentNotificationDismissParameters +{ + ///ID of the notification to be removed. eg: 1234 + [JsonPropertyName("notification_id")] + public string? NotificationId { get; init; } +} + +public partial class PersonServices +{ + private readonly IHaContext _haContext; + public PersonServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Reloads persons from the YAML-configuration. + public void Reload() + { + _haContext.CallService("person", "reload", null); + } +} + +public partial class RecorderServices +{ + private readonly IHaContext _haContext; + public RecorderServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Stops the recording of events and state changes. + public void Disable() + { + _haContext.CallService("recorder", "disable", null); + } + + ///Starts the recording of events and state changes. + public void Enable() + { + _haContext.CallService("recorder", "enable", null); + } + + ///Starts purge task - to clean up old data from your database. + public void Purge(RecorderPurgeParameters data) + { + _haContext.CallService("recorder", "purge", null, data); + } + + ///Starts purge task - to clean up old data from your database. + ///Number of days to keep the data in the database. Starting today, counting backward. A value of `7` means that everything older than a week will be purged. + ///Attempt to save disk space by rewriting the entire database file. + ///Applys `entity_id` and `event_type` filters in addition to time-based purge. + public void Purge(long? keepDays = null, bool? repack = null, bool? applyFilter = null) + { + _haContext.CallService("recorder", "purge", null, new RecorderPurgeParameters { KeepDays = keepDays, Repack = repack, ApplyFilter = applyFilter }); + } + + ///Starts a purge task to remove the data related to specific entities from your database. + ///The target for this service call + public void PurgeEntities(ServiceTarget target, RecorderPurgeEntitiesParameters data) + { + _haContext.CallService("recorder", "purge_entities", target, data); + } + + ///Starts a purge task to remove the data related to specific entities from your database. + ///The target for this service call + ///List of domains for which the data needs to be removed from the recorder database. eg: sun + ///List of glob patterns used to select the entities for which the data is to be removed from the recorder database. eg: domain*.object_id* + ///Number of days to keep the data for rows matching the filter. Starting today, counting backward. A value of `7` means that everything older than a week will be purged. The default of 0 days will remove all matching rows immediately. + public void PurgeEntities(ServiceTarget target, object? domains = null, object? entityGlobs = null, long? keepDays = null) + { + _haContext.CallService("recorder", "purge_entities", target, new RecorderPurgeEntitiesParameters { Domains = domains, EntityGlobs = entityGlobs, KeepDays = keepDays }); + } +} + +public partial record RecorderPurgeParameters +{ + ///Number of days to keep the data in the database. Starting today, counting backward. A value of `7` means that everything older than a week will be purged. + [JsonPropertyName("keep_days")] + public long? KeepDays { get; init; } + + ///Attempt to save disk space by rewriting the entire database file. + [JsonPropertyName("repack")] + public bool? Repack { get; init; } + + ///Applys `entity_id` and `event_type` filters in addition to time-based purge. + [JsonPropertyName("apply_filter")] + public bool? ApplyFilter { get; init; } +} + +public partial record RecorderPurgeEntitiesParameters +{ + ///List of domains for which the data needs to be removed from the recorder database. eg: sun + [JsonPropertyName("domains")] + public object? Domains { get; init; } + + ///List of glob patterns used to select the entities for which the data is to be removed from the recorder database. eg: domain*.object_id* + [JsonPropertyName("entity_globs")] + public object? EntityGlobs { get; init; } + + ///Number of days to keep the data for rows matching the filter. Starting today, counting backward. A value of `7` means that everything older than a week will be purged. The default of 0 days will remove all matching rows immediately. + [JsonPropertyName("keep_days")] + public long? KeepDays { get; init; } +} + +public partial class RestServices +{ + private readonly IHaContext _haContext; + public RestServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Reloads REST entities from the YAML-configuration. + public void Reload() + { + _haContext.CallService("rest", "reload", null); + } +} + +public partial class SceneServices +{ + private readonly IHaContext _haContext; + public SceneServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Activates a scene with configuration. + public void Apply(SceneApplyParameters data) + { + _haContext.CallService("scene", "apply", null, data); + } + + ///Activates a scene with configuration. + ///List of entities and their target state. eg: light.kitchen: "on" light.ceiling: state: "on" brightness: 80 + ///Time it takes the devices to transition into the states defined in the scene. + public void Apply(object entities, long? transition = null) + { + _haContext.CallService("scene", "apply", null, new SceneApplyParameters { Entities = entities, Transition = transition }); + } + + ///Creates a new scene. + public void Create(SceneCreateParameters data) + { + _haContext.CallService("scene", "create", null, data); + } + + ///Creates a new scene. + ///The entity ID of the new scene. eg: all_lights + ///List of entities and their target state. If your entities are already in the target state right now, use `snapshot_entities` instead. eg: light.tv_back_light: "on" light.ceiling: state: "on" brightness: 200 + ///List of entities to be included in the snapshot. By taking a snapshot, you record the current state of those entities. If you do not want to use the current state of all your entities for this scene, you can combine the `snapshot_entities` with `entities`. eg: - light.ceiling - light.kitchen + public void Create(string sceneId, object? entities = null, object? snapshotEntities = null) + { + _haContext.CallService("scene", "create", null, new SceneCreateParameters { SceneId = sceneId, Entities = entities, SnapshotEntities = snapshotEntities }); + } + + ///Reloads the scenes from the YAML-configuration. + public void Reload() + { + _haContext.CallService("scene", "reload", null); + } + + ///Activates a scene. + ///The target for this service call + public void TurnOn(ServiceTarget target, SceneTurnOnParameters data) + { + _haContext.CallService("scene", "turn_on", target, data); + } + + ///Activates a scene. + ///The target for this service call + ///Time it takes the devices to transition into the states defined in the scene. + public void TurnOn(ServiceTarget target, long? transition = null) + { + _haContext.CallService("scene", "turn_on", target, new SceneTurnOnParameters { Transition = transition }); + } +} + +public partial record SceneApplyParameters +{ + ///List of entities and their target state. eg: light.kitchen: "on" light.ceiling: state: "on" brightness: 80 + [JsonPropertyName("entities")] + public object? Entities { get; init; } + + ///Time it takes the devices to transition into the states defined in the scene. + [JsonPropertyName("transition")] + public long? Transition { get; init; } +} + +public partial record SceneCreateParameters +{ + ///The entity ID of the new scene. eg: all_lights + [JsonPropertyName("scene_id")] + public string? SceneId { get; init; } + + ///List of entities and their target state. If your entities are already in the target state right now, use `snapshot_entities` instead. eg: light.tv_back_light: "on" light.ceiling: state: "on" brightness: 200 + [JsonPropertyName("entities")] + public object? Entities { get; init; } + + ///List of entities to be included in the snapshot. By taking a snapshot, you record the current state of those entities. If you do not want to use the current state of all your entities for this scene, you can combine the `snapshot_entities` with `entities`. eg: - light.ceiling - light.kitchen + [JsonPropertyName("snapshot_entities")] + public object? SnapshotEntities { get; init; } +} + +public partial record SceneTurnOnParameters +{ + ///Time it takes the devices to transition into the states defined in the scene. + [JsonPropertyName("transition")] + public long? Transition { get; init; } +} + +public partial class ScheduleServices +{ + private readonly IHaContext _haContext; + public ScheduleServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Reloads schedules from the YAML-configuration. + public void Reload() + { + _haContext.CallService("schedule", "reload", null); + } +} + +public partial class ScriptServices +{ + private readonly IHaContext _haContext; + public ScriptServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Reloads all the available scripts. + public void Reload() + { + _haContext.CallService("script", "reload", null); + } + + ///Toggle a script. Starts it, if isn't running, stops it otherwise. + ///The target for this service call + public void Toggle(ServiceTarget target) + { + _haContext.CallService("script", "toggle", target); + } + + ///Stops a running script. + ///The target for this service call + public void TurnOff(ServiceTarget target) + { + _haContext.CallService("script", "turn_off", target); + } + + ///Runs the sequence of actions defined in a script. + ///The target for this service call + public void TurnOn(ServiceTarget target) + { + _haContext.CallService("script", "turn_on", target); + } +} + +public partial class SelectServices +{ + private readonly IHaContext _haContext; + public SelectServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Selects the first option. + ///The target for this service call + public void SelectFirst(ServiceTarget target) + { + _haContext.CallService("select", "select_first", target); + } + + ///Selects the last option. + ///The target for this service call + public void SelectLast(ServiceTarget target) + { + _haContext.CallService("select", "select_last", target); + } + + ///Selects the next option. + ///The target for this service call + public void SelectNext(ServiceTarget target, SelectSelectNextParameters data) + { + _haContext.CallService("select", "select_next", target, data); + } + + ///Selects the next option. + ///The target for this service call + ///If the option should cycle from the last to the first. + public void SelectNext(ServiceTarget target, bool? cycle = null) + { + _haContext.CallService("select", "select_next", target, new SelectSelectNextParameters { Cycle = cycle }); + } + + ///Selects an option. + ///The target for this service call + public void SelectOption(ServiceTarget target, SelectSelectOptionParameters data) + { + _haContext.CallService("select", "select_option", target, data); + } + + ///Selects an option. + ///The target for this service call + ///Option to be selected. eg: "Item A" + public void SelectOption(ServiceTarget target, string option) + { + _haContext.CallService("select", "select_option", target, new SelectSelectOptionParameters { Option = option }); + } + + ///Selects the previous option. + ///The target for this service call + public void SelectPrevious(ServiceTarget target, SelectSelectPreviousParameters data) + { + _haContext.CallService("select", "select_previous", target, data); + } + + ///Selects the previous option. + ///The target for this service call + ///If the option should cycle from the first to the last. + public void SelectPrevious(ServiceTarget target, bool? cycle = null) + { + _haContext.CallService("select", "select_previous", target, new SelectSelectPreviousParameters { Cycle = cycle }); + } +} + +public partial record SelectSelectNextParameters +{ + ///If the option should cycle from the last to the first. + [JsonPropertyName("cycle")] + public bool? Cycle { get; init; } +} + +public partial record SelectSelectOptionParameters +{ + ///Option to be selected. eg: "Item A" + [JsonPropertyName("option")] + public string? Option { get; init; } +} + +public partial record SelectSelectPreviousParameters +{ + ///If the option should cycle from the first to the last. + [JsonPropertyName("cycle")] + public bool? Cycle { get; init; } +} + +public partial class SirenServices +{ + private readonly IHaContext _haContext; + public SirenServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Toggles the siren on/off. + ///The target for this service call + public void Toggle(ServiceTarget target) + { + _haContext.CallService("siren", "toggle", target); + } + + ///Turns the siren off. + ///The target for this service call + public void TurnOff(ServiceTarget target) + { + _haContext.CallService("siren", "turn_off", target); + } + + ///Turns the siren on. + ///The target for this service call + public void TurnOn(ServiceTarget target, SirenTurnOnParameters data) + { + _haContext.CallService("siren", "turn_on", target, data); + } + + ///Turns the siren on. + ///The target for this service call + ///The tone to emit. When `available_tones` property is a map, either the key or the value can be used. Must be supported by the integration. eg: fire + ///The volume. 0 is inaudible, 1 is the maximum volume. Must be supported by the integration. eg: 0.5 + ///Number of seconds the sound is played. Must be supported by the integration. eg: 15 + public void TurnOn(ServiceTarget target, string? tone = null, double? volumeLevel = null, string? duration = null) + { + _haContext.CallService("siren", "turn_on", target, new SirenTurnOnParameters { Tone = tone, VolumeLevel = volumeLevel, Duration = duration }); + } +} + +public partial record SirenTurnOnParameters +{ + ///The tone to emit. When `available_tones` property is a map, either the key or the value can be used. Must be supported by the integration. eg: fire + [JsonPropertyName("tone")] + public string? Tone { get; init; } + + ///The volume. 0 is inaudible, 1 is the maximum volume. Must be supported by the integration. eg: 0.5 + [JsonPropertyName("volume_level")] + public double? VolumeLevel { get; init; } + + ///Number of seconds the sound is played. Must be supported by the integration. eg: 15 + [JsonPropertyName("duration")] + public string? Duration { get; init; } +} + +public partial class SwitchServices +{ + private readonly IHaContext _haContext; + public SwitchServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Toggles a switch on/off. + ///The target for this service call + public void Toggle(ServiceTarget target) + { + _haContext.CallService("switch", "toggle", target); + } + + ///Turns a switch off. + ///The target for this service call + public void TurnOff(ServiceTarget target) + { + _haContext.CallService("switch", "turn_off", target); + } + + ///Turns a switch on. + ///The target for this service call + public void TurnOn(ServiceTarget target) + { + _haContext.CallService("switch", "turn_on", target); + } +} + +public partial class SystemLogServices +{ + private readonly IHaContext _haContext; + public SystemLogServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Clears all log entries. + public void Clear() + { + _haContext.CallService("system_log", "clear", null); + } + + ///Write log entry. + public void Write(SystemLogWriteParameters data) + { + _haContext.CallService("system_log", "write", null, data); + } + + ///Write log entry. + ///Message to log. eg: Something went wrong + ///Log level. + ///Logger name under which to log the message. Defaults to `system_log.external`. eg: mycomponent.myplatform + public void Write(string message, object? level = null, string? logger = null) + { + _haContext.CallService("system_log", "write", null, new SystemLogWriteParameters { Message = message, Level = level, Logger = logger }); + } +} + +public partial record SystemLogWriteParameters +{ + ///Message to log. eg: Something went wrong + [JsonPropertyName("message")] + public string? Message { get; init; } + + ///Log level. + [JsonPropertyName("level")] + public object? Level { get; init; } + + ///Logger name under which to log the message. Defaults to `system_log.external`. eg: mycomponent.myplatform + [JsonPropertyName("logger")] + public string? Logger { get; init; } +} + +public partial class TextServices +{ + private readonly IHaContext _haContext; + public TextServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Sets the value. + ///The target for this service call + public void SetValue(ServiceTarget target, TextSetValueParameters data) + { + _haContext.CallService("text", "set_value", target, data); + } + + ///Sets the value. + ///The target for this service call + ///Enter your text. eg: Hello world! + public void SetValue(ServiceTarget target, string value) + { + _haContext.CallService("text", "set_value", target, new TextSetValueParameters { Value = value }); + } +} + +public partial record TextSetValueParameters +{ + ///Enter your text. eg: Hello world! + [JsonPropertyName("value")] + public string? Value { get; init; } +} + +public partial class TimerServices +{ + private readonly IHaContext _haContext; + public TimerServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Cancels a timer. + ///The target for this service call + public void Cancel(ServiceTarget target) + { + _haContext.CallService("timer", "cancel", target); + } + + ///Changes a timer. + ///The target for this service call + public void Change(ServiceTarget target, TimerChangeParameters data) + { + _haContext.CallService("timer", "change", target, data); + } + + ///Changes a timer. + ///The target for this service call + ///Duration to add or subtract to the running timer. eg: 00:01:00, 60 or -60 + public void Change(ServiceTarget target, string duration) + { + _haContext.CallService("timer", "change", target, new TimerChangeParameters { Duration = duration }); + } + + ///Finishes a timer. + ///The target for this service call + public void Finish(ServiceTarget target) + { + _haContext.CallService("timer", "finish", target); + } + + ///Pauses a timer. + ///The target for this service call + public void Pause(ServiceTarget target) + { + _haContext.CallService("timer", "pause", target); + } + + public void Reload() + { + _haContext.CallService("timer", "reload", null); + } + + ///Starts a timer. + ///The target for this service call + public void Start(ServiceTarget target, TimerStartParameters data) + { + _haContext.CallService("timer", "start", target, data); + } + + ///Starts a timer. + ///The target for this service call + ///Duration the timer requires to finish. [optional]. eg: 00:01:00 or 60 + public void Start(ServiceTarget target, string? duration = null) + { + _haContext.CallService("timer", "start", target, new TimerStartParameters { Duration = duration }); + } +} + +public partial record TimerChangeParameters +{ + ///Duration to add or subtract to the running timer. eg: 00:01:00, 60 or -60 + [JsonPropertyName("duration")] + public string? Duration { get; init; } +} + +public partial record TimerStartParameters +{ + ///Duration the timer requires to finish. [optional]. eg: 00:01:00 or 60 + [JsonPropertyName("duration")] + public string? Duration { get; init; } +} + +public partial class TtsServices +{ + private readonly IHaContext _haContext; + public TtsServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Removes all cached text-to-speech files and purges the memory. + public void ClearCache() + { + _haContext.CallService("tts", "clear_cache", null); + } + + ///Say something using text-to-speech on a media player with google_translate. + public void GoogleTranslateSay(TtsGoogleTranslateSayParameters data) + { + _haContext.CallService("tts", "google_translate_say", null, data); + } + + ///Say something using text-to-speech on a media player with google_translate. + /// + /// eg: My name is hanna + /// + /// eg: ru + /// eg: platform specific + public void GoogleTranslateSay(string entityId, string message, bool? cache = null, string? language = null, object? options = null) + { + _haContext.CallService("tts", "google_translate_say", null, new TtsGoogleTranslateSayParameters { EntityId = entityId, Message = message, Cache = cache, Language = language, Options = options }); + } + + ///Speaks something using text-to-speech on a media player. + ///The target for this service call + public void Speak(ServiceTarget target, TtsSpeakParameters data) + { + _haContext.CallService("tts", "speak", target, data); + } + + ///Speaks something using text-to-speech on a media player. + ///The target for this service call + ///Media players to play the message. + ///The text you want to convert into speech so that you can listen to it on your device. eg: My name is hanna + ///Stores this message locally so that when the text is requested again, the output can be produced more quickly. + ///Language to use for speech generation. eg: ru + ///A dictionary containing integration-specific options. eg: platform specific + public void Speak(ServiceTarget target, string mediaPlayerEntityId, string message, bool? cache = null, string? language = null, object? options = null) + { + _haContext.CallService("tts", "speak", target, new TtsSpeakParameters { MediaPlayerEntityId = mediaPlayerEntityId, Message = message, Cache = cache, Language = language, Options = options }); + } +} + +public partial record TtsGoogleTranslateSayParameters +{ + [JsonPropertyName("entity_id")] + public string? EntityId { get; init; } + + /// eg: My name is hanna + [JsonPropertyName("message")] + public string? Message { get; init; } + + [JsonPropertyName("cache")] + public bool? Cache { get; init; } + + /// eg: ru + [JsonPropertyName("language")] + public string? Language { get; init; } + + /// eg: platform specific + [JsonPropertyName("options")] + public object? Options { get; init; } +} + +public partial record TtsSpeakParameters +{ + ///Media players to play the message. + [JsonPropertyName("media_player_entity_id")] + public string? MediaPlayerEntityId { get; init; } + + ///The text you want to convert into speech so that you can listen to it on your device. eg: My name is hanna + [JsonPropertyName("message")] + public string? Message { get; init; } + + ///Stores this message locally so that when the text is requested again, the output can be produced more quickly. + [JsonPropertyName("cache")] + public bool? Cache { get; init; } + + ///Language to use for speech generation. eg: ru + [JsonPropertyName("language")] + public string? Language { get; init; } + + ///A dictionary containing integration-specific options. eg: platform specific + [JsonPropertyName("options")] + public object? Options { get; init; } +} + +public partial class UpdateServices +{ + private readonly IHaContext _haContext; + public UpdateServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Removes the skipped version marker from an update. + ///The target for this service call + public void ClearSkipped(ServiceTarget target) + { + _haContext.CallService("update", "clear_skipped", target); + } + + ///Installs an update for this device or service. + ///The target for this service call + public void Install(ServiceTarget target, UpdateInstallParameters data) + { + _haContext.CallService("update", "install", target, data); + } + + ///Installs an update for this device or service. + ///The target for this service call + ///The version to install. If omitted, the latest version will be installed. eg: 1.0.0 + ///If supported by the integration, this creates a backup before starting the update . + public void Install(ServiceTarget target, string? version = null, bool? backup = null) + { + _haContext.CallService("update", "install", target, new UpdateInstallParameters { Version = version, Backup = backup }); + } + + ///Marks currently available update as skipped. + ///The target for this service call + public void Skip(ServiceTarget target) + { + _haContext.CallService("update", "skip", target); + } +} + +public partial record UpdateInstallParameters +{ + ///The version to install. If omitted, the latest version will be installed. eg: 1.0.0 + [JsonPropertyName("version")] + public string? Version { get; init; } + + ///If supported by the integration, this creates a backup before starting the update . + [JsonPropertyName("backup")] + public bool? Backup { get; init; } +} + +public partial class VacuumServices +{ + private readonly IHaContext _haContext; + public VacuumServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Tells the vacuum cleaner to do a spot clean-up. + ///The target for this service call + public void CleanSpot(ServiceTarget target) + { + _haContext.CallService("vacuum", "clean_spot", target); + } + + ///Locates the vacuum cleaner robot. + ///The target for this service call + public void Locate(ServiceTarget target) + { + _haContext.CallService("vacuum", "locate", target); + } + + ///Pauses the cleaning task. + ///The target for this service call + public void Pause(ServiceTarget target) + { + _haContext.CallService("vacuum", "pause", target); + } + + ///Tells the vacuum cleaner to return to its dock. + ///The target for this service call + public void ReturnToBase(ServiceTarget target) + { + _haContext.CallService("vacuum", "return_to_base", target); + } + + ///Sends a command to the vacuum cleaner. + ///The target for this service call + public void SendCommand(ServiceTarget target, VacuumSendCommandParameters data) + { + _haContext.CallService("vacuum", "send_command", target, data); + } + + ///Sends a command to the vacuum cleaner. + ///The target for this service call + ///Command to execute. The commands are integration-specific. eg: set_dnd_timer + ///Parameters for the command. The parameters are integration-specific. eg: { "key": "value" } + public void SendCommand(ServiceTarget target, string command, object? @params = null) + { + _haContext.CallService("vacuum", "send_command", target, new VacuumSendCommandParameters { Command = command, Params = @params }); + } + + ///Sets the fan speed of the vacuum cleaner. + ///The target for this service call + public void SetFanSpeed(ServiceTarget target, VacuumSetFanSpeedParameters data) + { + _haContext.CallService("vacuum", "set_fan_speed", target, data); + } + + ///Sets the fan speed of the vacuum cleaner. + ///The target for this service call + ///Fan speed. The value depends on the integration. Some integrations have speed steps, like 'medium'. Some use a percentage, between 0 and 100. eg: low + public void SetFanSpeed(ServiceTarget target, string fanSpeed) + { + _haContext.CallService("vacuum", "set_fan_speed", target, new VacuumSetFanSpeedParameters { FanSpeed = fanSpeed }); + } + + ///Starts or resumes the cleaning task. + ///The target for this service call + public void Start(ServiceTarget target) + { + _haContext.CallService("vacuum", "start", target); + } + + ///Starts, pauses, or resumes the cleaning task. + ///The target for this service call + public void StartPause(ServiceTarget target) + { + _haContext.CallService("vacuum", "start_pause", target); + } + + ///Stops the current cleaning task. + ///The target for this service call + public void Stop(ServiceTarget target) + { + _haContext.CallService("vacuum", "stop", target); + } + + public void Toggle() + { + _haContext.CallService("vacuum", "toggle", null); + } + + ///Stops the current cleaning task and returns to its dock. + ///The target for this service call + public void TurnOff(ServiceTarget target) + { + _haContext.CallService("vacuum", "turn_off", target); + } + + ///Starts a new cleaning task. + ///The target for this service call + public void TurnOn(ServiceTarget target) + { + _haContext.CallService("vacuum", "turn_on", target); + } +} + +public partial record VacuumSendCommandParameters +{ + ///Command to execute. The commands are integration-specific. eg: set_dnd_timer + [JsonPropertyName("command")] + public string? Command { get; init; } + + ///Parameters for the command. The parameters are integration-specific. eg: { "key": "value" } + [JsonPropertyName("params")] + public object? Params { get; init; } +} + +public partial record VacuumSetFanSpeedParameters +{ + ///Fan speed. The value depends on the integration. Some integrations have speed steps, like 'medium'. Some use a percentage, between 0 and 100. eg: low + [JsonPropertyName("fan_speed")] + public string? FanSpeed { get; init; } +} + +public partial class WaterHeaterServices +{ + private readonly IHaContext _haContext; + public WaterHeaterServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Turns away mode on/off. + ///The target for this service call + public void SetAwayMode(ServiceTarget target, WaterHeaterSetAwayModeParameters data) + { + _haContext.CallService("water_heater", "set_away_mode", target, data); + } + + ///Turns away mode on/off. + ///The target for this service call + ///New value of away mode. + public void SetAwayMode(ServiceTarget target, bool awayMode) + { + _haContext.CallService("water_heater", "set_away_mode", target, new WaterHeaterSetAwayModeParameters { AwayMode = awayMode }); + } + + ///Sets the operation mode. + ///The target for this service call + public void SetOperationMode(ServiceTarget target, WaterHeaterSetOperationModeParameters data) + { + _haContext.CallService("water_heater", "set_operation_mode", target, data); + } + + ///Sets the operation mode. + ///The target for this service call + ///New value of the operation mode. For a list of possible modes, refer to the integration documentation. eg: eco + public void SetOperationMode(ServiceTarget target, string operationMode) + { + _haContext.CallService("water_heater", "set_operation_mode", target, new WaterHeaterSetOperationModeParameters { OperationMode = operationMode }); + } + + ///Sets the target temperature. + ///The target for this service call + public void SetTemperature(ServiceTarget target, WaterHeaterSetTemperatureParameters data) + { + _haContext.CallService("water_heater", "set_temperature", target, data); + } + + ///Sets the target temperature. + ///The target for this service call + ///New target temperature for the water heater. + ///New value of the operation mode. For a list of possible modes, refer to the integration documentation. eg: eco + public void SetTemperature(ServiceTarget target, double temperature, string? operationMode = null) + { + _haContext.CallService("water_heater", "set_temperature", target, new WaterHeaterSetTemperatureParameters { Temperature = temperature, OperationMode = operationMode }); + } + + ///Turns water heater off. + ///The target for this service call + public void TurnOff(ServiceTarget target) + { + _haContext.CallService("water_heater", "turn_off", target); + } + + ///Turns water heater on. + ///The target for this service call + public void TurnOn(ServiceTarget target) + { + _haContext.CallService("water_heater", "turn_on", target); + } +} + +public partial record WaterHeaterSetAwayModeParameters +{ + ///New value of away mode. + [JsonPropertyName("away_mode")] + public bool? AwayMode { get; init; } +} + +public partial record WaterHeaterSetOperationModeParameters +{ + ///New value of the operation mode. For a list of possible modes, refer to the integration documentation. eg: eco + [JsonPropertyName("operation_mode")] + public string? OperationMode { get; init; } +} + +public partial record WaterHeaterSetTemperatureParameters +{ + ///New target temperature for the water heater. + [JsonPropertyName("temperature")] + public double? Temperature { get; init; } + + ///New value of the operation mode. For a list of possible modes, refer to the integration documentation. eg: eco + [JsonPropertyName("operation_mode")] + public string? OperationMode { get; init; } +} + +public partial class ZhaServices +{ + private readonly IHaContext _haContext; + public ZhaServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Clears a user code from a lock. + ///The target for this service call + public void ClearLockUserCode(ServiceTarget target, ZhaClearLockUserCodeParameters data) + { + _haContext.CallService("zha", "clear_lock_user_code", target, data); + } + + ///Clears a user code from a lock. + ///The target for this service call + ///Code slot to clear code from. eg: 1 + public void ClearLockUserCode(ServiceTarget target, string codeSlot) + { + _haContext.CallService("zha", "clear_lock_user_code", target, new ZhaClearLockUserCodeParameters { CodeSlot = codeSlot }); + } + + ///Disables a user code on a lock. + ///The target for this service call + public void DisableLockUserCode(ServiceTarget target, ZhaDisableLockUserCodeParameters data) + { + _haContext.CallService("zha", "disable_lock_user_code", target, data); + } + + ///Disables a user code on a lock. + ///The target for this service call + ///Code slot to disable. eg: 1 + public void DisableLockUserCode(ServiceTarget target, string codeSlot) + { + _haContext.CallService("zha", "disable_lock_user_code", target, new ZhaDisableLockUserCodeParameters { CodeSlot = codeSlot }); + } + + ///Enables a user code on a lock. + ///The target for this service call + public void EnableLockUserCode(ServiceTarget target, ZhaEnableLockUserCodeParameters data) + { + _haContext.CallService("zha", "enable_lock_user_code", target, data); + } + + ///Enables a user code on a lock. + ///The target for this service call + ///Code slot to enable. eg: 1 + public void EnableLockUserCode(ServiceTarget target, string codeSlot) + { + _haContext.CallService("zha", "enable_lock_user_code", target, new ZhaEnableLockUserCodeParameters { CodeSlot = codeSlot }); + } + + ///Issues a command on the specified cluster on the specified entity. + public void IssueZigbeeClusterCommand(ZhaIssueZigbeeClusterCommandParameters data) + { + _haContext.CallService("zha", "issue_zigbee_cluster_command", null, data); + } + + ///Issues a command on the specified cluster on the specified entity. + ///IEEE address for the device. eg: 00:0d:6f:00:05:7d:2d:34 + ///Endpoint ID for the cluster. + ///ZCL cluster to retrieve attributes for. + ///Type of the cluster. + ///ID of the command to execute. + ///Type of the command to execute. + ///Arguments to pass to the command. eg: [arg1, arg2, argN] + ///Parameters to pass to the command. + ///Manufacturer code. eg: 252 + public void IssueZigbeeClusterCommand(string ieee, long endpointId, long clusterId, long command, object commandType, object? clusterType = null, object? args = null, object? @params = null, string? manufacturer = null) + { + _haContext.CallService("zha", "issue_zigbee_cluster_command", null, new ZhaIssueZigbeeClusterCommandParameters { Ieee = ieee, EndpointId = endpointId, ClusterId = clusterId, ClusterType = clusterType, Command = command, CommandType = commandType, Args = args, Params = @params, Manufacturer = manufacturer }); + } + + ///Issue command on the specified cluster on the specified group. + public void IssueZigbeeGroupCommand(ZhaIssueZigbeeGroupCommandParameters data) + { + _haContext.CallService("zha", "issue_zigbee_group_command", null, data); + } + + ///Issue command on the specified cluster on the specified group. + ///Hexadecimal address of the group. eg: 546 + ///ZCL cluster to send command to. + ///Type of the cluster. + ///ID of the command to execute. + ///Arguments to pass to the command. eg: [arg1, arg2, argN] + ///Manufacturer code. eg: 252 + public void IssueZigbeeGroupCommand(string @group, long clusterId, long command, object? clusterType = null, object? args = null, string? manufacturer = null) + { + _haContext.CallService("zha", "issue_zigbee_group_command", null, new ZhaIssueZigbeeGroupCommandParameters { Group = @group, ClusterId = clusterId, ClusterType = clusterType, Command = command, Args = args, Manufacturer = manufacturer }); + } + + ///Allows nodes to join the Zigbee network. + public void Permit(ZhaPermitParameters data) + { + _haContext.CallService("zha", "permit", null, data); + } + + ///Allows nodes to join the Zigbee network. + ///Time to permit joins. + ///IEEE address of the node permitting new joins. eg: 00:0d:6f:00:05:7d:2d:34 + ///IEEE address of the joining device (must be used with the install code). eg: 00:0a:bf:00:01:10:23:35 + ///Install code of the joining device (must be used with the source_ieee). eg: 1234-5678-1234-5678-AABB-CCDD-AABB-CCDD-EEFF + ///Value of the QR install code (different between vendors). eg: Z:000D6FFFFED4163B$I:52797BF4A5084DAA8E1712B61741CA024051 + public void Permit(long? duration = null, string? ieee = null, string? sourceIeee = null, string? installCode = null, string? qrCode = null) + { + _haContext.CallService("zha", "permit", null, new ZhaPermitParameters { Duration = duration, Ieee = ieee, SourceIeee = sourceIeee, InstallCode = installCode, QrCode = qrCode }); + } + + ///Removes a node from the Zigbee network. + public void Remove(ZhaRemoveParameters data) + { + _haContext.CallService("zha", "remove", null, data); + } + + ///Removes a node from the Zigbee network. + ///IEEE address of the node to remove. eg: 00:0d:6f:00:05:7d:2d:34 + public void Remove(string ieee) + { + _haContext.CallService("zha", "remove", null, new ZhaRemoveParameters { Ieee = ieee }); + } + + ///Sets a user code on a lock. + ///The target for this service call + public void SetLockUserCode(ServiceTarget target, ZhaSetLockUserCodeParameters data) + { + _haContext.CallService("zha", "set_lock_user_code", target, data); + } + + ///Sets a user code on a lock. + ///The target for this service call + ///Code slot to set the code in. eg: 1 + ///Code to set. eg: 1234 + public void SetLockUserCode(ServiceTarget target, string codeSlot, string userCode) + { + _haContext.CallService("zha", "set_lock_user_code", target, new ZhaSetLockUserCodeParameters { CodeSlot = codeSlot, UserCode = userCode }); + } + + ///Sets an attribute value for the specified cluster on the specified entity. + public void SetZigbeeClusterAttribute(ZhaSetZigbeeClusterAttributeParameters data) + { + _haContext.CallService("zha", "set_zigbee_cluster_attribute", null, data); + } + + ///Sets an attribute value for the specified cluster on the specified entity. + ///IEEE address for the device. eg: 00:0d:6f:00:05:7d:2d:34 + ///Endpoint ID for the cluster. + ///ZCL cluster to retrieve attributes for. + ///Type of the cluster. + ///ID of the attribute to set. eg: 0 + ///Value to write to the attribute. eg: 1 + ///Manufacturer code. eg: 252 + public void SetZigbeeClusterAttribute(string ieee, long endpointId, long clusterId, long attribute, string value, object? clusterType = null, string? manufacturer = null) + { + _haContext.CallService("zha", "set_zigbee_cluster_attribute", null, new ZhaSetZigbeeClusterAttributeParameters { Ieee = ieee, EndpointId = endpointId, ClusterId = clusterId, ClusterType = clusterType, Attribute = attribute, Value = value, Manufacturer = manufacturer }); + } + + ///This service uses the WD capabilities to emit a quick audible/visible pulse called a "squawk". The squawk command has no effect if the WD is currently active (warning in progress). + public void WarningDeviceSquawk(ZhaWarningDeviceSquawkParameters data) + { + _haContext.CallService("zha", "warning_device_squawk", null, data); + } + + ///This service uses the WD capabilities to emit a quick audible/visible pulse called a "squawk". The squawk command has no effect if the WD is currently active (warning in progress). + ///IEEE address for the device. eg: 00:0d:6f:00:05:7d:2d:34 + ///The Squawk Mode field is used as a 4-bit enumeration, and can have one of the values shown in Table 8-24 of the ZCL spec - Squawk Mode Field. The exact operation of each mode (how the WD “squawks”) is implementation specific. + ///The strobe field is used as a Boolean, and determines if the visual indication is also required in addition to the audible squawk, as shown in Table 8-25 of the ZCL spec - Strobe Bit. + ///The squawk level field is used as a 2-bit enumeration, and determines the intensity of audible squawk sound as shown in Table 8-26 of the ZCL spec - Squawk Level Field Values. + public void WarningDeviceSquawk(string ieee, long? mode = null, long? strobe = null, long? level = null) + { + _haContext.CallService("zha", "warning_device_squawk", null, new ZhaWarningDeviceSquawkParameters { Ieee = ieee, Mode = mode, Strobe = strobe, Level = level }); + } + + ///This service starts the operation of the warning device. The warning device alerts the surrounding area by audible (siren) and visual (strobe) signals. + public void WarningDeviceWarn(ZhaWarningDeviceWarnParameters data) + { + _haContext.CallService("zha", "warning_device_warn", null, data); + } + + ///This service starts the operation of the warning device. The warning device alerts the surrounding area by audible (siren) and visual (strobe) signals. + ///IEEE address for the device. eg: 00:0d:6f:00:05:7d:2d:34 + ///The Warning Mode field is used as a 4-bit enumeration, can have one of the values 0-6 defined below in table 8-20 of the ZCL spec. The exact behavior of the warning device in each mode is according to the relevant security standards. + ///The Strobe field is used as a 2-bit enumeration, and determines if the visual indication is required in addition to the audible siren, as indicated in Table 8-21 of the ZCL spec. "0" means no strobe, "1" means strobe. If the strobe field is “1” and the Warning Mode is “0” (“Stop”), then only the strobe is activated. + ///The Siren Level field is used as a 2-bit enumeration, and indicates the intensity of audible squawk sound as shown in Table 8-22 of the ZCL spec. + ///Requested duration of warning, in seconds (16 bit). If both Strobe and Warning Mode are "0" this field is ignored. + ///Indicates the length of the flash cycle. This allows you to vary the flash duration for different alarm types (e.g., fire, police, burglar). The valid range is 0-100 in increments of 10. All other values must be rounded to the nearest valid value. Strobe calculates a duty cycle over a duration of one second. The ON state must precede the OFF state. For example, if the Strobe Duty Cycle field specifies “40,”, then the strobe flashes ON for 4/10ths of a second and then turns OFF for 6/10ths of a second. + ///Indicates the intensity of the strobe as shown in Table 8-23 of the ZCL spec. This attribute is designed to vary the output of the strobe (i.e., brightness) and not its frequency, which is detailed in section 8.4.2.3.1.6 of the ZCL spec. + public void WarningDeviceWarn(string ieee, long? mode = null, long? strobe = null, long? level = null, long? duration = null, long? dutyCycle = null, long? intensity = null) + { + _haContext.CallService("zha", "warning_device_warn", null, new ZhaWarningDeviceWarnParameters { Ieee = ieee, Mode = mode, Strobe = strobe, Level = level, Duration = duration, DutyCycle = dutyCycle, Intensity = intensity }); + } +} + +public partial record ZhaClearLockUserCodeParameters +{ + ///Code slot to clear code from. eg: 1 + [JsonPropertyName("code_slot")] + public string? CodeSlot { get; init; } +} + +public partial record ZhaDisableLockUserCodeParameters +{ + ///Code slot to disable. eg: 1 + [JsonPropertyName("code_slot")] + public string? CodeSlot { get; init; } +} + +public partial record ZhaEnableLockUserCodeParameters +{ + ///Code slot to enable. eg: 1 + [JsonPropertyName("code_slot")] + public string? CodeSlot { get; init; } +} + +public partial record ZhaIssueZigbeeClusterCommandParameters +{ + ///IEEE address for the device. eg: 00:0d:6f:00:05:7d:2d:34 + [JsonPropertyName("ieee")] + public string? Ieee { get; init; } + + ///Endpoint ID for the cluster. + [JsonPropertyName("endpoint_id")] + public long? EndpointId { get; init; } + + ///ZCL cluster to retrieve attributes for. + [JsonPropertyName("cluster_id")] + public long? ClusterId { get; init; } + + ///Type of the cluster. + [JsonPropertyName("cluster_type")] + public object? ClusterType { get; init; } + + ///ID of the command to execute. + [JsonPropertyName("command")] + public long? Command { get; init; } + + ///Type of the command to execute. + [JsonPropertyName("command_type")] + public object? CommandType { get; init; } + + ///Arguments to pass to the command. eg: [arg1, arg2, argN] + [JsonPropertyName("args")] + public object? Args { get; init; } + + ///Parameters to pass to the command. + [JsonPropertyName("params")] + public object? Params { get; init; } + + ///Manufacturer code. eg: 252 + [JsonPropertyName("manufacturer")] + public string? Manufacturer { get; init; } +} + +public partial record ZhaIssueZigbeeGroupCommandParameters +{ + ///Hexadecimal address of the group. eg: 546 + [JsonPropertyName("group")] + public string? Group { get; init; } + + ///ZCL cluster to send command to. + [JsonPropertyName("cluster_id")] + public long? ClusterId { get; init; } + + ///Type of the cluster. + [JsonPropertyName("cluster_type")] + public object? ClusterType { get; init; } + + ///ID of the command to execute. + [JsonPropertyName("command")] + public long? Command { get; init; } + + ///Arguments to pass to the command. eg: [arg1, arg2, argN] + [JsonPropertyName("args")] + public object? Args { get; init; } + + ///Manufacturer code. eg: 252 + [JsonPropertyName("manufacturer")] + public string? Manufacturer { get; init; } +} + +public partial record ZhaPermitParameters +{ + ///Time to permit joins. + [JsonPropertyName("duration")] + public long? Duration { get; init; } + + ///IEEE address of the node permitting new joins. eg: 00:0d:6f:00:05:7d:2d:34 + [JsonPropertyName("ieee")] + public string? Ieee { get; init; } + + ///IEEE address of the joining device (must be used with the install code). eg: 00:0a:bf:00:01:10:23:35 + [JsonPropertyName("source_ieee")] + public string? SourceIeee { get; init; } + + ///Install code of the joining device (must be used with the source_ieee). eg: 1234-5678-1234-5678-AABB-CCDD-AABB-CCDD-EEFF + [JsonPropertyName("install_code")] + public string? InstallCode { get; init; } + + ///Value of the QR install code (different between vendors). eg: Z:000D6FFFFED4163B$I:52797BF4A5084DAA8E1712B61741CA024051 + [JsonPropertyName("qr_code")] + public string? QrCode { get; init; } +} + +public partial record ZhaRemoveParameters +{ + ///IEEE address of the node to remove. eg: 00:0d:6f:00:05:7d:2d:34 + [JsonPropertyName("ieee")] + public string? Ieee { get; init; } +} + +public partial record ZhaSetLockUserCodeParameters +{ + ///Code slot to set the code in. eg: 1 + [JsonPropertyName("code_slot")] + public string? CodeSlot { get; init; } + + ///Code to set. eg: 1234 + [JsonPropertyName("user_code")] + public string? UserCode { get; init; } +} + +public partial record ZhaSetZigbeeClusterAttributeParameters +{ + ///IEEE address for the device. eg: 00:0d:6f:00:05:7d:2d:34 + [JsonPropertyName("ieee")] + public string? Ieee { get; init; } + + ///Endpoint ID for the cluster. + [JsonPropertyName("endpoint_id")] + public long? EndpointId { get; init; } + + ///ZCL cluster to retrieve attributes for. + [JsonPropertyName("cluster_id")] + public long? ClusterId { get; init; } + + ///Type of the cluster. + [JsonPropertyName("cluster_type")] + public object? ClusterType { get; init; } + + ///ID of the attribute to set. eg: 0 + [JsonPropertyName("attribute")] + public long? Attribute { get; init; } + + ///Value to write to the attribute. eg: 1 + [JsonPropertyName("value")] + public string? Value { get; init; } + + ///Manufacturer code. eg: 252 + [JsonPropertyName("manufacturer")] + public string? Manufacturer { get; init; } +} + +public partial record ZhaWarningDeviceSquawkParameters +{ + ///IEEE address for the device. eg: 00:0d:6f:00:05:7d:2d:34 + [JsonPropertyName("ieee")] + public string? Ieee { get; init; } + + ///The Squawk Mode field is used as a 4-bit enumeration, and can have one of the values shown in Table 8-24 of the ZCL spec - Squawk Mode Field. The exact operation of each mode (how the WD “squawks”) is implementation specific. + [JsonPropertyName("mode")] + public long? Mode { get; init; } + + ///The strobe field is used as a Boolean, and determines if the visual indication is also required in addition to the audible squawk, as shown in Table 8-25 of the ZCL spec - Strobe Bit. + [JsonPropertyName("strobe")] + public long? Strobe { get; init; } + + ///The squawk level field is used as a 2-bit enumeration, and determines the intensity of audible squawk sound as shown in Table 8-26 of the ZCL spec - Squawk Level Field Values. + [JsonPropertyName("level")] + public long? Level { get; init; } +} + +public partial record ZhaWarningDeviceWarnParameters +{ + ///IEEE address for the device. eg: 00:0d:6f:00:05:7d:2d:34 + [JsonPropertyName("ieee")] + public string? Ieee { get; init; } + + ///The Warning Mode field is used as a 4-bit enumeration, can have one of the values 0-6 defined below in table 8-20 of the ZCL spec. The exact behavior of the warning device in each mode is according to the relevant security standards. + [JsonPropertyName("mode")] + public long? Mode { get; init; } + + ///The Strobe field is used as a 2-bit enumeration, and determines if the visual indication is required in addition to the audible siren, as indicated in Table 8-21 of the ZCL spec. "0" means no strobe, "1" means strobe. If the strobe field is “1” and the Warning Mode is “0” (“Stop”), then only the strobe is activated. + [JsonPropertyName("strobe")] + public long? Strobe { get; init; } + + ///The Siren Level field is used as a 2-bit enumeration, and indicates the intensity of audible squawk sound as shown in Table 8-22 of the ZCL spec. + [JsonPropertyName("level")] + public long? Level { get; init; } + + ///Requested duration of warning, in seconds (16 bit). If both Strobe and Warning Mode are "0" this field is ignored. + [JsonPropertyName("duration")] + public long? Duration { get; init; } + + ///Indicates the length of the flash cycle. This allows you to vary the flash duration for different alarm types (e.g., fire, police, burglar). The valid range is 0-100 in increments of 10. All other values must be rounded to the nearest valid value. Strobe calculates a duty cycle over a duration of one second. The ON state must precede the OFF state. For example, if the Strobe Duty Cycle field specifies “40,”, then the strobe flashes ON for 4/10ths of a second and then turns OFF for 6/10ths of a second. + [JsonPropertyName("duty_cycle")] + public long? DutyCycle { get; init; } + + ///Indicates the intensity of the strobe as shown in Table 8-23 of the ZCL spec. This attribute is designed to vary the output of the strobe (i.e., brightness) and not its frequency, which is detailed in section 8.4.2.3.1.6 of the ZCL spec. + [JsonPropertyName("intensity")] + public long? Intensity { get; init; } +} + +public partial class ZoneServices +{ + private readonly IHaContext _haContext; + public ZoneServices(IHaContext haContext) + { + _haContext = haContext; + } + + ///Reloads zones from the YAML-configuration. + public void Reload() + { + _haContext.CallService("zone", "reload", null); + } +} + +public static class ButtonEntityExtensionMethods +{ + ///Press the button entity. + public static void Press(this ButtonEntity target) + { + target.CallService("press"); + } + + ///Press the button entity. + public static void Press(this IEnumerable target) + { + target.CallService("press"); + } +} + +public static class InputBooleanEntityExtensionMethods +{ + ///Toggles the helper on/off. + public static void Toggle(this InputBooleanEntity target) + { + target.CallService("toggle"); + } + + ///Toggles the helper on/off. + public static void Toggle(this IEnumerable target) + { + target.CallService("toggle"); + } + + ///Turns off the helper. + public static void TurnOff(this InputBooleanEntity target) + { + target.CallService("turn_off"); + } + + ///Turns off the helper. + public static void TurnOff(this IEnumerable target) + { + target.CallService("turn_off"); + } + + ///Turns on the helper. + public static void TurnOn(this InputBooleanEntity target) + { + target.CallService("turn_on"); + } + + ///Turns on the helper. + public static void TurnOn(this IEnumerable target) + { + target.CallService("turn_on"); + } +} + +public static class InputButtonEntityExtensionMethods +{ + ///Mimics the physical button press on the device. + public static void Press(this InputButtonEntity target) + { + target.CallService("press"); + } + + ///Mimics the physical button press on the device. + public static void Press(this IEnumerable target) + { + target.CallService("press"); + } +} + +public static class InputDatetimeEntityExtensionMethods +{ + ///Sets the date and/or time. + public static void SetDatetime(this InputDatetimeEntity target, InputDatetimeSetDatetimeParameters data) + { + target.CallService("set_datetime", data); + } + + ///Sets the date and/or time. + public static void SetDatetime(this IEnumerable target, InputDatetimeSetDatetimeParameters data) + { + target.CallService("set_datetime", data); + } + + ///Sets the date and/or time. + ///The InputDatetimeEntity to call this service for + ///The target date. eg: "2019-04-20" + ///The target time. eg: "05:04:20" + ///The target date & time. eg: "2019-04-20 05:04:20" + ///The target date & time, expressed by a UNIX timestamp. + public static void SetDatetime(this InputDatetimeEntity target, string? date = null, DateTime? time = null, string? datetime = null, long? timestamp = null) + { + target.CallService("set_datetime", new InputDatetimeSetDatetimeParameters { Date = date, Time = time, Datetime = datetime, Timestamp = timestamp }); + } + + ///Sets the date and/or time. + ///The IEnumerable<InputDatetimeEntity> to call this service for + ///The target date. eg: "2019-04-20" + ///The target time. eg: "05:04:20" + ///The target date & time. eg: "2019-04-20 05:04:20" + ///The target date & time, expressed by a UNIX timestamp. + public static void SetDatetime(this IEnumerable target, string? date = null, DateTime? time = null, string? datetime = null, long? timestamp = null) + { + target.CallService("set_datetime", new InputDatetimeSetDatetimeParameters { Date = date, Time = time, Datetime = datetime, Timestamp = timestamp }); + } +} + +public static class InputNumberEntityExtensionMethods +{ + ///Decrements the current value by 1 step. + public static void Decrement(this InputNumberEntity target) + { + target.CallService("decrement"); + } + + ///Decrements the current value by 1 step. + public static void Decrement(this IEnumerable target) + { + target.CallService("decrement"); + } + + ///Increments the value by 1 step. + public static void Increment(this InputNumberEntity target) + { + target.CallService("increment"); + } + + ///Increments the value by 1 step. + public static void Increment(this IEnumerable target) + { + target.CallService("increment"); + } + + ///Sets the value. + public static void SetValue(this InputNumberEntity target, InputNumberSetValueParameters data) + { + target.CallService("set_value", data); + } + + ///Sets the value. + public static void SetValue(this IEnumerable target, InputNumberSetValueParameters data) + { + target.CallService("set_value", data); + } + + ///Sets the value. + ///The InputNumberEntity to call this service for + ///The target value. + public static void SetValue(this InputNumberEntity target, double value) + { + target.CallService("set_value", new InputNumberSetValueParameters { Value = value }); + } + + ///Sets the value. + ///The IEnumerable<InputNumberEntity> to call this service for + ///The target value. + public static void SetValue(this IEnumerable target, double value) + { + target.CallService("set_value", new InputNumberSetValueParameters { Value = value }); + } +} + +public static class LightEntityExtensionMethods +{ + ///Toggles one or more lights, from on to off, or, off to on, based on their current state. + public static void Toggle(this LightEntity target, LightToggleParameters data) + { + target.CallService("toggle", data); + } + + ///Toggles one or more lights, from on to off, or, off to on, based on their current state. + public static void Toggle(this IEnumerable target, LightToggleParameters data) + { + target.CallService("toggle", data); + } + + ///Toggles one or more lights, from on to off, or, off to on, based on their current state. + ///The LightEntity to call this service for + ///Duration it takes to get to next state. + ///The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue. eg: [255, 100, 100] + ///A human-readable color name. + ///Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100. eg: [300, 70] + ///Color in XY-format. A list of two decimal numbers between 0 and 1. eg: [0.52, 0.43] + ///Color temperature in mireds. + ///Color temperature in Kelvin. + ///Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness. + ///Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness. + ///Set the light to white mode. + ///Name of a light profile to use. eg: relax + ///Tell light to flash, can be either value short or long. + ///Light effect. + public static void Toggle(this LightEntity target, long? transition = null, object? rgbColor = null, object? colorName = null, object? hsColor = null, object? xyColor = null, object? colorTemp = null, long? kelvin = null, long? brightness = null, long? brightnessPct = null, object? white = null, string? profile = null, object? flash = null, string? effect = null) + { + target.CallService("toggle", new LightToggleParameters { Transition = transition, RgbColor = rgbColor, ColorName = colorName, HsColor = hsColor, XyColor = xyColor, ColorTemp = colorTemp, Kelvin = kelvin, Brightness = brightness, BrightnessPct = brightnessPct, White = white, Profile = profile, Flash = flash, Effect = effect }); + } + + ///Toggles one or more lights, from on to off, or, off to on, based on their current state. + ///The IEnumerable<LightEntity> to call this service for + ///Duration it takes to get to next state. + ///The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue. eg: [255, 100, 100] + ///A human-readable color name. + ///Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100. eg: [300, 70] + ///Color in XY-format. A list of two decimal numbers between 0 and 1. eg: [0.52, 0.43] + ///Color temperature in mireds. + ///Color temperature in Kelvin. + ///Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness. + ///Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness. + ///Set the light to white mode. + ///Name of a light profile to use. eg: relax + ///Tell light to flash, can be either value short or long. + ///Light effect. + public static void Toggle(this IEnumerable target, long? transition = null, object? rgbColor = null, object? colorName = null, object? hsColor = null, object? xyColor = null, object? colorTemp = null, long? kelvin = null, long? brightness = null, long? brightnessPct = null, object? white = null, string? profile = null, object? flash = null, string? effect = null) + { + target.CallService("toggle", new LightToggleParameters { Transition = transition, RgbColor = rgbColor, ColorName = colorName, HsColor = hsColor, XyColor = xyColor, ColorTemp = colorTemp, Kelvin = kelvin, Brightness = brightness, BrightnessPct = brightnessPct, White = white, Profile = profile, Flash = flash, Effect = effect }); + } + + ///Turn off one or more lights. + public static void TurnOff(this LightEntity target, LightTurnOffParameters data) + { + target.CallService("turn_off", data); + } + + ///Turn off one or more lights. + public static void TurnOff(this IEnumerable target, LightTurnOffParameters data) + { + target.CallService("turn_off", data); + } + + ///Turn off one or more lights. + ///The LightEntity to call this service for + ///Duration it takes to get to next state. + ///Tell light to flash, can be either value short or long. + public static void TurnOff(this LightEntity target, long? transition = null, object? flash = null) + { + target.CallService("turn_off", new LightTurnOffParameters { Transition = transition, Flash = flash }); + } + + ///Turn off one or more lights. + ///The IEnumerable<LightEntity> to call this service for + ///Duration it takes to get to next state. + ///Tell light to flash, can be either value short or long. + public static void TurnOff(this IEnumerable target, long? transition = null, object? flash = null) + { + target.CallService("turn_off", new LightTurnOffParameters { Transition = transition, Flash = flash }); + } + + ///Turn on one or more lights and adjust properties of the light, even when they are turned on already. + public static void TurnOn(this LightEntity target, LightTurnOnParameters data) + { + target.CallService("turn_on", data); + } + + ///Turn on one or more lights and adjust properties of the light, even when they are turned on already. + public static void TurnOn(this IEnumerable target, LightTurnOnParameters data) + { + target.CallService("turn_on", data); + } + + ///Turn on one or more lights and adjust properties of the light, even when they are turned on already. + ///The LightEntity to call this service for + ///Duration it takes to get to next state. + ///The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue. + ///The color in RGBW format. A list of four integers between 0 and 255 representing the values of red, green, blue, and white. eg: [255, 100, 100, 50] + ///The color in RGBWW format. A list of five integers between 0 and 255 representing the values of red, green, blue, cold white, and warm white. eg: [255, 100, 100, 50, 70] + ///A human-readable color name. + ///Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100. eg: [300, 70] + ///Color in XY-format. A list of two decimal numbers between 0 and 1. eg: [0.52, 0.43] + ///Color temperature in mireds. + ///Color temperature in Kelvin. + ///Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness. + ///Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness. + ///Change brightness by an amount. + ///Change brightness by a percentage. + ///Set the light to white mode. + ///Name of a light profile to use. eg: relax + ///Tell light to flash, can be either value short or long. + ///Light effect. + public static void TurnOn(this LightEntity target, long? transition = null, object? rgbColor = null, object? rgbwColor = null, object? rgbwwColor = null, object? colorName = null, object? hsColor = null, object? xyColor = null, object? colorTemp = null, long? kelvin = null, long? brightness = null, long? brightnessPct = null, long? brightnessStep = null, long? brightnessStepPct = null, object? white = null, string? profile = null, object? flash = null, string? effect = null) + { + target.CallService("turn_on", new LightTurnOnParameters { Transition = transition, RgbColor = rgbColor, RgbwColor = rgbwColor, RgbwwColor = rgbwwColor, ColorName = colorName, HsColor = hsColor, XyColor = xyColor, ColorTemp = colorTemp, Kelvin = kelvin, Brightness = brightness, BrightnessPct = brightnessPct, BrightnessStep = brightnessStep, BrightnessStepPct = brightnessStepPct, White = white, Profile = profile, Flash = flash, Effect = effect }); + } + + ///Turn on one or more lights and adjust properties of the light, even when they are turned on already. + ///The IEnumerable<LightEntity> to call this service for + ///Duration it takes to get to next state. + ///The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue. + ///The color in RGBW format. A list of four integers between 0 and 255 representing the values of red, green, blue, and white. eg: [255, 100, 100, 50] + ///The color in RGBWW format. A list of five integers between 0 and 255 representing the values of red, green, blue, cold white, and warm white. eg: [255, 100, 100, 50, 70] + ///A human-readable color name. + ///Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100. eg: [300, 70] + ///Color in XY-format. A list of two decimal numbers between 0 and 1. eg: [0.52, 0.43] + ///Color temperature in mireds. + ///Color temperature in Kelvin. + ///Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness. + ///Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness. + ///Change brightness by an amount. + ///Change brightness by a percentage. + ///Set the light to white mode. + ///Name of a light profile to use. eg: relax + ///Tell light to flash, can be either value short or long. + ///Light effect. + public static void TurnOn(this IEnumerable target, long? transition = null, object? rgbColor = null, object? rgbwColor = null, object? rgbwwColor = null, object? colorName = null, object? hsColor = null, object? xyColor = null, object? colorTemp = null, long? kelvin = null, long? brightness = null, long? brightnessPct = null, long? brightnessStep = null, long? brightnessStepPct = null, object? white = null, string? profile = null, object? flash = null, string? effect = null) + { + target.CallService("turn_on", new LightTurnOnParameters { Transition = transition, RgbColor = rgbColor, RgbwColor = rgbwColor, RgbwwColor = rgbwwColor, ColorName = colorName, HsColor = hsColor, XyColor = xyColor, ColorTemp = colorTemp, Kelvin = kelvin, Brightness = brightness, BrightnessPct = brightnessPct, BrightnessStep = brightnessStep, BrightnessStepPct = brightnessStepPct, White = white, Profile = profile, Flash = flash, Effect = effect }); + } +} + +public static class MediaPlayerEntityExtensionMethods +{ + ///Clears the playlist. + public static void ClearPlaylist(this MediaPlayerEntity target) + { + target.CallService("clear_playlist"); + } + + ///Clears the playlist. + public static void ClearPlaylist(this IEnumerable target) + { + target.CallService("clear_playlist"); + } + + ///Groups media players together for synchronous playback. Only works on supported multiroom audio systems. + public static void Join(this MediaPlayerEntity target, MediaPlayerJoinParameters data) + { + target.CallService("join", data); + } + + ///Groups media players together for synchronous playback. Only works on supported multiroom audio systems. + public static void Join(this IEnumerable target, MediaPlayerJoinParameters data) + { + target.CallService("join", data); + } + + ///Groups media players together for synchronous playback. Only works on supported multiroom audio systems. + ///The MediaPlayerEntity to call this service for + ///The players which will be synced with the playback specified in `target`. eg: - media_player.multiroom_player2 - media_player.multiroom_player3 + public static void Join(this MediaPlayerEntity target, string groupMembers) + { + target.CallService("join", new MediaPlayerJoinParameters { GroupMembers = groupMembers }); + } + + ///Groups media players together for synchronous playback. Only works on supported multiroom audio systems. + ///The IEnumerable<MediaPlayerEntity> to call this service for + ///The players which will be synced with the playback specified in `target`. eg: - media_player.multiroom_player2 - media_player.multiroom_player3 + public static void Join(this IEnumerable target, string groupMembers) + { + target.CallService("join", new MediaPlayerJoinParameters { GroupMembers = groupMembers }); + } + + ///Selects the next track. + public static void MediaNextTrack(this MediaPlayerEntity target) + { + target.CallService("media_next_track"); + } + + ///Selects the next track. + public static void MediaNextTrack(this IEnumerable target) + { + target.CallService("media_next_track"); + } + + ///Pauses. + public static void MediaPause(this MediaPlayerEntity target) + { + target.CallService("media_pause"); + } + + ///Pauses. + public static void MediaPause(this IEnumerable target) + { + target.CallService("media_pause"); + } + + ///Starts playing. + public static void MediaPlay(this MediaPlayerEntity target) + { + target.CallService("media_play"); + } + + ///Starts playing. + public static void MediaPlay(this IEnumerable target) + { + target.CallService("media_play"); + } + + ///Toggles play/pause. + public static void MediaPlayPause(this MediaPlayerEntity target) + { + target.CallService("media_play_pause"); + } + + ///Toggles play/pause. + public static void MediaPlayPause(this IEnumerable target) + { + target.CallService("media_play_pause"); + } + + ///Selects the previous track. + public static void MediaPreviousTrack(this MediaPlayerEntity target) + { + target.CallService("media_previous_track"); + } + + ///Selects the previous track. + public static void MediaPreviousTrack(this IEnumerable target) + { + target.CallService("media_previous_track"); + } + + ///Allows you to go to a different part of the media that is currently playing. + public static void MediaSeek(this MediaPlayerEntity target, MediaPlayerMediaSeekParameters data) + { + target.CallService("media_seek", data); + } + + ///Allows you to go to a different part of the media that is currently playing. + public static void MediaSeek(this IEnumerable target, MediaPlayerMediaSeekParameters data) + { + target.CallService("media_seek", data); + } + + ///Allows you to go to a different part of the media that is currently playing. + ///The MediaPlayerEntity to call this service for + ///Target position in the currently playing media. The format is platform dependent. + public static void MediaSeek(this MediaPlayerEntity target, double seekPosition) + { + target.CallService("media_seek", new MediaPlayerMediaSeekParameters { SeekPosition = seekPosition }); + } + + ///Allows you to go to a different part of the media that is currently playing. + ///The IEnumerable<MediaPlayerEntity> to call this service for + ///Target position in the currently playing media. The format is platform dependent. + public static void MediaSeek(this IEnumerable target, double seekPosition) + { + target.CallService("media_seek", new MediaPlayerMediaSeekParameters { SeekPosition = seekPosition }); + } + + ///Stops playing. + public static void MediaStop(this MediaPlayerEntity target) + { + target.CallService("media_stop"); + } + + ///Stops playing. + public static void MediaStop(this IEnumerable target) + { + target.CallService("media_stop"); + } + + ///Starts playing specified media. + public static void PlayMedia(this MediaPlayerEntity target, MediaPlayerPlayMediaParameters data) + { + target.CallService("play_media", data); + } + + ///Starts playing specified media. + public static void PlayMedia(this IEnumerable target, MediaPlayerPlayMediaParameters data) + { + target.CallService("play_media", data); + } + + ///Starts playing specified media. + ///The MediaPlayerEntity to call this service for + ///The ID of the content to play. Platform dependent. eg: https://home-assistant.io/images/cast/splash.png + ///The type of the content to play. Such as image, music, tv show, video, episode, channel, or playlist. eg: music + ///If the content should be played now or be added to the queue. + ///If the media should be played as an announcement. eg: true + public static void PlayMedia(this MediaPlayerEntity target, string mediaContentId, string mediaContentType, object? enqueue = null, bool? announce = null) + { + target.CallService("play_media", new MediaPlayerPlayMediaParameters { MediaContentId = mediaContentId, MediaContentType = mediaContentType, Enqueue = enqueue, Announce = announce }); + } + + ///Starts playing specified media. + ///The IEnumerable<MediaPlayerEntity> to call this service for + ///The ID of the content to play. Platform dependent. eg: https://home-assistant.io/images/cast/splash.png + ///The type of the content to play. Such as image, music, tv show, video, episode, channel, or playlist. eg: music + ///If the content should be played now or be added to the queue. + ///If the media should be played as an announcement. eg: true + public static void PlayMedia(this IEnumerable target, string mediaContentId, string mediaContentType, object? enqueue = null, bool? announce = null) + { + target.CallService("play_media", new MediaPlayerPlayMediaParameters { MediaContentId = mediaContentId, MediaContentType = mediaContentType, Enqueue = enqueue, Announce = announce }); + } + + ///Playback mode that plays the media in a loop. + public static void RepeatSet(this MediaPlayerEntity target, MediaPlayerRepeatSetParameters data) + { + target.CallService("repeat_set", data); + } + + ///Playback mode that plays the media in a loop. + public static void RepeatSet(this IEnumerable target, MediaPlayerRepeatSetParameters data) + { + target.CallService("repeat_set", data); + } + + ///Playback mode that plays the media in a loop. + ///The MediaPlayerEntity to call this service for + ///Repeat mode to set. + public static void RepeatSet(this MediaPlayerEntity target, object repeat) + { + target.CallService("repeat_set", new MediaPlayerRepeatSetParameters { Repeat = repeat }); + } + + ///Playback mode that plays the media in a loop. + ///The IEnumerable<MediaPlayerEntity> to call this service for + ///Repeat mode to set. + public static void RepeatSet(this IEnumerable target, object repeat) + { + target.CallService("repeat_set", new MediaPlayerRepeatSetParameters { Repeat = repeat }); + } + + ///Selects a specific sound mode. + public static void SelectSoundMode(this MediaPlayerEntity target, MediaPlayerSelectSoundModeParameters data) + { + target.CallService("select_sound_mode", data); + } + + ///Selects a specific sound mode. + public static void SelectSoundMode(this IEnumerable target, MediaPlayerSelectSoundModeParameters data) + { + target.CallService("select_sound_mode", data); + } + + ///Selects a specific sound mode. + ///The MediaPlayerEntity to call this service for + ///Name of the sound mode to switch to. eg: Music + public static void SelectSoundMode(this MediaPlayerEntity target, string? soundMode = null) + { + target.CallService("select_sound_mode", new MediaPlayerSelectSoundModeParameters { SoundMode = soundMode }); + } + + ///Selects a specific sound mode. + ///The IEnumerable<MediaPlayerEntity> to call this service for + ///Name of the sound mode to switch to. eg: Music + public static void SelectSoundMode(this IEnumerable target, string? soundMode = null) + { + target.CallService("select_sound_mode", new MediaPlayerSelectSoundModeParameters { SoundMode = soundMode }); + } + + ///Sends the media player the command to change input source. + public static void SelectSource(this MediaPlayerEntity target, MediaPlayerSelectSourceParameters data) + { + target.CallService("select_source", data); + } + + ///Sends the media player the command to change input source. + public static void SelectSource(this IEnumerable target, MediaPlayerSelectSourceParameters data) + { + target.CallService("select_source", data); + } + + ///Sends the media player the command to change input source. + ///The MediaPlayerEntity to call this service for + ///Name of the source to switch to. Platform dependent. eg: video1 + public static void SelectSource(this MediaPlayerEntity target, string source) + { + target.CallService("select_source", new MediaPlayerSelectSourceParameters { Source = source }); + } + + ///Sends the media player the command to change input source. + ///The IEnumerable<MediaPlayerEntity> to call this service for + ///Name of the source to switch to. Platform dependent. eg: video1 + public static void SelectSource(this IEnumerable target, string source) + { + target.CallService("select_source", new MediaPlayerSelectSourceParameters { Source = source }); + } + + ///Playback mode that selects the media in randomized order. + public static void ShuffleSet(this MediaPlayerEntity target, MediaPlayerShuffleSetParameters data) + { + target.CallService("shuffle_set", data); + } + + ///Playback mode that selects the media in randomized order. + public static void ShuffleSet(this IEnumerable target, MediaPlayerShuffleSetParameters data) + { + target.CallService("shuffle_set", data); + } + + ///Playback mode that selects the media in randomized order. + ///The MediaPlayerEntity to call this service for + ///Whether or not shuffle mode is enabled. + public static void ShuffleSet(this MediaPlayerEntity target, bool shuffle) + { + target.CallService("shuffle_set", new MediaPlayerShuffleSetParameters { Shuffle = shuffle }); + } + + ///Playback mode that selects the media in randomized order. + ///The IEnumerable<MediaPlayerEntity> to call this service for + ///Whether or not shuffle mode is enabled. + public static void ShuffleSet(this IEnumerable target, bool shuffle) + { + target.CallService("shuffle_set", new MediaPlayerShuffleSetParameters { Shuffle = shuffle }); + } + + ///Toggles a media player on/off. + public static void Toggle(this MediaPlayerEntity target) + { + target.CallService("toggle"); + } + + ///Toggles a media player on/off. + public static void Toggle(this IEnumerable target) + { + target.CallService("toggle"); + } + + ///Turns off the power of the media player. + public static void TurnOff(this MediaPlayerEntity target) + { + target.CallService("turn_off"); + } + + ///Turns off the power of the media player. + public static void TurnOff(this IEnumerable target) + { + target.CallService("turn_off"); + } + + ///Turns on the power of the media player. + public static void TurnOn(this MediaPlayerEntity target) + { + target.CallService("turn_on"); + } + + ///Turns on the power of the media player. + public static void TurnOn(this IEnumerable target) + { + target.CallService("turn_on"); + } + + ///Removes the player from a group. Only works on platforms which support player groups. + public static void Unjoin(this MediaPlayerEntity target) + { + target.CallService("unjoin"); + } + + ///Removes the player from a group. Only works on platforms which support player groups. + public static void Unjoin(this IEnumerable target) + { + target.CallService("unjoin"); + } + + ///Turns down the volume. + public static void VolumeDown(this MediaPlayerEntity target) + { + target.CallService("volume_down"); + } + + ///Turns down the volume. + public static void VolumeDown(this IEnumerable target) + { + target.CallService("volume_down"); + } + + ///Mutes or unmutes the media player. + public static void VolumeMute(this MediaPlayerEntity target, MediaPlayerVolumeMuteParameters data) + { + target.CallService("volume_mute", data); + } + + ///Mutes or unmutes the media player. + public static void VolumeMute(this IEnumerable target, MediaPlayerVolumeMuteParameters data) + { + target.CallService("volume_mute", data); + } + + ///Mutes or unmutes the media player. + ///The MediaPlayerEntity to call this service for + ///Defines whether or not it is muted. + public static void VolumeMute(this MediaPlayerEntity target, bool isVolumeMuted) + { + target.CallService("volume_mute", new MediaPlayerVolumeMuteParameters { IsVolumeMuted = isVolumeMuted }); + } + + ///Mutes or unmutes the media player. + ///The IEnumerable<MediaPlayerEntity> to call this service for + ///Defines whether or not it is muted. + public static void VolumeMute(this IEnumerable target, bool isVolumeMuted) + { + target.CallService("volume_mute", new MediaPlayerVolumeMuteParameters { IsVolumeMuted = isVolumeMuted }); + } + + ///Sets the volume level. + public static void VolumeSet(this MediaPlayerEntity target, MediaPlayerVolumeSetParameters data) + { + target.CallService("volume_set", data); + } + + ///Sets the volume level. + public static void VolumeSet(this IEnumerable target, MediaPlayerVolumeSetParameters data) + { + target.CallService("volume_set", data); + } + + ///Sets the volume level. + ///The MediaPlayerEntity to call this service for + ///The volume. 0 is inaudible, 1 is the maximum volume. + public static void VolumeSet(this MediaPlayerEntity target, double volumeLevel) + { + target.CallService("volume_set", new MediaPlayerVolumeSetParameters { VolumeLevel = volumeLevel }); + } + + ///Sets the volume level. + ///The IEnumerable<MediaPlayerEntity> to call this service for + ///The volume. 0 is inaudible, 1 is the maximum volume. + public static void VolumeSet(this IEnumerable target, double volumeLevel) + { + target.CallService("volume_set", new MediaPlayerVolumeSetParameters { VolumeLevel = volumeLevel }); + } + + ///Turns up the volume. + public static void VolumeUp(this MediaPlayerEntity target) + { + target.CallService("volume_up"); + } + + ///Turns up the volume. + public static void VolumeUp(this IEnumerable target) + { + target.CallService("volume_up"); + } +} + +public static class SelectEntityExtensionMethods +{ + ///Selects the first option. + public static void SelectFirst(this SelectEntity target) + { + target.CallService("select_first"); + } + + ///Selects the first option. + public static void SelectFirst(this IEnumerable target) + { + target.CallService("select_first"); + } + + ///Selects the last option. + public static void SelectLast(this SelectEntity target) + { + target.CallService("select_last"); + } + + ///Selects the last option. + public static void SelectLast(this IEnumerable target) + { + target.CallService("select_last"); + } + + ///Selects the next option. + public static void SelectNext(this SelectEntity target, SelectSelectNextParameters data) + { + target.CallService("select_next", data); + } + + ///Selects the next option. + public static void SelectNext(this IEnumerable target, SelectSelectNextParameters data) + { + target.CallService("select_next", data); + } + + ///Selects the next option. + ///The SelectEntity to call this service for + ///If the option should cycle from the last to the first. + public static void SelectNext(this SelectEntity target, bool? cycle = null) + { + target.CallService("select_next", new SelectSelectNextParameters { Cycle = cycle }); + } + + ///Selects the next option. + ///The IEnumerable<SelectEntity> to call this service for + ///If the option should cycle from the last to the first. + public static void SelectNext(this IEnumerable target, bool? cycle = null) + { + target.CallService("select_next", new SelectSelectNextParameters { Cycle = cycle }); + } + + ///Selects an option. + public static void SelectOption(this SelectEntity target, SelectSelectOptionParameters data) + { + target.CallService("select_option", data); + } + + ///Selects an option. + public static void SelectOption(this IEnumerable target, SelectSelectOptionParameters data) + { + target.CallService("select_option", data); + } + + ///Selects an option. + ///The SelectEntity to call this service for + ///Option to be selected. eg: "Item A" + public static void SelectOption(this SelectEntity target, string option) + { + target.CallService("select_option", new SelectSelectOptionParameters { Option = option }); + } + + ///Selects an option. + ///The IEnumerable<SelectEntity> to call this service for + ///Option to be selected. eg: "Item A" + public static void SelectOption(this IEnumerable target, string option) + { + target.CallService("select_option", new SelectSelectOptionParameters { Option = option }); + } + + ///Selects the previous option. + public static void SelectPrevious(this SelectEntity target, SelectSelectPreviousParameters data) + { + target.CallService("select_previous", data); + } + + ///Selects the previous option. + public static void SelectPrevious(this IEnumerable target, SelectSelectPreviousParameters data) + { + target.CallService("select_previous", data); + } + + ///Selects the previous option. + ///The SelectEntity to call this service for + ///If the option should cycle from the first to the last. + public static void SelectPrevious(this SelectEntity target, bool? cycle = null) + { + target.CallService("select_previous", new SelectSelectPreviousParameters { Cycle = cycle }); + } + + ///Selects the previous option. + ///The IEnumerable<SelectEntity> to call this service for + ///If the option should cycle from the first to the last. + public static void SelectPrevious(this IEnumerable target, bool? cycle = null) + { + target.CallService("select_previous", new SelectSelectPreviousParameters { Cycle = cycle }); + } +} + +public static class SwitchEntityExtensionMethods +{ + ///Toggles a switch on/off. + public static void Toggle(this SwitchEntity target) + { + target.CallService("toggle"); + } + + ///Toggles a switch on/off. + public static void Toggle(this IEnumerable target) + { + target.CallService("toggle"); + } + + ///Turns a switch off. + public static void TurnOff(this SwitchEntity target) + { + target.CallService("turn_off"); + } + + ///Turns a switch off. + public static void TurnOff(this IEnumerable target) + { + target.CallService("turn_off"); + } + + ///Turns a switch on. + public static void TurnOn(this SwitchEntity target) + { + target.CallService("turn_on"); + } + + ///Turns a switch on. + public static void TurnOn(this IEnumerable target) + { + target.CallService("turn_on"); + } +} + +public static class UpdateEntityExtensionMethods +{ + ///Removes the skipped version marker from an update. + public static void ClearSkipped(this UpdateEntity target) + { + target.CallService("clear_skipped"); + } + + ///Removes the skipped version marker from an update. + public static void ClearSkipped(this IEnumerable target) + { + target.CallService("clear_skipped"); + } + + ///Installs an update for this device or service. + public static void Install(this UpdateEntity target, UpdateInstallParameters data) + { + target.CallService("install", data); + } + + ///Installs an update for this device or service. + public static void Install(this IEnumerable target, UpdateInstallParameters data) + { + target.CallService("install", data); + } + + ///Installs an update for this device or service. + ///The UpdateEntity to call this service for + ///The version to install. If omitted, the latest version will be installed. eg: 1.0.0 + ///If supported by the integration, this creates a backup before starting the update . + public static void Install(this UpdateEntity target, string? version = null, bool? backup = null) + { + target.CallService("install", new UpdateInstallParameters { Version = version, Backup = backup }); + } + + ///Installs an update for this device or service. + ///The IEnumerable<UpdateEntity> to call this service for + ///The version to install. If omitted, the latest version will be installed. eg: 1.0.0 + ///If supported by the integration, this creates a backup before starting the update . + public static void Install(this IEnumerable target, string? version = null, bool? backup = null) + { + target.CallService("install", new UpdateInstallParameters { Version = version, Backup = backup }); + } + + ///Marks currently available update as skipped. + public static void Skip(this UpdateEntity target) + { + target.CallService("skip"); + } + + ///Marks currently available update as skipped. + public static void Skip(this IEnumerable target) + { + target.CallService("skip"); + } +} \ No newline at end of file diff --git a/NetDaemonApps/NetDaemonApps/Modules/AreaCollection.cs b/NetDaemonApps/NetDaemonApps/Modules/AreaCollection.cs new file mode 100644 index 0000000..2493143 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/Modules/AreaCollection.cs @@ -0,0 +1,40 @@ +using NetDaemonApps.AreaControl.Areas; +using NetDaemonInterface; +using System.Collections.Generic; + +namespace NetDaemonApps.Modules +{ + public class AreaCollection : IAreaCollection + { + private readonly Dictionary collection = new(); + + public AreaCollection(IServiceProvider serviceProvider) + { + var haContext = DiHelper.GetHaContext(serviceProvider); + var scheduler = DiHelper.GetScheduler(serviceProvider); + + collection.Add(AreaControlEnum.Bath, new Bath(haContext, scheduler)); + collection.Add(AreaControlEnum.Bedroom, new Bedroom(haContext, scheduler)); + collection.Add(AreaControlEnum.Corridor1stFloor, new Corridor1stFloor(haContext, scheduler)); + collection.Add(AreaControlEnum.Corridor2ndFloor, new Corridor2ndFloor(haContext, scheduler)); + collection.Add(AreaControlEnum.CorridorGroundFloor, new Corridor1stFloor(haContext, scheduler)); + collection.Add(AreaControlEnum.EntranceArea, new EntranceArea(haContext, scheduler)); + collection.Add(AreaControlEnum.KidsRoom, new KidsRoom(haContext, scheduler)); + collection.Add(AreaControlEnum.Kitchen, new Kitchen(haContext, scheduler)); + collection.Add(AreaControlEnum.LivingRoom, new LivingRoom(haContext, scheduler)); + collection.Add(AreaControlEnum.Office, new Office(haContext, scheduler)); + collection.Add(AreaControlEnum.Studio, new Studio(haContext, scheduler)); + collection.Add(AreaControlEnum.TechnicalRoom, new TechnicalRoom(haContext, scheduler)); + collection.Add(AreaControlEnum.TmpArea, new TmpArea(haContext, scheduler)); + } + + public IAreaControl GetArea(AreaControlEnum area) + { + if (!collection.ContainsKey(area)) + { + throw new ArgumentException("unknown area"); + } + return collection[area]; + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/Modules/DeviceCollection.cs b/NetDaemonApps/NetDaemonApps/Modules/DeviceCollection.cs new file mode 100644 index 0000000..f018e92 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/Modules/DeviceCollection.cs @@ -0,0 +1,30 @@ +using NetDaemonApps.DeviceControl.Devices; +using NetDaemonInterface; +using NetDaemonInterface; +using System.Collections.Generic; + +namespace NetDaemonApps.Modules +{ + public class DeviceCollection : IDeviceCollection + { + private readonly Dictionary collection = new(); + + public DeviceCollection(IServiceProvider serviceProvider) + { + var haContext = DiHelper.GetHaContext(serviceProvider); + var scheduler = DiHelper.GetScheduler(serviceProvider); + + collection.Add(DeviceControlEnum.deengph001, new Deengph001(haContext, scheduler)); + collection.Add(DeviceControlEnum.deengph002, new Deengph002(haContext, scheduler)); + } + + public IDeviceControl GetDevice(DeviceControlEnum device) + { + if (!collection.ContainsKey(device)) + { + throw new ArgumentException("unknown device"); + } + return collection[device]; + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/Modules/DiHelpers.cs b/NetDaemonApps/NetDaemonApps/Modules/DiHelpers.cs new file mode 100644 index 0000000..9452ff6 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/Modules/DiHelpers.cs @@ -0,0 +1,29 @@ +using Microsoft.Extensions.DependencyInjection; + +namespace NetDaemonApps.Modules +{ + public static class DiHelper + { + public static IHaContext GetHaContext(IServiceProvider serviceProvider) + { + var scope = serviceProvider.CreateScope(); + var haContext = scope.ServiceProvider.GetService(); + if (haContext == null) + { + throw new Exception("Unable to get correct HaContext"); + } + return haContext; + } + + public static IScheduler GetScheduler(IServiceProvider serviceProvider) + { + var scope = serviceProvider.CreateScope(); + var scheduler = scope.ServiceProvider.GetService(); + if (scheduler == null) + { + throw new Exception("Unable to get correct HaContext"); + } + return scheduler; + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/NetDaemonApps.csproj b/NetDaemonApps/NetDaemonApps/NetDaemonApps.csproj new file mode 100644 index 0000000..e84031f --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/NetDaemonApps.csproj @@ -0,0 +1,55 @@ + + + + Exe + net7.0 + 11.0 + de-DE + enable + NetDaemonApps + + + + + + + + + Always + Never + + + Always + + + Always + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NetDaemonApps/NetDaemonApps/NetDaemonApps.sln b/NetDaemonApps/NetDaemonApps/NetDaemonApps.sln new file mode 100644 index 0000000..be0ef04 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/NetDaemonApps.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33815.320 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetDaemonApps", "NetDaemonApps.csproj", "{FD197591-A2E0-4C6E-A726-1E9C3427E97B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetDaemonInterface", "..\NetDeamonInterface\NetDaemonInterface.csproj", "{000DEEE4-DA5C-4B38-A0F5-050934EAAD66}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FD197591-A2E0-4C6E-A726-1E9C3427E97B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FD197591-A2E0-4C6E-A726-1E9C3427E97B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD197591-A2E0-4C6E-A726-1E9C3427E97B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FD197591-A2E0-4C6E-A726-1E9C3427E97B}.Release|Any CPU.Build.0 = Release|Any CPU + {000DEEE4-DA5C-4B38-A0F5-050934EAAD66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {000DEEE4-DA5C-4B38-A0F5-050934EAAD66}.Debug|Any CPU.Build.0 = Debug|Any CPU + {000DEEE4-DA5C-4B38-A0F5-050934EAAD66}.Release|Any CPU.ActiveCfg = Release|Any CPU + {000DEEE4-DA5C-4B38-A0F5-050934EAAD66}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {458B659E-D336-4D2A-B66C-04D33AD098BC} + EndGlobalSection +EndGlobal diff --git a/NetDaemonApps/NetDaemonApps/NetDaemonCodegen/EntityMetaData.json b/NetDaemonApps/NetDaemonApps/NetDaemonCodegen/EntityMetaData.json new file mode 100644 index 0000000..5864d59 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/NetDaemonCodegen/EntityMetaData.json @@ -0,0 +1,2201 @@ +{ + "domains": [ + { + "domain": "binary_sensor", + "entities": [ + { + "id": "binary_sensor.deengfb001_wan_status", + "friendlyName": "FB00-AM-LM WAN-Status", + "cSharpName": "Deengfb001WanStatus" + }, + { + "id": "binary_sensor.deengph001_is_charging", + "friendlyName": "deengph001 Is charging", + "cSharpName": "Deengph001IsCharging" + }, + { + "id": "binary_sensor.deengph002_is_charging", + "friendlyName": "deengph002 Is Charging", + "cSharpName": "Deengph002IsCharging" + }, + { + "id": "binary_sensor.fb00_am_lm_verbinden", + "friendlyName": "FB00-AM-LM Verbinden", + "cSharpName": "Fb00AmLmVerbinden" + }, + { + "id": "binary_sensor.fb00_am_lm_verbindung", + "friendlyName": "FB00-AM-LM Verbindung", + "cSharpName": "Fb00AmLmVerbindung" + }, + { + "id": "binary_sensor.rpi_power_status", + "friendlyName": "RPi Power status", + "cSharpName": "RpiPowerStatus" + }, + { + "id": "binary_sensor.workday_sensor", + "friendlyName": "Workday Sensor", + "cSharpName": "WorkdaySensor" + } + ], + "attributes": [ + { + "jsonName": "device_class", + "cSharpName": "DeviceClass", + "clrType": "System.String" + }, + { + "jsonName": "icon", + "cSharpName": "Icon", + "clrType": "System.String" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + }, + { + "jsonName": "workdays", + "cSharpName": "Workdays", + "clrType": "System.Collections.Generic.IReadOnlyList\u00601[System.String]" + }, + { + "jsonName": "excludes", + "cSharpName": "Excludes", + "clrType": "System.Collections.Generic.IReadOnlyList\u00601[System.String]" + }, + { + "jsonName": "days_offset", + "cSharpName": "DaysOffset", + "clrType": "System.Double" + } + ] + }, + { + "domain": "button", + "entities": [ + { + "id": "button.deengzb002dg_st_mx_identify", + "friendlyName": "deengzb002dg-st-mx Identify", + "cSharpName": "Deengzb002dgStMxIdentify" + }, + { + "id": "button.fb00_am_lm_aufraumen", + "friendlyName": "FB00-AM-LM Aufr\u00E4umen", + "cSharpName": "Fb00AmLmAufraumen" + }, + { + "id": "button.fb00_am_lm_firmware_update", + "friendlyName": "FB00-AM-LM Firmware Update", + "cSharpName": "Fb00AmLmFirmwareUpdate" + }, + { + "id": "button.fb00_am_lm_neu_starten", + "friendlyName": "FB00-AM-LM Neu starten", + "cSharpName": "Fb00AmLmNeuStarten" + }, + { + "id": "button.fb00_am_lm_neu_verbinden", + "friendlyName": "FB00-AM-LM Neu verbinden", + "cSharpName": "Fb00AmLmNeuVerbinden" + }, + { + "id": "button.synchronize_devices", + "friendlyName": "Google Assistant Ger\u00E4te synchronisieren", + "cSharpName": "SynchronizeDevices" + }, + { + "id": "button.tz3000_kdi2o9m6_ts011f_identify", + "friendlyName": "_TZ3000_kdi2o9m6 TS011F Identify", + "cSharpName": "Tz3000Kdi2o9m6Ts011fIdentify" + } + ], + "attributes": [ + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + }, + { + "jsonName": "device_class", + "cSharpName": "DeviceClass", + "clrType": "System.String" + }, + { + "jsonName": "icon", + "cSharpName": "Icon", + "clrType": "System.String" + } + ] + }, + { + "domain": "device_tracker", + "entities": [ + { + "id": "device_tracker.accm80317e877768cd21_577b", + "friendlyName": null, + "cSharpName": "Accm80317e877768cd21577b" + }, + { + "id": "device_tracker.android_217ffb982e982cf9", + "friendlyName": "deengph002", + "cSharpName": "Android217ffb982e982cf9" + }, + { + "id": "device_tracker.android_792e9092fe50e529", + "friendlyName": "android-792e9092fe50e529", + "cSharpName": "Android792e9092fe50e529" + }, + { + "id": "device_tracker.care_6ee7", + "friendlyName": null, + "cSharpName": "Care6ee7" + }, + { + "id": "device_tracker.deengap001dns", + "friendlyName": "deengap001", + "cSharpName": "Deengap001dns" + }, + { + "id": "device_tracker.deengha001", + "friendlyName": "deengha001", + "cSharpName": "Deengha001" + }, + { + "id": "device_tracker.deengna001", + "friendlyName": "deengna001", + "cSharpName": "Deengna001" + }, + { + "id": "device_tracker.deengna002", + "friendlyName": "deengna002", + "cSharpName": "Deengna002" + }, + { + "id": "device_tracker.deengna002_2", + "friendlyName": "deengna002", + "cSharpName": "Deengna0022" + }, + { + "id": "device_tracker.deengna003", + "friendlyName": "deengna003", + "cSharpName": "Deengna003" + }, + { + "id": "device_tracker.deengna003_2", + "friendlyName": "deengna003", + "cSharpName": "Deengna0032" + }, + { + "id": "device_tracker.deengna004", + "friendlyName": "deengna004", + "cSharpName": "Deengna004" + }, + { + "id": "device_tracker.deengna004_2", + "friendlyName": "deengna004", + "cSharpName": "Deengna0042" + }, + { + "id": "device_tracker.deengnb001stm", + "friendlyName": "deengnb001", + "cSharpName": "Deengnb001stm" + }, + { + "id": "device_tracker.deengnb001stm_2", + "friendlyName": "deengnb001", + "cSharpName": "Deengnb001stm2" + }, + { + "id": "device_tracker.deengnb003lm", + "friendlyName": "deengnb003lm", + "cSharpName": "Deengnb003lm" + }, + { + "id": "device_tracker.deengns001", + "friendlyName": "deengns001", + "cSharpName": "Deengns001" + }, + { + "id": "device_tracker.deengns002", + "friendlyName": "deengns002", + "cSharpName": "Deengns002" + }, + { + "id": "device_tracker.deengpc001", + "friendlyName": "deengpc001", + "cSharpName": "Deengpc001" + }, + { + "id": "device_tracker.deengpc001_2", + "friendlyName": "deengpc001", + "cSharpName": "Deengpc0012" + }, + { + "id": "device_tracker.deengpc002", + "friendlyName": "deengpc002", + "cSharpName": "Deengpc002" + }, + { + "id": "device_tracker.deengph001", + "friendlyName": "deengph001", + "cSharpName": "Deengph001" + }, + { + "id": "device_tracker.deengph002", + "friendlyName": "deengph002", + "cSharpName": "Deengph002" + }, + { + "id": "device_tracker.deengpr001", + "friendlyName": "deengpr001", + "cSharpName": "Deengpr001" + }, + { + "id": "device_tracker.deengrs001amln", + "friendlyName": "deengir002", + "cSharpName": "Deengrs001amln" + }, + { + "id": "device_tracker.deengsd001", + "friendlyName": "deengsd001", + "cSharpName": "Deengsd001" + }, + { + "id": "device_tracker.deengsr002stm", + "friendlyName": "deengir001", + "cSharpName": "Deengsr002stm" + }, + { + "id": "device_tracker.deengst001amlm", + "friendlyName": "deengst001amlm", + "cSharpName": "Deengst001amlm" + }, + { + "id": "device_tracker.deengst002", + "friendlyName": "deengtv001", + "cSharpName": "Deengst002" + }, + { + "id": "device_tracker.deengws001", + "friendlyName": "deengws001", + "cSharpName": "Deengws001" + }, + { + "id": "device_tracker.dp_2_0_tovjt195134_2ee4", + "friendlyName": null, + "cSharpName": "Dp20Tovjt1951342ee4" + }, + { + "id": "device_tracker.dp_2_0_tovjx225777_016a", + "friendlyName": null, + "cSharpName": "Dp20Tovjx225777016a" + }, + { + "id": "device_tracker.dp_2_0_tovjx377096_25cd", + "friendlyName": null, + "cSharpName": "Dp20Tovjx37709625cd" + }, + { + "id": "device_tracker.dp_2_0_tovjx503147_ab20", + "friendlyName": null, + "cSharpName": "Dp20Tovjx503147Ab20" + }, + { + "id": "device_tracker.dp_2_1_togjy024416_4639", + "friendlyName": null, + "cSharpName": "Dp21Togjy0244164639" + }, + { + "id": "device_tracker.dp_2_1_togkx010618_675a", + "friendlyName": null, + "cSharpName": "Dp21Togkx010618675a" + }, + { + "id": "device_tracker.dp_2_1_togkx189047_cd97", + "friendlyName": null, + "cSharpName": "Dp21Togkx189047Cd97" + }, + { + "id": "device_tracker.dp_2_1_togkx197117_382c", + "friendlyName": null, + "cSharpName": "Dp21Togkx197117382c" + }, + { + "id": "device_tracker.dp_2_1_togky119454_c3a5", + "friendlyName": null, + "cSharpName": "Dp21Togky119454C3a5" + }, + { + "id": "device_tracker.dp_2_1_toglx117325_528e", + "friendlyName": null, + "cSharpName": "Dp21Toglx117325528e" + }, + { + "id": "device_tracker.dp_2_1_togly034829_b86e", + "friendlyName": null, + "cSharpName": "Dp21Togly034829B86e" + }, + { + "id": "device_tracker.dp_2_1_tognx012049_e283", + "friendlyName": null, + "cSharpName": "Dp21Tognx012049E283" + }, + { + "id": "device_tracker.dp_2_1_tormx105463_a20b", + "friendlyName": null, + "cSharpName": "Dp21Tormx105463A20b" + }, + { + "id": "device_tracker.drivedot_2919_235f", + "friendlyName": null, + "cSharpName": "Drivedot2919235f" + }, + { + "id": "device_tracker.drivedot_3372_ccf3", + "friendlyName": null, + "cSharpName": "Drivedot3372Ccf3" + }, + { + "id": "device_tracker.drivedot_4319_c4fb", + "friendlyName": null, + "cSharpName": "Drivedot4319C4fb" + }, + { + "id": "device_tracker.drivedot_6574_d1ef", + "friendlyName": null, + "cSharpName": "Drivedot6574D1ef" + }, + { + "id": "device_tracker.drivedot_9703_afa8", + "friendlyName": null, + "cSharpName": "Drivedot9703Afa8" + }, + { + "id": "device_tracker.ooono_3e7d", + "friendlyName": null, + "cSharpName": "Ooono3e7d" + }, + { + "id": "device_tracker.ooono_80b1", + "friendlyName": null, + "cSharpName": "Ooono80b1" + }, + { + "id": "device_tracker.pc_265e_beff_fe1e_20f7", + "friendlyName": "deengns002", + "cSharpName": "Pc265eBeffFe1e20f7" + }, + { + "id": "device_tracker.redmi_note_9_pro", + "friendlyName": "deengph001", + "cSharpName": "RedmiNote9Pro" + }, + { + "id": "device_tracker.wsbc004011516t_9fdc", + "friendlyName": null, + "cSharpName": "Wsbc004011516t9fdc" + } + ], + "attributes": [ + { + "jsonName": "source_type", + "cSharpName": "SourceType", + "clrType": "System.String" + }, + { + "jsonName": "latitude", + "cSharpName": "Latitude", + "clrType": "System.Double" + }, + { + "jsonName": "longitude", + "cSharpName": "Longitude", + "clrType": "System.Double" + }, + { + "jsonName": "gps_accuracy", + "cSharpName": "GpsAccuracy", + "clrType": "System.Double" + }, + { + "jsonName": "altitude", + "cSharpName": "Altitude", + "clrType": "System.Double" + }, + { + "jsonName": "course", + "cSharpName": "Course", + "clrType": "System.Double" + }, + { + "jsonName": "speed", + "cSharpName": "Speed", + "clrType": "System.Double" + }, + { + "jsonName": "vertical_accuracy", + "cSharpName": "VerticalAccuracy", + "clrType": "System.Double" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + }, + { + "jsonName": "ip", + "cSharpName": "Ip", + "clrType": "System.String" + }, + { + "jsonName": "mac", + "cSharpName": "Mac", + "clrType": "System.String" + }, + { + "jsonName": "host_name", + "cSharpName": "HostName", + "clrType": "System.String" + }, + { + "jsonName": "last_time_reachable", + "cSharpName": "LastTimeReachable", + "clrType": "System.String" + }, + { + "jsonName": "icon", + "cSharpName": "Icon", + "clrType": "System.String" + }, + { + "jsonName": "connected_to", + "cSharpName": "ConnectedTo", + "clrType": "System.String" + }, + { + "jsonName": "connection_type", + "cSharpName": "ConnectionType", + "clrType": "System.String" + }, + { + "jsonName": "ssid", + "cSharpName": "Ssid", + "clrType": "System.String" + }, + { + "jsonName": "restored", + "cSharpName": "Restored", + "clrType": "System.Boolean" + }, + { + "jsonName": "supported_features", + "cSharpName": "SupportedFeatures", + "clrType": "System.Double" + }, + { + "jsonName": "uuid", + "cSharpName": "Uuid", + "clrType": "System.String" + }, + { + "jsonName": "major", + "cSharpName": "Major", + "clrType": "System.Double" + }, + { + "jsonName": "minor", + "cSharpName": "Minor", + "clrType": "System.Double" + }, + { + "jsonName": "source", + "cSharpName": "Source", + "clrType": "System.String" + } + ] + }, + { + "domain": "input_boolean", + "entities": [ + { + "id": "input_boolean.dev_netdaemon_net_daemon_apps_apps_call_service_event_handler_app", + "friendlyName": "dev_netdaemon_net_daemon_apps_apps_call_service_event_handler_app", + "cSharpName": "DevNetdaemonNetDaemonAppsAppsCallServiceEventHandlerApp" + }, + { + "id": "input_boolean.dev_netdaemon_net_daemon_apps_apps_persistance_handler_app", + "friendlyName": "dev_netdaemon_net_daemon_apps_apps_persistance_handler_app", + "cSharpName": "DevNetdaemonNetDaemonAppsAppsPersistanceHandlerApp" + }, + { + "id": "input_boolean.dev_netdaemon_net_daemon_apps_apps_scheduler", + "friendlyName": "dev_netdaemon_net_daemon_apps_apps_scheduler", + "cSharpName": "DevNetdaemonNetDaemonAppsAppsScheduler" + }, + { + "id": "input_boolean.netdaemon_net_daemon_apps_apps_call_service_event_handler_app", + "friendlyName": "netdaemon_net_daemon_apps_apps_call_service_event_handler_app", + "cSharpName": "NetdaemonNetDaemonAppsAppsCallServiceEventHandlerApp" + }, + { + "id": "input_boolean.netdaemon_net_daemon_apps_apps_deconz_event_handler_app", + "friendlyName": "netdaemon_net_daemon_apps_apps_deconz_event_handler_app", + "cSharpName": "NetdaemonNetDaemonAppsAppsDeconzEventHandlerApp" + }, + { + "id": "input_boolean.netdaemon_net_daemon_apps_apps_notify_handler_app", + "friendlyName": "netdaemon_net_daemon_apps_apps_notify_handler_app", + "cSharpName": "NetdaemonNetDaemonAppsAppsNotifyHandlerApp" + }, + { + "id": "input_boolean.netdaemon_net_daemon_apps_apps_persistance_handler_app", + "friendlyName": "netdaemon_net_daemon_apps_apps_persistance_handler_app", + "cSharpName": "NetdaemonNetDaemonAppsAppsPersistanceHandlerApp" + } + ], + "attributes": [ + { + "jsonName": "editable", + "cSharpName": "Editable", + "clrType": "System.Boolean" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + } + ] + }, + { + "domain": "light", + "entities": [ + { + "id": "light.deengzb002dg_st_mx_light", + "friendlyName": "deengzb002dg-st-mx Light", + "cSharpName": "Deengzb002dgStMxLight" + }, + { + "id": "light.deengzb002dg_st_mx_light_2", + "friendlyName": "deengzb002dg-st-mx Light", + "cSharpName": "Deengzb002dgStMxLight2" + }, + { + "id": "light.deengzb002dg_st_mx_light_3", + "friendlyName": "deengzb002dg-st-mx Light", + "cSharpName": "Deengzb002dgStMxLight3" + }, + { + "id": "light.deengzb002dg_st_mx_light_4", + "friendlyName": "deengzb002dg-st-mx Light", + "cSharpName": "Deengzb002dgStMxLight4" + }, + { + "id": "light.deengzb002dg_st_mx_light_5", + "friendlyName": "deengzb002dg-st-mx Light", + "cSharpName": "Deengzb002dgStMxLight5" + } + ], + "attributes": [ + { + "jsonName": "supported_color_modes", + "cSharpName": "SupportedColorModes", + "clrType": "System.Collections.Generic.IReadOnlyList\u00601[System.String]" + }, + { + "jsonName": "off_with_transition", + "cSharpName": "OffWithTransition", + "clrType": "System.Boolean" + }, + { + "jsonName": "off_brightness", + "cSharpName": "OffBrightness", + "clrType": "System.Object" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + }, + { + "jsonName": "supported_features", + "cSharpName": "SupportedFeatures", + "clrType": "System.Double" + }, + { + "jsonName": "color_mode", + "cSharpName": "ColorMode", + "clrType": "System.String" + } + ] + }, + { + "domain": "media_player", + "entities": [ + { + "id": "media_player.deengir001", + "friendlyName": "deengir001", + "cSharpName": "Deengir001" + }, + { + "id": "media_player.deengir001_2", + "friendlyName": "deengir001", + "cSharpName": "Deengir0012" + }, + { + "id": "media_player.deengir002", + "friendlyName": "deengir002", + "cSharpName": "Deengir002" + }, + { + "id": "media_player.deengir002_2", + "friendlyName": "deengir002", + "cSharpName": "Deengir0022" + }, + { + "id": "media_player.deengsd001", + "friendlyName": "deengsd001", + "cSharpName": "Deengsd001" + }, + { + "id": "media_player.vlc_telnet", + "friendlyName": "VLC-TELNET", + "cSharpName": "VlcTelnet" + } + ], + "attributes": [ + { + "jsonName": "volume_level", + "cSharpName": "VolumeLevel", + "clrType": "System.Double" + }, + { + "jsonName": "media_content_type", + "cSharpName": "MediaContentType", + "clrType": "System.String" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + }, + { + "jsonName": "supported_features", + "cSharpName": "SupportedFeatures", + "clrType": "System.Double" + }, + { + "jsonName": "device_class", + "cSharpName": "DeviceClass", + "clrType": "System.String" + }, + { + "jsonName": "source_list", + "cSharpName": "SourceList", + "clrType": "System.Collections.Generic.IReadOnlyList\u00601[System.String]" + }, + { + "jsonName": "sound_mode_list", + "cSharpName": "SoundModeList", + "clrType": "System.Collections.Generic.IReadOnlyList\u00601[System.String]" + }, + { + "jsonName": "is_volume_muted", + "cSharpName": "IsVolumeMuted", + "clrType": "System.Boolean" + }, + { + "jsonName": "media_content_id", + "cSharpName": "MediaContentId", + "clrType": "System.String" + }, + { + "jsonName": "media_duration", + "cSharpName": "MediaDuration", + "clrType": "System.Double" + }, + { + "jsonName": "media_position", + "cSharpName": "MediaPosition", + "clrType": "System.Double" + }, + { + "jsonName": "media_position_updated_at", + "cSharpName": "MediaPositionUpdatedAt", + "clrType": "System.String" + }, + { + "jsonName": "media_track", + "cSharpName": "MediaTrack", + "clrType": "System.Double" + }, + { + "jsonName": "shuffle", + "cSharpName": "Shuffle", + "clrType": "System.Boolean" + }, + { + "jsonName": "repeat", + "cSharpName": "Repeat", + "clrType": "System.String" + } + ] + }, + { + "domain": "person", + "entities": [ + { + "id": "person.admin", + "friendlyName": "admin", + "cSharpName": "Admin" + }, + { + "id": "person.mqtt_user", + "friendlyName": "mqtt-user", + "cSharpName": "MqttUser" + }, + { + "id": "person.stephan_maier", + "friendlyName": "Stephan Maier", + "cSharpName": "StephanMaier" + } + ], + "attributes": [ + { + "jsonName": "editable", + "cSharpName": "Editable", + "clrType": "System.Boolean" + }, + { + "jsonName": "id", + "cSharpName": "Id", + "clrType": "System.String" + }, + { + "jsonName": "latitude", + "cSharpName": "Latitude", + "clrType": "System.Double" + }, + { + "jsonName": "longitude", + "cSharpName": "Longitude", + "clrType": "System.Double" + }, + { + "jsonName": "gps_accuracy", + "cSharpName": "GpsAccuracy", + "clrType": "System.Double" + }, + { + "jsonName": "source", + "cSharpName": "Source", + "clrType": "System.String" + }, + { + "jsonName": "user_id", + "cSharpName": "UserId", + "clrType": "System.String" + }, + { + "jsonName": "device_trackers", + "cSharpName": "DeviceTrackers", + "clrType": "System.Collections.Generic.IReadOnlyList\u00601[System.String]" + }, + { + "jsonName": "entity_picture", + "cSharpName": "EntityPicture", + "clrType": "System.String" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + } + ] + }, + { + "domain": "select", + "entities": [ + { + "id": "select.deengzb002dg_st_mx_start_up_behavior", + "friendlyName": "deengzb002dg-st-mx Start-up behavior", + "cSharpName": "Deengzb002dgStMxStartUpBehavior" + }, + { + "id": "select.deengzb002dg_st_mx_start_up_behavior_2", + "friendlyName": "deengzb002dg-st-mx Start-up behavior", + "cSharpName": "Deengzb002dgStMxStartUpBehavior2" + }, + { + "id": "select.deengzb002dg_st_mx_start_up_behavior_3", + "friendlyName": "deengzb002dg-st-mx Start-up behavior", + "cSharpName": "Deengzb002dgStMxStartUpBehavior3" + }, + { + "id": "select.deengzb002dg_st_mx_start_up_behavior_4", + "friendlyName": "deengzb002dg-st-mx Start-up behavior", + "cSharpName": "Deengzb002dgStMxStartUpBehavior4" + }, + { + "id": "select.deengzb002dg_st_mx_start_up_behavior_5", + "friendlyName": "deengzb002dg-st-mx Start-up behavior", + "cSharpName": "Deengzb002dgStMxStartUpBehavior5" + }, + { + "id": "select.tz3000_kdi2o9m6_ts011f_backlight_mode", + "friendlyName": "_TZ3000_kdi2o9m6 TS011F Backlight mode", + "cSharpName": "Tz3000Kdi2o9m6Ts011fBacklightMode" + }, + { + "id": "select.tz3000_kdi2o9m6_ts011f_power_on_state", + "friendlyName": "_TZ3000_kdi2o9m6 TS011F Power on state", + "cSharpName": "Tz3000Kdi2o9m6Ts011fPowerOnState" + } + ], + "attributes": [ + { + "jsonName": "options", + "cSharpName": "Options", + "clrType": "System.Collections.Generic.IReadOnlyList\u00601[System.String]" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + } + ] + }, + { + "domain": "sensor", + "entities": [ + { + "id": "sensor.canon_tr4500_series", + "friendlyName": "Canon TR4500 series", + "cSharpName": "CanonTr4500Series" + }, + { + "id": "sensor.deengfb001_external_ip", + "friendlyName": "FB00-AM-LM Externe IP", + "cSharpName": "Deengfb001ExternalIp" + }, + { + "id": "sensor.deengph001_battery_state", + "friendlyName": "deengph001 Battery state", + "cSharpName": "Deengph001BatteryState" + }, + { + "id": "sensor.deengph001_charger_type", + "friendlyName": "deengph001 Charger type", + "cSharpName": "Deengph001ChargerType" + }, + { + "id": "sensor.deengph001_next_alarm", + "friendlyName": "deengph001 Next alarm", + "cSharpName": "Deengph001NextAlarm" + }, + { + "id": "sensor.deengph002_battery_state", + "friendlyName": "deengph002 Battery State", + "cSharpName": "Deengph002BatteryState" + }, + { + "id": "sensor.deengph002_charger_type", + "friendlyName": "deengph002 Charger Type", + "cSharpName": "Deengph002ChargerType" + }, + { + "id": "sensor.fb00_am_lm_externe_ip", + "friendlyName": "FB00-AM-LM Externe IP", + "cSharpName": "Fb00AmLmExterneIp" + }, + { + "id": "sensor.fb00_am_lm_externe_ipv6", + "friendlyName": "FB00-AM-LM Externe IPv6", + "cSharpName": "Fb00AmLmExterneIpv6" + }, + { + "id": "sensor.fb00_am_lm_letzter_neustart", + "friendlyName": "FB00-AM-LM Letzter Neustart", + "cSharpName": "Fb00AmLmLetzterNeustart" + }, + { + "id": "sensor.fb00_am_lm_verbindungsverfugbarkeit", + "friendlyName": "FB00-AM-LM Verbindungsverf\u00FCgbarkeit", + "cSharpName": "Fb00AmLmVerbindungsverfugbarkeit" + }, + { + "id": "sensor.fritz_box_7430_call_monitor_deengtb100stm", + "friendlyName": "Fritz!Box 7430 Call Monitor Deengtb100Stm", + "cSharpName": "FritzBox7430CallMonitorDeengtb100stm" + }, + { + "id": "sensor.moon_phase", + "friendlyName": "Moon Phase", + "cSharpName": "MoonPhase" + }, + { + "id": "sensor.sun_next_dawn", + "friendlyName": "Sun N\u00E4chste Morgend\u00E4mmerung", + "cSharpName": "SunNextDawn" + }, + { + "id": "sensor.sun_next_dusk", + "friendlyName": "Sun N\u00E4chste Abendd\u00E4mmerung", + "cSharpName": "SunNextDusk" + }, + { + "id": "sensor.sun_next_midnight", + "friendlyName": "Sun N\u00E4chste Mitternacht", + "cSharpName": "SunNextMidnight" + }, + { + "id": "sensor.sun_next_noon", + "friendlyName": "Sun N\u00E4chsten Mittag", + "cSharpName": "SunNextNoon" + }, + { + "id": "sensor.sun_next_rising", + "friendlyName": "Sun N\u00E4chster Sonnenaufgang", + "cSharpName": "SunNextRising" + }, + { + "id": "sensor.sun_next_setting", + "friendlyName": "Sun N\u00E4chster Sonnenuntergang", + "cSharpName": "SunNextSetting" + }, + { + "id": "sensor.tz3000_cfnprab5_ts011f_lqi", + "friendlyName": "deengzb002dg-st-mx LQI", + "cSharpName": "Tz3000Cfnprab5Ts011fLqi" + } + ], + "attributes": [ + { + "jsonName": "device_class", + "cSharpName": "DeviceClass", + "clrType": "System.String" + }, + { + "jsonName": "icon", + "cSharpName": "Icon", + "clrType": "System.String" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + }, + { + "jsonName": "options", + "cSharpName": "Options", + "clrType": "System.Collections.Generic.IReadOnlyList\u00601[System.String]" + }, + { + "jsonName": "info", + "cSharpName": "Info", + "clrType": "System.String" + }, + { + "jsonName": "serial", + "cSharpName": "Serial", + "clrType": "System.Object" + }, + { + "jsonName": "location", + "cSharpName": "Location", + "clrType": "System.String" + }, + { + "jsonName": "state_message", + "cSharpName": "StateMessage", + "clrType": "System.Object" + }, + { + "jsonName": "state_reason", + "cSharpName": "StateReason", + "clrType": "System.Object" + }, + { + "jsonName": "command_set", + "cSharpName": "CommandSet", + "clrType": "System.String" + }, + { + "jsonName": "uri_supported", + "cSharpName": "UriSupported", + "clrType": "System.Collections.Generic.IReadOnlyList\u00601[System.String]" + }, + { + "jsonName": "state_class", + "cSharpName": "StateClass", + "clrType": "System.String" + } + ] + }, + { + "domain": "sensor", + "isNumeric": true, + "entities": [ + { + "id": "sensor.accm80317e877768cd21_577b_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Accm80317e877768cd21577bGeschatzteEntfernung" + }, + { + "id": "sensor.canon_tr4500_series_black", + "friendlyName": "Canon TR4500 series Black", + "cSharpName": "CanonTr4500SeriesBlack" + }, + { + "id": "sensor.canon_tr4500_series_color", + "friendlyName": "Canon TR4500 series Color", + "cSharpName": "CanonTr4500SeriesColor" + }, + { + "id": "sensor.care_6ee7_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Care6ee7GeschatzteEntfernung" + }, + { + "id": "sensor.deengfb001_kib_s_received", + "friendlyName": "FB00-AM-LM Download-Geschwindigkeit", + "cSharpName": "Deengfb001KibSReceived" + }, + { + "id": "sensor.deengfb001_kib_s_sent", + "friendlyName": "FB00-AM-LM Upload-Geschwindigkeit", + "cSharpName": "Deengfb001KibSSent" + }, + { + "id": "sensor.deengph001_battery_level", + "friendlyName": "deengph001 Battery level", + "cSharpName": "Deengph001BatteryLevel" + }, + { + "id": "sensor.deengph001_battery_temperature", + "friendlyName": "deengph001 Battery temperature", + "cSharpName": "Deengph001BatteryTemperature" + }, + { + "id": "sensor.deengph002_battery_level", + "friendlyName": "deengph002 Battery Level", + "cSharpName": "Deengph002BatteryLevel" + }, + { + "id": "sensor.deengph002_battery_temperature", + "friendlyName": "deengph002 Battery Temperature", + "cSharpName": "Deengph002BatteryTemperature" + }, + { + "id": "sensor.dp_2_0_tovjt195134_2ee4_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp20Tovjt1951342ee4GeschatzteEntfernung" + }, + { + "id": "sensor.dp_2_0_tovjx225777_016a_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp20Tovjx225777016aGeschatzteEntfernung" + }, + { + "id": "sensor.dp_2_0_tovjx377096_25cd_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp20Tovjx37709625cdGeschatzteEntfernung" + }, + { + "id": "sensor.dp_2_0_tovjx503147_ab20_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp20Tovjx503147Ab20GeschatzteEntfernung" + }, + { + "id": "sensor.dp_2_1_togjy024416_4639_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp21Togjy0244164639GeschatzteEntfernung" + }, + { + "id": "sensor.dp_2_1_togkx010618_675a_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp21Togkx010618675aGeschatzteEntfernung" + }, + { + "id": "sensor.dp_2_1_togkx189047_cd97_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp21Togkx189047Cd97GeschatzteEntfernung" + }, + { + "id": "sensor.dp_2_1_togkx197117_382c_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp21Togkx197117382cGeschatzteEntfernung" + }, + { + "id": "sensor.dp_2_1_togky119454_c3a5_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp21Togky119454C3a5GeschatzteEntfernung" + }, + { + "id": "sensor.dp_2_1_toglx117325_528e_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp21Toglx117325528eGeschatzteEntfernung" + }, + { + "id": "sensor.dp_2_1_togly034829_b86e_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp21Togly034829B86eGeschatzteEntfernung" + }, + { + "id": "sensor.dp_2_1_tognx012049_e283_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp21Tognx012049E283GeschatzteEntfernung" + }, + { + "id": "sensor.dp_2_1_tormx105463_a20b_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Dp21Tormx105463A20bGeschatzteEntfernung" + }, + { + "id": "sensor.drivedot_2919_235f_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Drivedot2919235fGeschatzteEntfernung" + }, + { + "id": "sensor.drivedot_3372_ccf3_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Drivedot3372Ccf3GeschatzteEntfernung" + }, + { + "id": "sensor.drivedot_4319_c4fb_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Drivedot4319C4fbGeschatzteEntfernung" + }, + { + "id": "sensor.drivedot_6574_d1ef_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Drivedot6574D1efGeschatzteEntfernung" + }, + { + "id": "sensor.drivedot_9703_afa8_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Drivedot9703Afa8GeschatzteEntfernung" + }, + { + "id": "sensor.fb00_am_lm_download_durchsatz", + "friendlyName": "FB00-AM-LM Download-Durchsatz", + "cSharpName": "Fb00AmLmDownloadDurchsatz" + }, + { + "id": "sensor.fb00_am_lm_gb_empfangen", + "friendlyName": "FB00-AM-LM GB empfangen", + "cSharpName": "Fb00AmLmGbEmpfangen" + }, + { + "id": "sensor.fb00_am_lm_gb_gesendet", + "friendlyName": "FB00-AM-LM GB gesendet", + "cSharpName": "Fb00AmLmGbGesendet" + }, + { + "id": "sensor.fb00_am_lm_link_download_durchsatz", + "friendlyName": "FB00-AM-LM Link-Download-Durchsatz", + "cSharpName": "Fb00AmLmLinkDownloadDurchsatz" + }, + { + "id": "sensor.fb00_am_lm_link_download_leistungsdampfung", + "friendlyName": "FB00-AM-LM Link-Download-Leistungsd\u00E4mpfung", + "cSharpName": "Fb00AmLmLinkDownloadLeistungsdampfung" + }, + { + "id": "sensor.fb00_am_lm_link_upload_durchsatz", + "friendlyName": "FB00-AM-LM Link-Upload-Durchsatz", + "cSharpName": "Fb00AmLmLinkUploadDurchsatz" + }, + { + "id": "sensor.fb00_am_lm_link_upload_leistungsdampfung", + "friendlyName": "FB00-AM-LM Link-Upload-Leistungsd\u00E4mpfung", + "cSharpName": "Fb00AmLmLinkUploadLeistungsdampfung" + }, + { + "id": "sensor.fb00_am_lm_maximaler_download_durchsatz_der_verbindung", + "friendlyName": "FB00-AM-LM Maximaler Download-Durchsatz der Verbindung", + "cSharpName": "Fb00AmLmMaximalerDownloadDurchsatzDerVerbindung" + }, + { + "id": "sensor.fb00_am_lm_maximaler_upload_durchsatz_der_verbindung", + "friendlyName": "FB00-AM-LM Maximaler Upload-Durchsatz der Verbindung", + "cSharpName": "Fb00AmLmMaximalerUploadDurchsatzDerVerbindung" + }, + { + "id": "sensor.fb00_am_lm_rauschabstand_zum_link_download", + "friendlyName": "FB00-AM-LM Rauschabstand zum Link-Download", + "cSharpName": "Fb00AmLmRauschabstandZumLinkDownload" + }, + { + "id": "sensor.fb00_am_lm_rauschabstand_zum_link_upload", + "friendlyName": "FB00-AM-LM Rauschabstand zum Link-Upload", + "cSharpName": "Fb00AmLmRauschabstandZumLinkUpload" + }, + { + "id": "sensor.fb00_am_lm_upload_durchsatz", + "friendlyName": "FB00-AM-LM Upload-Durchsatz", + "cSharpName": "Fb00AmLmUploadDurchsatz" + }, + { + "id": "sensor.hacs", + "friendlyName": "hacs", + "cSharpName": "Hacs" + }, + { + "id": "sensor.internetgatewaydevicev2_deengfb001_kib_s_received", + "friendlyName": "FB00-AM-LM Download-Geschwindigkeit", + "cSharpName": "Internetgatewaydevicev2Deengfb001KibSReceived" + }, + { + "id": "sensor.internetgatewaydevicev2_deengfb001_kib_s_sent", + "friendlyName": "FB00-AM-LM Upload-Geschwindigkeit", + "cSharpName": "Internetgatewaydevicev2Deengfb001KibSSent" + }, + { + "id": "sensor.ooono_3e7d_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Ooono3e7dGeschatzteEntfernung" + }, + { + "id": "sensor.ooono_80b1_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Ooono80b1GeschatzteEntfernung" + }, + { + "id": "sensor.sun_solar_azimuth", + "friendlyName": "Sun Azimut", + "cSharpName": "SunSolarAzimuth" + }, + { + "id": "sensor.sun_solar_elevation", + "friendlyName": "Sun Sonnenh\u00F6he", + "cSharpName": "SunSolarElevation" + }, + { + "id": "sensor.tz3000_cfnprab5_ts011f_rssi", + "friendlyName": "deengzb002dg-st-mx RSSI", + "cSharpName": "Tz3000Cfnprab5Ts011fRssi" + }, + { + "id": "sensor.wsbc004011516t_9fdc_geschatzte_entfernung", + "friendlyName": "Gesch\u00E4tzte Entfernung", + "cSharpName": "Wsbc004011516t9fdcGeschatzteEntfernung" + } + ], + "attributes": [ + { + "jsonName": "marker_high_level", + "cSharpName": "MarkerHighLevel", + "clrType": "System.Double" + }, + { + "jsonName": "marker_low_level", + "cSharpName": "MarkerLowLevel", + "clrType": "System.Double" + }, + { + "jsonName": "marker_type", + "cSharpName": "MarkerType", + "clrType": "System.String" + }, + { + "jsonName": "unit_of_measurement", + "cSharpName": "UnitOfMeasurement", + "clrType": "System.String" + }, + { + "jsonName": "icon", + "cSharpName": "Icon", + "clrType": "System.String" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + }, + { + "jsonName": "device_class", + "cSharpName": "DeviceClass", + "clrType": "System.String" + }, + { + "jsonName": "state_class", + "cSharpName": "StateClass", + "clrType": "System.String" + }, + { + "jsonName": "repositories", + "cSharpName": "Repositories", + "clrType": "System.Collections.Generic.IReadOnlyList\u00601[System.Object]" + }, + { + "jsonName": "uuid", + "cSharpName": "Uuid", + "clrType": "System.String" + }, + { + "jsonName": "major", + "cSharpName": "Major", + "clrType": "System.Double" + }, + { + "jsonName": "minor", + "cSharpName": "Minor", + "clrType": "System.Double" + }, + { + "jsonName": "source", + "cSharpName": "Source", + "clrType": "System.String" + }, + { + "jsonName": "restored", + "cSharpName": "Restored", + "clrType": "System.Boolean" + }, + { + "jsonName": "supported_features", + "cSharpName": "SupportedFeatures", + "clrType": "System.Double" + } + ] + }, + { + "domain": "sun", + "entities": [ + { + "id": "sun.sun", + "friendlyName": "Sun", + "cSharpName": "Sun" + } + ], + "attributes": [ + { + "jsonName": "next_dawn", + "cSharpName": "NextDawn", + "clrType": "System.String" + }, + { + "jsonName": "next_dusk", + "cSharpName": "NextDusk", + "clrType": "System.String" + }, + { + "jsonName": "next_midnight", + "cSharpName": "NextMidnight", + "clrType": "System.String" + }, + { + "jsonName": "next_noon", + "cSharpName": "NextNoon", + "clrType": "System.String" + }, + { + "jsonName": "next_rising", + "cSharpName": "NextRising", + "clrType": "System.String" + }, + { + "jsonName": "next_setting", + "cSharpName": "NextSetting", + "clrType": "System.String" + }, + { + "jsonName": "elevation", + "cSharpName": "Elevation", + "clrType": "System.Double" + }, + { + "jsonName": "azimuth", + "cSharpName": "Azimuth", + "clrType": "System.Double" + }, + { + "jsonName": "rising", + "cSharpName": "Rising", + "clrType": "System.Boolean" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + } + ] + }, + { + "domain": "switch", + "entities": [ + { + "id": "switch.android_217ffb982e982cf9_internet_access", + "friendlyName": "deengph002 Internet Access", + "cSharpName": "Android217ffb982e982cf9InternetAccess" + }, + { + "id": "switch.android_792e9092fe50e529_internet_access", + "friendlyName": "android-792e9092fe50e529 Internet Access", + "cSharpName": "Android792e9092fe50e529InternetAccess" + }, + { + "id": "switch.deengap001dns_internet_access", + "friendlyName": "deengap001 Internet Access", + "cSharpName": "Deengap001dnsInternetAccess" + }, + { + "id": "switch.deengha001_internet_access", + "friendlyName": "deengha001 Internet Access", + "cSharpName": "Deengha001InternetAccess" + }, + { + "id": "switch.deengna001_internet_access", + "friendlyName": "deengna001 Internet Access", + "cSharpName": "Deengna001InternetAccess" + }, + { + "id": "switch.deengna002_internet_access", + "friendlyName": "deengna002 Internet Access", + "cSharpName": "Deengna002InternetAccess" + }, + { + "id": "switch.deengna002_internet_access_2", + "friendlyName": "deengna002 Internet Access", + "cSharpName": "Deengna002InternetAccess2" + }, + { + "id": "switch.deengna003_internet_access", + "friendlyName": "deengna003 Internet Access", + "cSharpName": "Deengna003InternetAccess" + }, + { + "id": "switch.deengna003_internet_access_2", + "friendlyName": "deengna003 Internet Access", + "cSharpName": "Deengna003InternetAccess2" + }, + { + "id": "switch.deengna004_internet_access", + "friendlyName": "deengna004 Internet Access", + "cSharpName": "Deengna004InternetAccess" + }, + { + "id": "switch.deengna004_internet_access_2", + "friendlyName": "deengna004 Internet Access", + "cSharpName": "Deengna004InternetAccess2" + }, + { + "id": "switch.deengnb001stm_internet_access", + "friendlyName": "deengnb001 Internet Access", + "cSharpName": "Deengnb001stmInternetAccess" + }, + { + "id": "switch.deengnb001stm_internet_access_2", + "friendlyName": "deengnb001 Internet Access", + "cSharpName": "Deengnb001stmInternetAccess2" + }, + { + "id": "switch.deengnb003lm_internet_access", + "friendlyName": "deengnb003lm Internet Access", + "cSharpName": "Deengnb003lmInternetAccess" + }, + { + "id": "switch.deengns001_internet_access", + "friendlyName": "deengns001 Internet Access", + "cSharpName": "Deengns001InternetAccess" + }, + { + "id": "switch.deengns002_internet_access", + "friendlyName": "deengns002 Internet Access", + "cSharpName": "Deengns002InternetAccess" + }, + { + "id": "switch.deengpc001_internet_access", + "friendlyName": "deengpc001 Internet Access", + "cSharpName": "Deengpc001InternetAccess" + }, + { + "id": "switch.deengpc001_internet_access_2", + "friendlyName": "deengpc001 Internet Access", + "cSharpName": "Deengpc001InternetAccess2" + }, + { + "id": "switch.deengpc002_internet_access", + "friendlyName": "deengpc002 Internet Access", + "cSharpName": "Deengpc002InternetAccess" + }, + { + "id": "switch.deengpr001_internet_access", + "friendlyName": "deengpr001 Internet Access", + "cSharpName": "Deengpr001InternetAccess" + }, + { + "id": "switch.deengrs001amln_internet_access", + "friendlyName": "deengir002 Internet Access", + "cSharpName": "Deengrs001amlnInternetAccess" + }, + { + "id": "switch.deengsd001_internet_access", + "friendlyName": "deengsd001 Internet Access", + "cSharpName": "Deengsd001InternetAccess" + }, + { + "id": "switch.deengsr002stm_internet_access", + "friendlyName": "deengir001 Internet Access", + "cSharpName": "Deengsr002stmInternetAccess" + }, + { + "id": "switch.deengst001amlm_internet_access", + "friendlyName": "deengst001amlm Internet Access", + "cSharpName": "Deengst001amlmInternetAccess" + }, + { + "id": "switch.deengst002_internet_access", + "friendlyName": "deengtv001 Internet Access", + "cSharpName": "Deengst002InternetAccess" + }, + { + "id": "switch.deengws001_internet_access", + "friendlyName": "deengws001 Internet Access", + "cSharpName": "Deengws001InternetAccess" + }, + { + "id": "switch.fb00_am_lm_call_deflection_0", + "friendlyName": "FB00-AM-LM Call deflection 0", + "cSharpName": "Fb00AmLmCallDeflection0" + }, + { + "id": "switch.fb00_am_lm_call_deflection_1", + "friendlyName": "FB00-AM-LM Call deflection 1", + "cSharpName": "Fb00AmLmCallDeflection1" + }, + { + "id": "switch.fb00_am_lm_port_forward_137_139", + "friendlyName": "FB00-AM-LM Port forward 137-139", + "cSharpName": "Fb00AmLmPortForward137139" + }, + { + "id": "switch.fb00_am_lm_port_forward_443", + "friendlyName": "FB00-AM-LM Port forward 443", + "cSharpName": "Fb00AmLmPortForward443" + }, + { + "id": "switch.fb00_am_lm_port_forward_445", + "friendlyName": "FB00-AM-LM Port forward 445", + "cSharpName": "Fb00AmLmPortForward445" + }, + { + "id": "switch.fb00_am_lm_wi_fi_deengwl001", + "friendlyName": "FB00-AM-LM Wi-Fi deengwl001", + "cSharpName": "Fb00AmLmWiFiDeengwl001" + }, + { + "id": "switch.fb00_am_lm_wi_fi_fb00_am_lm_gastzugang", + "friendlyName": "FB00-AM-LM Wi-Fi FB00-AM-LM Gastzugang", + "cSharpName": "Fb00AmLmWiFiFb00AmLmGastzugang" + }, + { + "id": "switch.pc_265e_beff_fe1e_20f7_internet_access", + "friendlyName": "deengns002 Internet Access", + "cSharpName": "Pc265eBeffFe1e20f7InternetAccess" + }, + { + "id": "switch.redmi_note_9_pro_internet_access", + "friendlyName": "deengph001 Internet Access", + "cSharpName": "RedmiNote9ProInternetAccess" + }, + { + "id": "switch.stm", + "friendlyName": "stm", + "cSharpName": "Stm" + }, + { + "id": "switch.tz3000_kdi2o9m6_ts011f_switch", + "friendlyName": "_TZ3000_kdi2o9m6 TS011F Switch", + "cSharpName": "Tz3000Kdi2o9m6Ts011fSwitch" + } + ], + "attributes": [ + { + "jsonName": "type", + "cSharpName": "Type", + "clrType": "System.String" + }, + { + "jsonName": "number", + "cSharpName": "Number", + "clrType": "System.String" + }, + { + "jsonName": "deflection_to_number", + "cSharpName": "DeflectionToNumber", + "clrType": "System.Object" + }, + { + "jsonName": "mode", + "cSharpName": "Mode", + "clrType": "System.String" + }, + { + "jsonName": "outgoing", + "cSharpName": "Outgoing", + "clrType": "System.Object" + }, + { + "jsonName": "phonebook_id", + "cSharpName": "PhonebookId", + "clrType": "System.Object" + }, + { + "jsonName": "icon", + "cSharpName": "Icon", + "clrType": "System.String" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + }, + { + "jsonName": "internal_ip", + "cSharpName": "InternalIp", + "clrType": "System.String" + }, + { + "jsonName": "internal_port", + "cSharpName": "InternalPort", + "clrType": "System.Double" + }, + { + "jsonName": "external_port", + "cSharpName": "ExternalPort", + "clrType": "System.Object" + }, + { + "jsonName": "protocol", + "cSharpName": "Protocol", + "clrType": "System.String" + }, + { + "jsonName": "description", + "cSharpName": "Description", + "clrType": "System.String" + }, + { + "jsonName": "standard", + "cSharpName": "Standard", + "clrType": "System.String" + }, + { + "jsonName": "bssid", + "cSharpName": "Bssid", + "clrType": "System.String" + }, + { + "jsonName": "mac_address_control", + "cSharpName": "MacAddressControl", + "clrType": "System.Boolean" + }, + { + "jsonName": "restored", + "cSharpName": "Restored", + "clrType": "System.Boolean" + }, + { + "jsonName": "supported_features", + "cSharpName": "SupportedFeatures", + "clrType": "System.Double" + } + ] + }, + { + "domain": "update", + "entities": [ + { + "id": "update.duck_dns_update", + "friendlyName": "Duck DNS Update", + "cSharpName": "DuckDnsUpdate" + }, + { + "id": "update.fb00_am_lm_fritz_os", + "friendlyName": "FB00-AM-LM FRITZ!OS", + "cSharpName": "Fb00AmLmFritzOs" + }, + { + "id": "update.file_editor_update", + "friendlyName": "File editor Update", + "cSharpName": "FileEditorUpdate" + }, + { + "id": "update.google_assistant_sdk_update", + "friendlyName": "Google Assistant SDK Update", + "cSharpName": "GoogleAssistantSdkUpdate" + }, + { + "id": "update.home_assistant_core_update", + "friendlyName": "Home Assistant Core Update", + "cSharpName": "HomeAssistantCoreUpdate" + }, + { + "id": "update.home_assistant_operating_system_update", + "friendlyName": "Home Assistant Operating System Update", + "cSharpName": "HomeAssistantOperatingSystemUpdate" + }, + { + "id": "update.home_assistant_supervisor_update", + "friendlyName": "Home Assistant Supervisor Update", + "cSharpName": "HomeAssistantSupervisorUpdate" + }, + { + "id": "update.netdaemon_v3_1_net_7_update", + "friendlyName": "NetDaemon V3.1 (.NET 7) Update", + "cSharpName": "NetdaemonV31Net7Update" + }, + { + "id": "update.nginx_home_assistant_ssl_proxy_update", + "friendlyName": "NGINX Home Assistant SSL proxy Update", + "cSharpName": "NginxHomeAssistantSslProxyUpdate" + }, + { + "id": "update.rpc_shutdown_update", + "friendlyName": "RPC Shutdown Update", + "cSharpName": "RpcShutdownUpdate" + }, + { + "id": "update.samba_share_update", + "friendlyName": "Samba share Update", + "cSharpName": "SambaShareUpdate" + }, + { + "id": "update.studio_code_server_update", + "friendlyName": "Studio Code Server Update", + "cSharpName": "StudioCodeServerUpdate" + }, + { + "id": "update.terminal_ssh_update", + "friendlyName": "Terminal \u0026 SSH Update", + "cSharpName": "TerminalSshUpdate" + }, + { + "id": "update.vaultwarden_bitwarden_update", + "friendlyName": "Vaultwarden (Bitwarden) Update", + "cSharpName": "VaultwardenBitwardenUpdate" + }, + { + "id": "update.vlc_update", + "friendlyName": "VLC Update", + "cSharpName": "VlcUpdate" + } + ], + "attributes": [ + { + "jsonName": "auto_update", + "cSharpName": "AutoUpdate", + "clrType": "System.Boolean" + }, + { + "jsonName": "installed_version", + "cSharpName": "InstalledVersion", + "clrType": "System.String" + }, + { + "jsonName": "in_progress", + "cSharpName": "InProgress", + "clrType": "System.Boolean" + }, + { + "jsonName": "latest_version", + "cSharpName": "LatestVersion", + "clrType": "System.String" + }, + { + "jsonName": "release_summary", + "cSharpName": "ReleaseSummary", + "clrType": "System.String" + }, + { + "jsonName": "release_url", + "cSharpName": "ReleaseUrl", + "clrType": "System.String" + }, + { + "jsonName": "skipped_version", + "cSharpName": "SkippedVersion", + "clrType": "System.Object" + }, + { + "jsonName": "title", + "cSharpName": "Title", + "clrType": "System.String" + }, + { + "jsonName": "entity_picture", + "cSharpName": "EntityPicture", + "clrType": "System.String" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + }, + { + "jsonName": "supported_features", + "cSharpName": "SupportedFeatures", + "clrType": "System.Double" + } + ] + }, + { + "domain": "weather", + "entities": [ + { + "id": "weather.forecast_home", + "friendlyName": "Forecast Home", + "cSharpName": "ForecastHome" + } + ], + "attributes": [ + { + "jsonName": "temperature", + "cSharpName": "Temperature", + "clrType": "System.Double" + }, + { + "jsonName": "temperature_unit", + "cSharpName": "TemperatureUnit", + "clrType": "System.String" + }, + { + "jsonName": "humidity", + "cSharpName": "Humidity", + "clrType": "System.Double" + }, + { + "jsonName": "cloud_coverage", + "cSharpName": "CloudCoverage", + "clrType": "System.Double" + }, + { + "jsonName": "pressure", + "cSharpName": "Pressure", + "clrType": "System.Double" + }, + { + "jsonName": "pressure_unit", + "cSharpName": "PressureUnit", + "clrType": "System.String" + }, + { + "jsonName": "wind_bearing", + "cSharpName": "WindBearing", + "clrType": "System.Double" + }, + { + "jsonName": "wind_speed", + "cSharpName": "WindSpeed", + "clrType": "System.Double" + }, + { + "jsonName": "wind_speed_unit", + "cSharpName": "WindSpeedUnit", + "clrType": "System.String" + }, + { + "jsonName": "visibility_unit", + "cSharpName": "VisibilityUnit", + "clrType": "System.String" + }, + { + "jsonName": "precipitation_unit", + "cSharpName": "PrecipitationUnit", + "clrType": "System.String" + }, + { + "jsonName": "forecast", + "cSharpName": "Forecast", + "clrType": "System.Collections.Generic.IReadOnlyList\u00601[System.Object]" + }, + { + "jsonName": "attribution", + "cSharpName": "Attribution", + "clrType": "System.String" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + } + ] + }, + { + "domain": "zone", + "entities": [ + { + "id": "zone.fondium", + "friendlyName": "Fondium", + "cSharpName": "Fondium" + }, + { + "id": "zone.home", + "friendlyName": "Home", + "cSharpName": "Home" + }, + { + "id": "zone.kletterwerk", + "friendlyName": "Kletterwerk", + "cSharpName": "Kletterwerk" + } + ], + "attributes": [ + { + "jsonName": "latitude", + "cSharpName": "Latitude", + "clrType": "System.Double" + }, + { + "jsonName": "longitude", + "cSharpName": "Longitude", + "clrType": "System.Double" + }, + { + "jsonName": "radius", + "cSharpName": "Radius", + "clrType": "System.Double" + }, + { + "jsonName": "passive", + "cSharpName": "Passive", + "clrType": "System.Boolean" + }, + { + "jsonName": "persons", + "cSharpName": "Persons", + "clrType": "System.Collections.Generic.IReadOnlyList\u00601[System.String]" + }, + { + "jsonName": "editable", + "cSharpName": "Editable", + "clrType": "System.Boolean" + }, + { + "jsonName": "icon", + "cSharpName": "Icon", + "clrType": "System.String" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + } + ] + }, + { + "domain": "input_button", + "entities": [ + { + "id": "input_button.deengzb002dg_st_mx_btnonoff", + "friendlyName": "deengzb002dg-st-mx.btnOnOff", + "cSharpName": "Deengzb002dgStMxBtnonoff" + }, + { + "id": "input_button.deengzb002dg_st_mx_btnonoff_tvpc", + "friendlyName": "deengzb002dg-st-mx.btnOnOff.TvPc", + "cSharpName": "Deengzb002dgStMxBtnonoffTvpc" + }, + { + "id": "input_button.tmp", + "friendlyName": "tmp", + "cSharpName": "Tmp" + }, + { + "id": "input_button.tmp2", + "friendlyName": "tmp2", + "cSharpName": "Tmp2" + }, + { + "id": "input_button.tmp3", + "friendlyName": "tmp3", + "cSharpName": "Tmp3" + }, + { + "id": "input_button.tmp4", + "friendlyName": "tmp4", + "cSharpName": "Tmp4" + }, + { + "id": "input_button.tmp5", + "friendlyName": "tmp5", + "cSharpName": "Tmp5" + }, + { + "id": "input_button.tmp6", + "friendlyName": "tmp6", + "cSharpName": "Tmp6" + } + ], + "attributes": [ + { + "jsonName": "editable", + "cSharpName": "Editable", + "clrType": "System.Boolean" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + } + ] + }, + { + "domain": "image", + "entities": [ + { + "id": "image.fb00_am_lm_fb00_am_lm_gastzugang", + "friendlyName": "FB00-AM-LM FB00-AM-LM Gastzugang", + "cSharpName": "Fb00AmLmFb00AmLmGastzugang" + } + ], + "attributes": [ + { + "jsonName": "access_token", + "cSharpName": "AccessToken", + "clrType": "System.String" + }, + { + "jsonName": "entity_picture", + "cSharpName": "EntityPicture", + "clrType": "System.String" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + } + ] + }, + { + "domain": "input_number", + "isNumeric": true, + "entities": [ + { + "id": "input_number.test_number", + "friendlyName": "test_number", + "cSharpName": "TestNumber" + } + ], + "attributes": [ + { + "jsonName": "initial", + "cSharpName": "Initial", + "clrType": "System.Object" + }, + { + "jsonName": "editable", + "cSharpName": "Editable", + "clrType": "System.Boolean" + }, + { + "jsonName": "min", + "cSharpName": "Min", + "clrType": "System.Double" + }, + { + "jsonName": "max", + "cSharpName": "Max", + "clrType": "System.Double" + }, + { + "jsonName": "step", + "cSharpName": "Step", + "clrType": "System.Double" + }, + { + "jsonName": "mode", + "cSharpName": "Mode", + "clrType": "System.String" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + } + ] + }, + { + "domain": "schedule", + "entities": [ + { + "id": "schedule.test", + "friendlyName": "test", + "cSharpName": "Test" + } + ], + "attributes": [ + { + "jsonName": "editable", + "cSharpName": "Editable", + "clrType": "System.Boolean" + }, + { + "jsonName": "next_event", + "cSharpName": "NextEvent", + "clrType": "System.String" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + } + ] + }, + { + "domain": "input_datetime", + "entities": [ + { + "id": "input_datetime.uhr", + "friendlyName": "uhr", + "cSharpName": "Uhr" + } + ], + "attributes": [ + { + "jsonName": "has_date", + "cSharpName": "HasDate", + "clrType": "System.Boolean" + }, + { + "jsonName": "has_time", + "cSharpName": "HasTime", + "clrType": "System.Boolean" + }, + { + "jsonName": "editable", + "cSharpName": "Editable", + "clrType": "System.Boolean" + }, + { + "jsonName": "hour", + "cSharpName": "Hour", + "clrType": "System.Double" + }, + { + "jsonName": "minute", + "cSharpName": "Minute", + "clrType": "System.Double" + }, + { + "jsonName": "second", + "cSharpName": "Second", + "clrType": "System.Double" + }, + { + "jsonName": "timestamp", + "cSharpName": "Timestamp", + "clrType": "System.Double" + }, + { + "jsonName": "friendly_name", + "cSharpName": "FriendlyName", + "clrType": "System.String" + } + ] + } + ] +} \ No newline at end of file diff --git a/NetDaemonApps/NetDaemonApps/NetDaemonCodegen/ServicesMetaData.json b/NetDaemonApps/NetDaemonApps/NetDaemonCodegen/ServicesMetaData.json new file mode 100644 index 0000000..a104d3a --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/NetDaemonCodegen/ServicesMetaData.json @@ -0,0 +1,6191 @@ +{ + "persistent_notification": { + "create": { + "name": "Create", + "description": "Shows a notification on the **Notifications** panel.", + "fields": { + "message": { + "required": true, + "example": "Please check your configuration.yaml.", + "selector": { + "text": null + }, + "name": "Message", + "description": "Message body of the notification." + }, + "title": { + "example": "Test notification", + "selector": { + "text": null + }, + "name": "Title", + "description": "Optional title of the notification." + }, + "notification_id": { + "example": 1234, + "selector": { + "text": null + }, + "name": "Notification ID", + "description": "ID of the notification. This new notification will overwrite an existing notification with the same ID." + } + } + }, + "dismiss": { + "name": "Dismiss", + "description": "Removes a notification from the **Notifications** panel.", + "fields": { + "notification_id": { + "required": true, + "example": 1234, + "selector": { + "text": null + }, + "name": "Notification ID", + "description": "ID of the notification to be removed." + } + } + }, + "dismiss_all": { + "name": "Dismiss all", + "description": "Removes all notifications from the **Notifications** panel.", + "fields": {} + } + }, + "homeassistant": { + "save_persistent_states": { + "name": "Save persistent states", + "description": "Saves the persistent states immediately. Maintains the normal periodic saving interval.", + "fields": {} + }, + "turn_off": { + "name": "Generic turn off", + "description": "Generic service to turn devices off under any domain.", + "fields": {}, + "target": { + "entity": [ + {} + ] + } + }, + "turn_on": { + "name": "Generic turn on", + "description": "Generic service to turn devices on under any domain.", + "fields": {}, + "target": { + "entity": [ + {} + ] + } + }, + "toggle": { + "name": "Generic toggle", + "description": "Generic service to toggle devices on/off under any domain.", + "fields": {}, + "target": { + "entity": [ + {} + ] + } + }, + "stop": { + "name": "Stop", + "description": "Stops Home Assistant.", + "fields": {} + }, + "restart": { + "name": "Restart", + "description": "Restarts Home Assistant.", + "fields": {} + }, + "check_config": { + "name": "Check configuration", + "description": "Checks the Home Assistant YAML-configuration files for errors. Errors will be shown in the Home Assistant logs.", + "fields": {} + }, + "update_entity": { + "name": "Update entity", + "description": "Forces one or more entities to update its data.", + "fields": {}, + "target": { + "entity": [ + {} + ] + } + }, + "reload_core_config": { + "name": "Reload core configuration", + "description": "Reloads the core configuration from the YAML-configuration.", + "fields": {} + }, + "set_location": { + "name": "Set location", + "description": "Updates the Home Assistant location.", + "fields": { + "latitude": { + "required": true, + "example": 32.87336, + "selector": { + "text": null + }, + "name": "Latitude", + "description": "Latitude of your location." + }, + "longitude": { + "required": true, + "example": 117.22743, + "selector": { + "text": null + }, + "name": "Longitude", + "description": "Longitude of your location." + } + } + }, + "reload_custom_templates": { + "name": "Reload custom Jinja2 templates", + "description": "Reloads Jinja2 templates found in the \u0060custom_templates\u0060 folder in your config. New values will be applied on the next render of the template.", + "fields": {} + }, + "reload_config_entry": { + "name": "Reload config entry", + "description": "Reloads the specified config entry.", + "fields": { + "entry_id": { + "advanced": true, + "required": false, + "example": "8955375327824e14ba89e4b29cc3ec9a", + "selector": { + "text": null + }, + "name": "Config entry ID", + "description": "The configuration entry ID of the entry to be reloaded." + } + }, + "target": { + "entity": [ + {} + ], + "device": [ + {} + ] + } + }, + "reload_all": { + "name": "", + "description": "", + "fields": {} + } + }, + "system_log": { + "clear": { + "name": "Clear all", + "description": "Clears all log entries.", + "fields": {} + }, + "write": { + "name": "Write", + "description": "Write log entry.", + "fields": { + "message": { + "required": true, + "example": "Something went wrong", + "selector": { + "text": null + }, + "name": "Message", + "description": "Message to log." + }, + "level": { + "default": "error", + "selector": { + "select": { + "options": [ + "debug", + "info", + "warning", + "error", + "critical" + ], + "translation_key": "level" + } + }, + "name": "Level", + "description": "Log level." + }, + "logger": { + "example": "mycomponent.myplatform", + "selector": { + "text": null + }, + "name": "Logger", + "description": "Logger name under which to log the message. Defaults to \u0060system_log.external\u0060." + } + } + } + }, + "logger": { + "set_default_level": { + "name": "Set default level", + "description": "Sets the default log level for integrations.", + "fields": { + "level": { + "selector": { + "select": { + "options": [ + "debug", + "info", + "warning", + "error", + "fatal", + "critical" + ], + "translation_key": "level" + } + }, + "name": "Level", + "description": "Default severity level for all integrations." + } + } + }, + "set_level": { + "name": "Set level", + "description": "Sets the log level for one or more integrations.", + "fields": {} + } + }, + "person": { + "reload": { + "name": "Reload", + "description": "Reloads persons from the YAML-configuration.", + "fields": {} + } + }, + "frontend": { + "set_theme": { + "name": "Set the default theme", + "description": "Sets the default theme Home Assistant uses. Can be overridden by a user.", + "fields": { + "name": { + "required": true, + "example": "default", + "selector": { + "theme": { + "include_default": true + } + }, + "name": "Theme", + "description": "Name of a theme." + }, + "mode": { + "default": "light", + "selector": { + "select": { + "options": [ + "dark", + "light" + ], + "translation_key": "mode" + } + }, + "name": "Mode", + "description": "Theme mode." + } + } + }, + "reload_themes": { + "name": "Reload themes", + "description": "Reloads themes from the YAML-configuration.", + "fields": {} + } + }, + "recorder": { + "purge": { + "name": "Purge", + "description": "Starts purge task - to clean up old data from your database.", + "fields": { + "keep_days": { + "selector": { + "number": { + "min": 0, + "max": 365, + "unit_of_measurement": "days" + } + }, + "name": "Days to keep", + "description": "Number of days to keep the data in the database. Starting today, counting backward. A value of \u00607\u0060 means that everything older than a week will be purged." + }, + "repack": { + "default": false, + "selector": { + "boolean": null + }, + "name": "Repack", + "description": "Attempt to save disk space by rewriting the entire database file." + }, + "apply_filter": { + "default": false, + "selector": { + "boolean": null + }, + "name": "Apply filter", + "description": "Applys \u0060entity_id\u0060 and \u0060event_type\u0060 filters in addition to time-based purge." + } + } + }, + "purge_entities": { + "name": "Purge entities", + "description": "Starts a purge task to remove the data related to specific entities from your database.", + "fields": { + "domains": { + "example": "sun", + "required": false, + "default": [], + "selector": { + "object": null + }, + "name": "Domains to remove", + "description": "List of domains for which the data needs to be removed from the recorder database." + }, + "entity_globs": { + "example": "domain*.object_id*", + "required": false, + "default": [], + "selector": { + "object": null + }, + "name": "Entity globs to remove", + "description": "List of glob patterns used to select the entities for which the data is to be removed from the recorder database." + }, + "keep_days": { + "default": 0, + "selector": { + "number": { + "min": 0, + "max": 365, + "unit_of_measurement": "days" + } + }, + "name": "Days to keep", + "description": "Number of days to keep the data for rows matching the filter. Starting today, counting backward. A value of \u00607\u0060 means that everything older than a week will be purged. The default of 0 days will remove all matching rows immediately." + } + }, + "target": { + "entity": [ + {} + ] + } + }, + "enable": { + "name": "Enable", + "description": "Starts the recording of events and state changes.", + "fields": {} + }, + "disable": { + "name": "Disable", + "description": "Stops the recording of events and state changes.", + "fields": {} + } + }, + "hassio": { + "addon_start": { + "name": "Start add-on", + "description": "Starts an add-on.", + "fields": { + "addon": { + "required": true, + "example": "core_ssh", + "selector": { + "addon": null + }, + "name": "Add-on", + "description": "The add-on slug." + } + } + }, + "addon_stop": { + "name": "Stop add-on.", + "description": "Stops an add-on.", + "fields": { + "addon": { + "required": true, + "example": "core_ssh", + "selector": { + "addon": null + }, + "name": "Add-on", + "description": "The add-on slug." + } + } + }, + "addon_restart": { + "name": "Restart add-on.", + "description": "Restarts an add-on.", + "fields": { + "addon": { + "required": true, + "example": "core_ssh", + "selector": { + "addon": null + }, + "name": "Add-on", + "description": "The add-on slug." + } + } + }, + "addon_update": { + "name": "Update add-on.", + "description": "Updates an add-on. This service should be used with caution since add-on updates can contain breaking changes. It is highly recommended that you review release notes/change logs before updating an add-on.", + "fields": { + "addon": { + "required": true, + "example": "core_ssh", + "selector": { + "addon": null + }, + "name": "Add-on", + "description": "The add-on slug." + } + } + }, + "addon_stdin": { + "name": "Write data to add-on stdin.", + "description": "Writes data to add-on stdin.", + "fields": { + "addon": { + "required": true, + "example": "core_ssh", + "selector": { + "addon": null + }, + "name": "Add-on", + "description": "The add-on slug." + } + } + }, + "host_shutdown": { + "name": "Power off the host system.", + "description": "Powers off the host system.", + "fields": {} + }, + "host_reboot": { + "name": "Reboot the host system.", + "description": "Reboots the host system.", + "fields": {} + }, + "backup_full": { + "name": "Create a full backup.", + "description": "Creates a full backup.", + "fields": { + "name": { + "example": "Backup 1", + "selector": { + "text": null + }, + "name": "Name", + "description": "Optional (default = current date and time)." + }, + "password": { + "example": "password", + "selector": { + "text": null + }, + "name": "Password", + "description": "Password to protect the backup with." + }, + "compressed": { + "default": true, + "selector": { + "boolean": null + }, + "name": "Compressed", + "description": "Compresses the backup files." + }, + "location": { + "example": "my_backup_mount", + "selector": { + "backup_location": null + }, + "name": "Location", + "description": "Name of a backup network storage to host backups." + } + } + }, + "backup_partial": { + "name": "Create a partial backup.", + "description": "Creates a partial backup.", + "fields": { + "homeassistant": { + "selector": { + "boolean": null + }, + "name": "Home Assistant settings", + "description": "Includes Home Assistant settings in the backup." + }, + "addons": { + "example": [ + "core_ssh", + "core_samba", + "core_mosquitto" + ], + "selector": { + "object": null + }, + "name": "Add-ons", + "description": "List of add-ons to include in the backup. Use the name slug of the add-on." + }, + "folders": { + "example": [ + "homeassistant", + "share" + ], + "selector": { + "object": null + }, + "name": "Folders", + "description": "List of directories to include in the backup." + }, + "name": { + "example": "Partial backup 1", + "selector": { + "text": null + }, + "name": "Name", + "description": "Optional (default = current date and time)." + }, + "password": { + "example": "password", + "selector": { + "text": null + }, + "name": "Password", + "description": "Password to protect the backup with." + }, + "compressed": { + "default": true, + "selector": { + "boolean": null + }, + "name": "Compressed", + "description": "Compresses the backup files." + }, + "location": { + "example": "my_backup_mount", + "selector": { + "backup_location": null + }, + "name": "Location", + "description": "Name of a backup network storage to host backups." + } + } + }, + "restore_full": { + "name": "Restore from full backup.", + "description": "Restores from full backup.", + "fields": { + "slug": { + "required": true, + "selector": { + "text": null + }, + "name": "Slug", + "description": "Slug of backup to restore from." + }, + "password": { + "example": "password", + "selector": { + "text": null + }, + "name": "Password", + "description": "Optional password." + } + } + }, + "restore_partial": { + "name": "Restore from partial backup.", + "description": "Restores from a partial backup.", + "fields": { + "slug": { + "required": true, + "selector": { + "text": null + }, + "name": "Slug", + "description": "Slug of backup to restore from." + }, + "homeassistant": { + "selector": { + "boolean": null + }, + "name": "Home Assistant settings", + "description": "Restores Home Assistant." + }, + "folders": { + "example": [ + "homeassistant", + "share" + ], + "selector": { + "object": null + }, + "name": "Folders", + "description": "List of directories to include in the backup." + }, + "addons": { + "example": [ + "core_ssh", + "core_samba", + "core_mosquitto" + ], + "selector": { + "object": null + }, + "name": "Add-ons", + "description": "List of add-ons to include in the backup. Use the name slug of the add-on." + }, + "password": { + "example": "password", + "selector": { + "text": null + }, + "name": "Password", + "description": "Optional password." + } + } + } + }, + "cloud": { + "remote_connect": { + "name": "Remote connect", + "description": "Makes the instance UI accessible from outside of the local network by using Home Assistant Cloud.", + "fields": {} + }, + "remote_disconnect": { + "name": "Remote disconnect", + "description": "Disconnects the Home Assistant UI from the Home Assistant Cloud. You will no longer be able to access your Home Assistant instance from outside your local network.", + "fields": {} + } + }, + "update": { + "install": { + "name": "Install update", + "description": "Installs an update for this device or service.", + "fields": { + "version": { + "required": false, + "example": "1.0.0", + "selector": { + "text": null + }, + "name": "Version", + "description": "The version to install. If omitted, the latest version will be installed." + }, + "backup": { + "required": false, + "selector": { + "boolean": null + }, + "name": "Backup", + "description": "If supported by the integration, this creates a backup before starting the update ." + } + }, + "target": { + "entity": [ + { + "domain": [ + "update" + ] + } + ] + } + }, + "skip": { + "name": "Skip update", + "description": "Marks currently available update as skipped.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "update" + ] + } + ] + } + }, + "clear_skipped": { + "name": "Clear skipped update", + "description": "Removes the skipped version marker from an update.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "update" + ] + } + ] + } + } + }, + "conversation": { + "process": { + "name": "Process", + "description": "Launches a conversation from a transcribed text.", + "fields": { + "text": { + "example": "Turn all lights on", + "required": true, + "selector": { + "text": null + }, + "name": "Text", + "description": "Transcribed text input." + }, + "language": { + "example": "NL", + "selector": { + "text": null + }, + "name": "Language", + "description": "Language of text. Defaults to server language." + }, + "agent_id": { + "example": "homeassistant", + "selector": { + "conversation_agent": null + }, + "name": "Agent", + "description": "Conversation agent to process your request. The conversation agent is the brains of your assistant. It processes the incoming text commands." + } + }, + "response": { + "optional": true + } + }, + "reload": { + "name": "", + "description": "", + "fields": {} + } + }, + "logbook": { + "log": { + "name": "Log", + "description": "Creates a custom entry in the logbook.", + "fields": { + "name": { + "required": true, + "example": "Kitchen", + "selector": { + "text": null + }, + "name": "Name", + "description": "Custom name for an entity, can be referenced using an \u0060entity_id\u0060." + }, + "message": { + "required": true, + "example": "is being used", + "selector": { + "text": null + }, + "name": "Message", + "description": "Message of the logbook entry." + }, + "entity_id": { + "selector": { + "entity": null + }, + "name": "Entity ID", + "description": "Entity to reference in the logbook entry." + }, + "domain": { + "example": "light", + "selector": { + "text": null + }, + "name": "Domain", + "description": "Determines which icon is used in the logbook entry. The icon illustrates the integration domain related to this logbook entry." + } + } + } + }, + "counter": { + "increment": { + "name": "Increment", + "description": "Increments a counter.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "counter" + ] + } + ] + } + }, + "decrement": { + "name": "Decrement", + "description": "Decrements a counter.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "counter" + ] + } + ] + } + }, + "reset": { + "name": "Reset", + "description": "Resets a counter.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "counter" + ] + } + ] + } + }, + "set_value": { + "name": "Set", + "description": "Sets the counter value.", + "fields": { + "value": { + "required": true, + "selector": { + "number": { + "min": 0, + "max": 9223372036854775807, + "mode": "box" + } + }, + "name": "Value", + "description": "The new counter value the entity should be set to." + } + }, + "target": { + "entity": [ + { + "domain": [ + "counter" + ] + } + ] + } + }, + "configure": { + "name": "", + "description": "", + "fields": {} + } + }, + "timer": { + "reload": { + "name": "", + "description": "", + "fields": {} + }, + "start": { + "name": "Start", + "description": "Starts a timer.", + "fields": { + "duration": { + "example": "00:01:00 or 60", + "selector": { + "text": null + }, + "name": "Duration", + "description": "Duration the timer requires to finish. [optional]." + } + }, + "target": { + "entity": [ + { + "domain": [ + "timer" + ] + } + ] + } + }, + "pause": { + "name": "Pause", + "description": "Pauses a timer.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "timer" + ] + } + ] + } + }, + "cancel": { + "name": "Cancel", + "description": "Cancels a timer.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "timer" + ] + } + ] + } + }, + "finish": { + "name": "Finish", + "description": "Finishes a timer.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "timer" + ] + } + ] + } + }, + "change": { + "name": "Change", + "description": "Changes a timer.", + "fields": { + "duration": { + "default": 0, + "required": true, + "example": "00:01:00, 60 or -60", + "selector": { + "text": null + }, + "name": "Duration", + "description": "Duration to add or subtract to the running timer." + } + }, + "target": { + "entity": [ + { + "domain": [ + "timer" + ] + } + ] + } + } + }, + "scene": { + "reload": { + "name": "Reload", + "description": "Reloads the scenes from the YAML-configuration.", + "fields": {} + }, + "apply": { + "name": "Apply", + "description": "Activates a scene with configuration.", + "fields": { + "entities": { + "required": true, + "example": "light.kitchen: \u0022on\u0022\nlight.ceiling:\n state: \u0022on\u0022\n brightness: 80\n", + "selector": { + "object": null + }, + "name": "Entities state", + "description": "List of entities and their target state." + }, + "transition": { + "selector": { + "number": { + "min": 0, + "max": 300, + "unit_of_measurement": "seconds" + } + }, + "name": "Transition", + "description": "Time it takes the devices to transition into the states defined in the scene." + } + } + }, + "create": { + "name": "Create", + "description": "Creates a new scene.", + "fields": { + "scene_id": { + "required": true, + "example": "all_lights", + "selector": { + "text": null + }, + "name": "Scene entity ID", + "description": "The entity ID of the new scene." + }, + "entities": { + "example": "light.tv_back_light: \u0022on\u0022\nlight.ceiling:\n state: \u0022on\u0022\n brightness: 200\n", + "selector": { + "object": null + }, + "name": "Entities state", + "description": "List of entities and their target state. If your entities are already in the target state right now, use \u0060snapshot_entities\u0060 instead." + }, + "snapshot_entities": { + "example": "- light.ceiling\n- light.kitchen\n", + "selector": { + "object": null + }, + "name": "Snapshot entities", + "description": "List of entities to be included in the snapshot. By taking a snapshot, you record the current state of those entities. If you do not want to use the current state of all your entities for this scene, you can combine the \u0060snapshot_entities\u0060 with \u0060entities\u0060." + } + } + }, + "turn_on": { + "name": "Activate", + "description": "Activates a scene.", + "fields": { + "transition": { + "selector": { + "number": { + "min": 0, + "max": 300, + "unit_of_measurement": "seconds" + } + }, + "name": "Transition", + "description": "Time it takes the devices to transition into the states defined in the scene." + } + }, + "target": { + "entity": [ + { + "domain": [ + "scene" + ] + } + ] + } + } + }, + "script": { + "reload": { + "name": "Reload", + "description": "Reloads all the available scripts.", + "fields": {} + }, + "turn_on": { + "name": "Turn on", + "description": "Runs the sequence of actions defined in a script.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "script" + ] + } + ] + } + }, + "turn_off": { + "name": "Turn off", + "description": "Stops a running script.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "script" + ] + } + ] + } + }, + "toggle": { + "name": "Toggle", + "description": "Toggle a script. Starts it, if isn\u0027t running, stops it otherwise.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "script" + ] + } + ] + } + } + }, + "automation": { + "trigger": { + "name": "Trigger", + "description": "Triggers the actions of an automation.", + "fields": { + "skip_condition": { + "default": true, + "selector": { + "boolean": null + }, + "name": "Skip conditions", + "description": "Defines whether or not the conditions will be skipped." + } + }, + "target": { + "entity": [ + { + "domain": [ + "automation" + ] + } + ] + } + }, + "toggle": { + "name": "Toggle", + "description": "Toggles (enable / disable) an automation.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "automation" + ] + } + ] + } + }, + "turn_on": { + "name": "Turn on", + "description": "Enables an automation.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "automation" + ] + } + ] + } + }, + "turn_off": { + "name": "Turn off", + "description": "Disables an automation.", + "fields": { + "stop_actions": { + "default": true, + "selector": { + "boolean": null + }, + "name": "Stop actions", + "description": "Stops currently running actions." + } + }, + "target": { + "entity": [ + { + "domain": [ + "automation" + ] + } + ] + } + }, + "reload": { + "name": "Reload", + "description": "Reloads the automation configuration.", + "fields": {} + } + }, + "input_text": { + "reload": { + "name": "Reload", + "description": "Reloads helpers from the YAML-configuration.", + "fields": {} + }, + "set_value": { + "name": "Set", + "description": "Sets the value.", + "fields": { + "value": { + "required": true, + "example": "This is an example text", + "selector": { + "text": null + }, + "name": "Value", + "description": "The target value." + } + }, + "target": { + "entity": [ + { + "domain": [ + "input_text" + ] + } + ] + } + } + }, + "input_select": { + "reload": { + "name": "Reload", + "description": "Reloads helpers from the YAML-configuration.", + "fields": {} + }, + "select_first": { + "name": "First", + "description": "Selects the first option.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "input_select" + ] + } + ] + } + }, + "select_last": { + "name": "Last", + "description": "Selects the last option.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "input_select" + ] + } + ] + } + }, + "select_next": { + "name": "Next", + "description": "Select the next option.", + "fields": { + "cycle": { + "default": true, + "selector": { + "boolean": null + }, + "name": "Cycle", + "description": "If the option should cycle from the last to the first option on the list." + } + }, + "target": { + "entity": [ + { + "domain": [ + "input_select" + ] + } + ] + } + }, + "select_option": { + "name": "Select", + "description": "Selects an option.", + "fields": { + "option": { + "required": true, + "example": "\u0022Item A\u0022", + "selector": { + "text": null + }, + "name": "Option", + "description": "Option to be selected." + } + }, + "target": { + "entity": [ + { + "domain": [ + "input_select" + ] + } + ] + } + }, + "select_previous": { + "name": "Previous", + "description": "Selects the previous option.", + "fields": { + "cycle": { + "default": true, + "selector": { + "boolean": null + }, + "name": "Cycle", + "description": "If the option should cycle from the last to the first option on the list." + } + }, + "target": { + "entity": [ + { + "domain": [ + "input_select" + ] + } + ] + } + }, + "set_options": { + "name": "Set options", + "description": "Sets the options.", + "fields": { + "options": { + "required": true, + "example": "[\u0022Item A\u0022, \u0022Item B\u0022, \u0022Item C\u0022]", + "selector": { + "object": null + }, + "name": "Options", + "description": "List of options." + } + }, + "target": { + "entity": [ + { + "domain": [ + "input_select" + ] + } + ] + } + } + }, + "zone": { + "reload": { + "name": "Reload", + "description": "Reloads zones from the YAML-configuration.", + "fields": {} + } + }, + "google_assistant": { + "request_sync": { + "name": "Request sync", + "description": "Sends a request_sync command to Google.", + "fields": { + "agent_user_id": { + "selector": { + "text": null + }, + "name": "Agent user ID", + "description": "Only needed for automations. Specific Home Assistant user id (not username, ID in configuration \u003E users \u003E under username) to sync with Google Assistant. Do not need when you call this service through Home Assistant front end or API. Used in automation script or other place where context.user_id is missing." + } + } + } + }, + "input_button": { + "reload": { + "name": "", + "description": "", + "fields": {} + }, + "press": { + "name": "Press", + "description": "Mimics the physical button press on the device.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "input_button" + ] + } + ] + } + } + }, + "input_boolean": { + "reload": { + "name": "Reload", + "description": "Reloads helpers from the YAML-configuration.", + "fields": {} + }, + "turn_on": { + "name": "Turn on", + "description": "Turns on the helper.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "input_boolean" + ] + } + ] + } + }, + "turn_off": { + "name": "Turn off", + "description": "Turns off the helper.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "input_boolean" + ] + } + ] + } + }, + "toggle": { + "name": "Toggle", + "description": "Toggles the helper on/off.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "input_boolean" + ] + } + ] + } + } + }, + "input_number": { + "reload": { + "name": "Reload", + "description": "Reloads helpers from the YAML-configuration.", + "fields": {} + }, + "set_value": { + "name": "Set", + "description": "Sets the value.", + "fields": { + "value": { + "required": true, + "selector": { + "number": { + "min": 0, + "max": 9223372036854775807, + "step": 0.001, + "mode": "box" + } + }, + "name": "Value", + "description": "The target value." + } + }, + "target": { + "entity": [ + { + "domain": [ + "input_number" + ] + } + ] + } + }, + "increment": { + "name": "Increment", + "description": "Increments the value by 1 step.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "input_number" + ] + } + ] + } + }, + "decrement": { + "name": "Decrement", + "description": "Decrements the current value by 1 step.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "input_number" + ] + } + ] + } + } + }, + "netdaemon": { + "register_service": { + "name": "", + "description": "Register a new service for netdaemon, used by the daemon and not to be used by users", + "fields": { + "service": { + "description": "The name of the service to register" + }, + "class": { + "description": "The class that implements the service call" + }, + "method": { + "description": "The method to call" + } + } + }, + "reload_apps": { + "name": "", + "description": "", + "fields": {} + }, + "entity_create": { + "name": "", + "description": "Create an entity", + "fields": { + "entity_id": { + "description": "The entity ID of the entity", + "example": "sensor.awesome" + }, + "state": { + "description": "The state of the entity", + "example": "Lorem ipsum" + }, + "icon": { + "description": "The icon for the entity", + "example": "mdi:rocket-launch-outline" + }, + "unit": { + "description": "The unit of measurement for the entity" + }, + "options": { + "description": "List of options for a select entity" + }, + "attributes": { + "description": "The attributes of the entity" + } + } + }, + "entity_update": { + "name": "", + "description": "Update an entity", + "fields": { + "entity_id": { + "description": "The entity ID of the entity", + "example": "sensor.awesome" + }, + "state": { + "description": "The state of the entity", + "example": "Lorem ipsum" + }, + "icon": { + "description": "The icon for the entity", + "example": "mdi:rocket-launch-outline" + }, + "unit": { + "description": "The unit of measurement for the entity" + }, + "options": { + "description": "List of options for a select entity" + }, + "attributes": { + "description": "The attributes of the entity" + } + } + }, + "entity_remove": { + "name": "", + "description": "Remove an entity", + "fields": { + "entity_id": { + "description": "The entity ID of the entity", + "example": "sensor.awesome" + } + } + } + }, + "button": { + "press": { + "name": "Press", + "description": "Press the button entity.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "button" + ] + } + ] + } + } + }, + "schedule": { + "reload": { + "name": "Reload", + "description": "Reloads schedules from the YAML-configuration.", + "fields": {} + } + }, + "input_datetime": { + "reload": { + "name": "Reload", + "description": "Reloads helpers from the YAML-configuration.", + "fields": {} + }, + "set_datetime": { + "name": "Set", + "description": "Sets the date and/or time.", + "fields": { + "date": { + "example": "\u00222019-04-20\u0022", + "selector": { + "text": null + }, + "name": "Date", + "description": "The target date." + }, + "time": { + "example": "\u002205:04:20\u0022", + "selector": { + "time": null + }, + "name": "Time", + "description": "The target time." + }, + "datetime": { + "example": "\u00222019-04-20 05:04:20\u0022", + "selector": { + "text": null + }, + "name": "Date \u0026 time", + "description": "The target date \u0026 time." + }, + "timestamp": { + "selector": { + "number": { + "min": 0, + "max": 9223372036854775807, + "mode": "box" + } + }, + "name": "Timestamp", + "description": "The target date \u0026 time, expressed by a UNIX timestamp." + } + }, + "target": { + "entity": [ + { + "domain": [ + "input_datetime" + ] + } + ] + } + } + }, + "select": { + "select_first": { + "name": "First", + "description": "Selects the first option.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "select" + ] + } + ] + } + }, + "select_last": { + "name": "Last", + "description": "Selects the last option.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "select" + ] + } + ] + } + }, + "select_next": { + "name": "Next", + "description": "Selects the next option.", + "fields": { + "cycle": { + "default": true, + "selector": { + "boolean": null + }, + "name": "Cycle", + "description": "If the option should cycle from the last to the first." + } + }, + "target": { + "entity": [ + { + "domain": [ + "select" + ] + } + ] + } + }, + "select_option": { + "name": "Select", + "description": "Selects an option.", + "fields": { + "option": { + "required": true, + "example": "\u0022Item A\u0022", + "selector": { + "text": null + }, + "name": "Option", + "description": "Option to be selected." + } + }, + "target": { + "entity": [ + { + "domain": [ + "select" + ] + } + ] + } + }, + "select_previous": { + "name": "Previous", + "description": "Selects the previous option.", + "fields": { + "cycle": { + "default": true, + "selector": { + "boolean": null + }, + "name": "Cycle", + "description": "If the option should cycle from the first to the last." + } + }, + "target": { + "entity": [ + { + "domain": [ + "select" + ] + } + ] + } + } + }, + "climate": { + "turn_on": { + "name": "Turn on", + "description": "Turns climate device on.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "climate" + ] + } + ] + } + }, + "turn_off": { + "name": "Turn off", + "description": "Turns climate device off.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "climate" + ] + } + ] + } + }, + "set_hvac_mode": { + "name": "Set HVAC mode", + "description": "Sets HVAC operation mode.", + "fields": { + "hvac_mode": { + "selector": { + "select": { + "options": [ + "off", + "auto", + "cool", + "dry", + "fan_only", + "heat_cool", + "heat" + ], + "translation_key": "hvac_mode" + } + }, + "name": "HVAC mode", + "description": "HVAC operation mode." + } + }, + "target": { + "entity": [ + { + "domain": [ + "climate" + ] + } + ] + } + }, + "set_preset_mode": { + "name": "Set preset mode", + "description": "Sets preset mode.", + "fields": { + "preset_mode": { + "required": true, + "example": "away", + "selector": { + "text": null + }, + "name": "Preset mode", + "description": "Preset mode." + } + }, + "target": { + "entity": [ + { + "domain": [ + "climate" + ], + "supported_features": [ + 16 + ] + } + ] + } + }, + "set_aux_heat": { + "name": "Turn on/off auxiliary heater", + "description": "Turns auxiliary heater on/off.", + "fields": { + "aux_heat": { + "required": true, + "selector": { + "boolean": null + }, + "name": "Auxiliary heating", + "description": "New value of auxiliary heater." + } + }, + "target": { + "entity": [ + { + "domain": [ + "climate" + ], + "supported_features": [ + 64 + ] + } + ] + } + }, + "set_temperature": { + "name": "Set target temperature", + "description": "Sets target temperature.", + "fields": { + "temperature": { + "filter": { + "supported_features": [ + 1 + ] + }, + "selector": { + "number": { + "min": 0, + "max": 250, + "step": 0.1, + "mode": "box" + } + }, + "name": "Temperature", + "description": "Target temperature." + }, + "target_temp_high": { + "filter": { + "supported_features": [ + 2 + ] + }, + "advanced": true, + "selector": { + "number": { + "min": 0, + "max": 250, + "step": 0.1, + "mode": "box" + } + }, + "name": "Target temperature high", + "description": "High target temperature." + }, + "target_temp_low": { + "filter": { + "supported_features": [ + 2 + ] + }, + "advanced": true, + "selector": { + "number": { + "min": 0, + "max": 250, + "step": 0.1, + "mode": "box" + } + }, + "name": "Target temperature low", + "description": "Low target temperature." + }, + "hvac_mode": { + "selector": { + "select": { + "options": [ + "off", + "auto", + "cool", + "dry", + "fan_only", + "heat_cool", + "heat" + ], + "translation_key": "hvac_mode" + } + }, + "name": "HVAC mode", + "description": "HVAC operation mode." + } + }, + "target": { + "entity": [ + { + "domain": [ + "climate" + ], + "supported_features": [ + 1, + 2 + ] + } + ] + } + }, + "set_humidity": { + "name": "Set target humidity", + "description": "Sets target humidity.", + "fields": { + "humidity": { + "required": true, + "selector": { + "number": { + "min": 30, + "max": 99, + "unit_of_measurement": "%" + } + }, + "name": "Humidity", + "description": "Target humidity." + } + }, + "target": { + "entity": [ + { + "domain": [ + "climate" + ], + "supported_features": [ + 4 + ] + } + ] + } + }, + "set_fan_mode": { + "name": "Set fan mode", + "description": "Sets fan operation mode.", + "fields": { + "fan_mode": { + "required": true, + "example": "low", + "selector": { + "text": null + }, + "name": "Fan mode", + "description": "Fan operation mode." + } + }, + "target": { + "entity": [ + { + "domain": [ + "climate" + ], + "supported_features": [ + 8 + ] + } + ] + } + }, + "set_swing_mode": { + "name": "Set swing mode", + "description": "Sets swing operation mode.", + "fields": { + "swing_mode": { + "required": true, + "example": "horizontal", + "selector": { + "text": null + }, + "name": "Swing mode", + "description": "Swing operation mode." + } + }, + "target": { + "entity": [ + { + "domain": [ + "climate" + ], + "supported_features": [ + 32 + ] + } + ] + } + } + }, + "switch": { + "turn_off": { + "name": "Turn off", + "description": "Turns a switch off.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "switch" + ] + } + ] + } + }, + "turn_on": { + "name": "Turn on", + "description": "Turns a switch on.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "switch" + ] + } + ] + } + }, + "toggle": { + "name": "Toggle", + "description": "Toggles a switch on/off.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "switch" + ] + } + ] + } + } + }, + "media_player": { + "turn_on": { + "name": "Turn on", + "description": "Turns on the power of the media player.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 128 + ] + } + ] + } + }, + "turn_off": { + "name": "Turn off", + "description": "Turns off the power of the media player.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 256 + ] + } + ] + } + }, + "toggle": { + "name": "Toggle", + "description": "Toggles a media player on/off.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 384 + ] + } + ] + } + }, + "volume_up": { + "name": "Turn up volume", + "description": "Turns up the volume.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 4, + 1024 + ] + } + ] + } + }, + "volume_down": { + "name": "Turn down volume", + "description": "Turns down the volume.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 4, + 1024 + ] + } + ] + } + }, + "media_play_pause": { + "name": "Play/Pause", + "description": "Toggles play/pause.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 16385 + ] + } + ] + } + }, + "media_play": { + "name": "Play", + "description": "Starts playing.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 16384 + ] + } + ] + } + }, + "media_pause": { + "name": "Pause", + "description": "Pauses.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 1 + ] + } + ] + } + }, + "media_stop": { + "name": "Stop", + "description": "Stops playing.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 4096 + ] + } + ] + } + }, + "media_next_track": { + "name": "Next", + "description": "Selects the next track.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 32 + ] + } + ] + } + }, + "media_previous_track": { + "name": "Previous", + "description": "Selects the previous track.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 16 + ] + } + ] + } + }, + "clear_playlist": { + "name": "Clear playlist", + "description": "Clears the playlist.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 8192 + ] + } + ] + } + }, + "volume_set": { + "name": "Set volume", + "description": "Sets the volume level.", + "fields": { + "volume_level": { + "required": true, + "selector": { + "number": { + "min": 0, + "max": 1, + "step": 0.01 + } + }, + "name": "Level", + "description": "The volume. 0 is inaudible, 1 is the maximum volume." + } + }, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 4 + ] + } + ] + } + }, + "volume_mute": { + "name": "Mute/unmute volume", + "description": "Mutes or unmutes the media player.", + "fields": { + "is_volume_muted": { + "required": true, + "selector": { + "boolean": null + }, + "name": "Muted", + "description": "Defines whether or not it is muted." + } + }, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 8 + ] + } + ] + } + }, + "media_seek": { + "name": "Seek", + "description": "Allows you to go to a different part of the media that is currently playing.", + "fields": { + "seek_position": { + "required": true, + "selector": { + "number": { + "min": 0, + "max": 9223372036854775807, + "step": 0.01, + "mode": "box" + } + }, + "name": "Position", + "description": "Target position in the currently playing media. The format is platform dependent." + } + }, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 2 + ] + } + ] + } + }, + "join": { + "name": "Join", + "description": "Groups media players together for synchronous playback. Only works on supported multiroom audio systems.", + "fields": { + "group_members": { + "required": true, + "example": "- media_player.multiroom_player2\n- media_player.multiroom_player3\n", + "selector": { + "entity": { + "multiple": true, + "domain": "media_player" + } + }, + "name": "Group members", + "description": "The players which will be synced with the playback specified in \u0060target\u0060." + } + }, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 524288 + ] + } + ] + } + }, + "select_source": { + "name": "Select source", + "description": "Sends the media player the command to change input source.", + "fields": { + "source": { + "required": true, + "example": "video1", + "selector": { + "text": null + }, + "name": "Source", + "description": "Name of the source to switch to. Platform dependent." + } + }, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 2048 + ] + } + ] + } + }, + "select_sound_mode": { + "name": "Select sound mode", + "description": "Selects a specific sound mode.", + "fields": { + "sound_mode": { + "example": "Music", + "selector": { + "text": null + }, + "name": "Sound mode", + "description": "Name of the sound mode to switch to." + } + }, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 65536 + ] + } + ] + } + }, + "play_media": { + "name": "Play media", + "description": "Starts playing specified media.", + "fields": { + "media_content_id": { + "required": true, + "example": "https://home-assistant.io/images/cast/splash.png", + "selector": { + "text": null + }, + "name": "Content ID", + "description": "The ID of the content to play. Platform dependent." + }, + "media_content_type": { + "required": true, + "example": "music", + "selector": { + "text": null + }, + "name": "Content type", + "description": "The type of the content to play. Such as image, music, tv show, video, episode, channel, or playlist." + }, + "enqueue": { + "filter": { + "supported_features": [ + 2097152 + ] + }, + "required": false, + "selector": { + "select": { + "options": [ + "play", + "next", + "add", + "replace" + ], + "translation_key": "enqueue" + } + }, + "name": "Enqueue", + "description": "If the content should be played now or be added to the queue." + }, + "announce": { + "filter": { + "supported_features": [ + 1048576 + ] + }, + "required": false, + "example": "true", + "selector": { + "boolean": null + }, + "name": "Announce", + "description": "If the media should be played as an announcement." + } + }, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 512 + ] + } + ] + } + }, + "shuffle_set": { + "name": "Shuffle", + "description": "Playback mode that selects the media in randomized order.", + "fields": { + "shuffle": { + "required": true, + "selector": { + "boolean": null + }, + "name": "Shuffle", + "description": "Whether or not shuffle mode is enabled." + } + }, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 32768 + ] + } + ] + } + }, + "unjoin": { + "name": "Unjoin", + "description": "Removes the player from a group. Only works on platforms which support player groups.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 524288 + ] + } + ] + } + }, + "repeat_set": { + "name": "Repeat", + "description": "Playback mode that plays the media in a loop.", + "fields": { + "repeat": { + "required": true, + "selector": { + "select": { + "options": [ + "off", + "all", + "one" + ], + "translation_key": "repeat" + } + }, + "name": "Repeat mode", + "description": "Repeat mode to set." + } + }, + "target": { + "entity": [ + { + "domain": [ + "media_player" + ], + "supported_features": [ + 262144 + ] + } + ] + } + } + }, + "mqtt": { + "publish": { + "name": "Publish", + "description": "Publishes a message to an MQTT topic.", + "fields": { + "topic": { + "required": true, + "example": "/homeassistant/hello", + "selector": { + "text": null + }, + "name": "Topic", + "description": "Topic to publish to." + }, + "payload": { + "example": "This is great", + "selector": { + "text": null + }, + "name": "Payload", + "description": "The payload to publish." + }, + "payload_template": { + "advanced": true, + "example": "{{ states(\u0027sensor.temperature\u0027) }}", + "selector": { + "object": null + }, + "name": "Payload template", + "description": "Template to render as a payload value. If a payload is provided, the template is ignored." + }, + "qos": { + "advanced": true, + "default": 0, + "selector": { + "select": { + "options": [ + "0", + "1", + "2" + ] + } + }, + "name": "QoS", + "description": "Quality of Service to use. O. At most once. 1: At least once. 2: Exactly once." + }, + "retain": { + "default": false, + "selector": { + "boolean": null + }, + "name": "Retain", + "description": "If the message should have the retain flag set. If set, the broker stores the most recent message on a topic." + } + } + }, + "dump": { + "name": "Export", + "description": "Writes all messages on a specific topic into the \u0060mqtt_dump.txt\u0060 file in your configuration folder.", + "fields": { + "topic": { + "example": "OpenZWave/#", + "selector": { + "text": null + }, + "name": "Topic", + "description": "Topic to listen to." + }, + "duration": { + "default": 5, + "selector": { + "number": { + "min": 1, + "max": 300, + "unit_of_measurement": "seconds" + } + }, + "name": "Duration", + "description": "How long we should listen for messages in seconds." + } + } + }, + "reload": { + "name": "Reload", + "description": "Reloads MQTT entities from the YAML-configuration.", + "fields": {} + } + }, + "camera": { + "enable_motion_detection": { + "name": "Enable motion detection", + "description": "Enables the motion detection.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "camera" + ] + } + ] + } + }, + "disable_motion_detection": { + "name": "Disable motion detection", + "description": "Disables the motion detection.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "camera" + ] + } + ] + } + }, + "turn_off": { + "name": "Turn off", + "description": "Turns off the camera.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "camera" + ] + } + ] + } + }, + "turn_on": { + "name": "Turn on", + "description": "Turns on the camera.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "camera" + ] + } + ] + } + }, + "snapshot": { + "name": "Take snapshot", + "description": "Takes a snapshot from a camera.", + "fields": { + "filename": { + "required": true, + "example": "/tmp/snapshot_{{ entity_id.name }}.jpg", + "selector": { + "text": null + }, + "name": "Filename", + "description": "Template of a filename. Variable available is \u0060entity_id\u0060." + } + }, + "target": { + "entity": [ + { + "domain": [ + "camera" + ] + } + ] + } + }, + "play_stream": { + "name": "Play stream", + "description": "Plays the camera stream on a supported media player.", + "fields": { + "media_player": { + "required": true, + "selector": { + "entity": { + "domain": "media_player" + } + }, + "name": "Media player", + "description": "Media players to stream to." + }, + "format": { + "default": "hls", + "selector": { + "select": { + "options": [ + "hls" + ] + } + }, + "name": "Format", + "description": "Stream format supported by the media player." + } + }, + "target": { + "entity": [ + { + "domain": [ + "camera" + ] + } + ] + } + }, + "record": { + "name": "Record", + "description": "Creates a recording of a live camera feed.", + "fields": { + "filename": { + "required": true, + "example": "/tmp/snapshot_{{ entity_id.name }}.mp4", + "selector": { + "text": null + }, + "name": "Filename", + "description": "Template of a filename. Variable available is \u0060entity_id\u0060. Must be mp4." + }, + "duration": { + "default": 30, + "selector": { + "number": { + "min": 1, + "max": 3600, + "unit_of_measurement": "seconds" + } + }, + "name": "Duration", + "description": "Planned duration of the recording. The actual duration may vary." + }, + "lookback": { + "default": 0, + "selector": { + "number": { + "min": 0, + "max": 300, + "unit_of_measurement": "seconds" + } + }, + "name": "Lookback", + "description": "Planned lookback period to include in the recording (in addition to the duration). Only available if there is currently an active HLS stream. The actual length of the lookback period may vary." + } + }, + "target": { + "entity": [ + { + "domain": [ + "camera" + ] + } + ] + } + } + }, + "rest": { + "reload": { + "name": "Reload", + "description": "Reloads REST entities from the YAML-configuration.", + "fields": {} + } + }, + "cover": { + "open_cover": { + "name": "Open", + "description": "Opens a cover.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "cover" + ], + "supported_features": [ + 1 + ] + } + ] + } + }, + "close_cover": { + "name": "Close", + "description": "Closes a cover.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "cover" + ], + "supported_features": [ + 2 + ] + } + ] + } + }, + "set_cover_position": { + "name": "Set position", + "description": "Moves a cover to a specific position.", + "fields": { + "position": { + "required": true, + "selector": { + "number": { + "min": 0, + "max": 100, + "unit_of_measurement": "%" + } + }, + "name": "Position", + "description": "Target position." + } + }, + "target": { + "entity": [ + { + "domain": [ + "cover" + ], + "supported_features": [ + 4 + ] + } + ] + } + }, + "stop_cover": { + "name": "Stop", + "description": "Stops the cover movement.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "cover" + ], + "supported_features": [ + 8 + ] + } + ] + } + }, + "toggle": { + "name": "Toggle", + "description": "Toggles a cover open/closed.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "cover" + ], + "supported_features": [ + 3 + ] + } + ] + } + }, + "open_cover_tilt": { + "name": "Open tilt", + "description": "Tilts a cover open.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "cover" + ], + "supported_features": [ + 16 + ] + } + ] + } + }, + "close_cover_tilt": { + "name": "Close tilt", + "description": "Tilts a cover to close.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "cover" + ], + "supported_features": [ + 32 + ] + } + ] + } + }, + "stop_cover_tilt": { + "name": "Stop tilt", + "description": "Stops a tilting cover movement.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "cover" + ], + "supported_features": [ + 64 + ] + } + ] + } + }, + "set_cover_tilt_position": { + "name": "Set tilt position", + "description": "Moves a cover tilt to a specific position.", + "fields": { + "tilt_position": { + "required": true, + "selector": { + "number": { + "min": 0, + "max": 100, + "unit_of_measurement": "%" + } + }, + "name": "Tilt position", + "description": "Target tilt positition." + } + }, + "target": { + "entity": [ + { + "domain": [ + "cover" + ], + "supported_features": [ + 128 + ] + } + ] + } + }, + "toggle_cover_tilt": { + "name": "Toggle tilt", + "description": "Toggles a cover tilt open/closed.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "cover" + ], + "supported_features": [ + 48 + ] + } + ] + } + } + }, + "device_tracker": { + "see": { + "name": "See", + "description": "Records a seen tracked device.", + "fields": { + "mac": { + "example": "FF:FF:FF:FF:FF:FF", + "selector": { + "text": null + }, + "name": "MAC address", + "description": "MAC address of the device." + }, + "dev_id": { + "example": "phonedave", + "selector": { + "text": null + }, + "name": "Device ID", + "description": "ID of the device (find the ID in \u0060known_devices.yaml\u0060)." + }, + "host_name": { + "example": "Dave", + "selector": { + "text": null + }, + "name": "Hostname", + "description": "Hostname of the device." + }, + "location_name": { + "example": "home", + "selector": { + "text": null + }, + "name": "Location", + "description": "Name of the location where the device is located. The options are: \u0060home\u0060, \u0060not_home\u0060, or the name of the zone." + }, + "gps": { + "example": "[51.509802, -0.086692]", + "selector": { + "object": null + }, + "name": "GPS coordinates", + "description": "GPS coordinates where the device is located, specified by latitude and longitude (for example: [51.513845, -0.100539])." + }, + "gps_accuracy": { + "selector": { + "number": { + "min": 1, + "max": 100, + "unit_of_measurement": "%" + } + }, + "name": "GPS accuracy", + "description": "Accuracy of the GPS coordinates." + }, + "battery": { + "selector": { + "number": { + "min": 0, + "max": 100, + "unit_of_measurement": "%" + } + }, + "name": "Battery level", + "description": "Battery level of the device." + } + } + } + }, + "alarm_control_panel": { + "alarm_disarm": { + "name": "Disarm", + "description": "Disarms the alarm.", + "fields": { + "code": { + "example": "1234", + "selector": { + "text": null + }, + "name": "Code", + "description": "Code to disarm the alarm." + } + }, + "target": { + "entity": [ + { + "domain": [ + "alarm_control_panel" + ] + } + ] + } + }, + "alarm_arm_home": { + "name": "Arm home", + "description": "Sets the alarm to: _armed, but someone is home_.", + "fields": { + "code": { + "example": "1234", + "selector": { + "text": null + }, + "name": "Code", + "description": "Code to arm the alarm." + } + }, + "target": { + "entity": [ + { + "domain": [ + "alarm_control_panel" + ], + "supported_features": [ + 1 + ] + } + ] + } + }, + "alarm_arm_away": { + "name": "Arm away", + "description": "Sets the alarm to: _armed, no one home_.", + "fields": { + "code": { + "example": "1234", + "selector": { + "text": null + }, + "name": "Code", + "description": "Code to arm the alarm." + } + }, + "target": { + "entity": [ + { + "domain": [ + "alarm_control_panel" + ], + "supported_features": [ + 2 + ] + } + ] + } + }, + "alarm_arm_night": { + "name": "Arm night", + "description": "Sets the alarm to: _armed for the night_.", + "fields": { + "code": { + "example": "1234", + "selector": { + "text": null + }, + "name": "Code", + "description": "Code to arm the alarm." + } + }, + "target": { + "entity": [ + { + "domain": [ + "alarm_control_panel" + ], + "supported_features": [ + 4 + ] + } + ] + } + }, + "alarm_arm_vacation": { + "name": "Arm vacation", + "description": "Sets the alarm to: _armed for vacation_.", + "fields": { + "code": { + "example": "1234", + "selector": { + "text": null + }, + "name": "Code", + "description": "Code to arm the alarm." + } + }, + "target": { + "entity": [ + { + "domain": [ + "alarm_control_panel" + ], + "supported_features": [ + 32 + ] + } + ] + } + }, + "alarm_arm_custom_bypass": { + "name": "Arm with custom bypass", + "description": "Arms the alarm while allowing to bypass a custom area.", + "fields": { + "code": { + "example": "1234", + "selector": { + "text": null + }, + "name": "Code", + "description": "Code to arm the alarm." + } + }, + "target": { + "entity": [ + { + "domain": [ + "alarm_control_panel" + ], + "supported_features": [ + 16 + ] + } + ] + } + }, + "alarm_trigger": { + "name": "Trigger", + "description": "Enables an external alarm trigger.", + "fields": { + "code": { + "example": "1234", + "selector": { + "text": null + }, + "name": "Code", + "description": "Code to arm the alarm." + } + }, + "target": { + "entity": [ + { + "domain": [ + "alarm_control_panel" + ], + "supported_features": [ + 8 + ] + } + ] + } + } + }, + "fan": { + "turn_on": { + "name": "Turn on", + "description": "Turns fan on.", + "fields": { + "percentage": { + "filter": { + "supported_features": [ + 1 + ] + }, + "selector": { + "number": { + "min": 0, + "max": 100, + "unit_of_measurement": "%" + } + }, + "name": "Percentage", + "description": "Speed of the fan." + }, + "preset_mode": { + "example": "auto", + "filter": { + "supported_features": [ + 8 + ] + }, + "selector": { + "text": null + }, + "name": "Preset mode", + "description": "Preset mode." + } + }, + "target": { + "entity": [ + { + "domain": [ + "fan" + ] + } + ] + } + }, + "turn_off": { + "name": "Turn off", + "description": "Turns fan off.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "fan" + ] + } + ] + } + }, + "toggle": { + "name": "Toggle", + "description": "Toggles the fan on/off.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "fan" + ] + } + ] + } + }, + "increase_speed": { + "name": "Increase speed", + "description": "Increases the speed of the fan.", + "fields": { + "percentage_step": { + "advanced": true, + "required": false, + "selector": { + "number": { + "min": 0, + "max": 100, + "unit_of_measurement": "%" + } + }, + "name": "Increment", + "description": "Increases the speed by a percentage step." + } + }, + "target": { + "entity": [ + { + "domain": [ + "fan" + ], + "supported_features": [ + 1 + ] + } + ] + } + }, + "decrease_speed": { + "name": "Decrease speed", + "description": "Decreases the speed of the fan.", + "fields": { + "percentage_step": { + "advanced": true, + "required": false, + "selector": { + "number": { + "min": 0, + "max": 100, + "unit_of_measurement": "%" + } + }, + "name": "Decrement", + "description": "Decreases the speed by a percentage step." + } + }, + "target": { + "entity": [ + { + "domain": [ + "fan" + ], + "supported_features": [ + 1 + ] + } + ] + } + }, + "oscillate": { + "name": "Oscillate", + "description": "Controls oscillatation of the fan.", + "fields": { + "oscillating": { + "required": true, + "selector": { + "boolean": null + }, + "name": "Oscillating", + "description": "Turn on/off oscillation." + } + }, + "target": { + "entity": [ + { + "domain": [ + "fan" + ], + "supported_features": [ + 2 + ] + } + ] + } + }, + "set_direction": { + "name": "Set direction", + "description": "Sets the fan rotation direction.", + "fields": { + "direction": { + "required": true, + "selector": { + "select": { + "options": [ + "forward", + "reverse" + ], + "translation_key": "direction" + } + }, + "name": "Direction", + "description": "Direction to rotate." + } + }, + "target": { + "entity": [ + { + "domain": [ + "fan" + ], + "supported_features": [ + 4 + ] + } + ] + } + }, + "set_percentage": { + "name": "Set speed", + "description": "Sets the fan speed.", + "fields": { + "percentage": { + "required": true, + "selector": { + "number": { + "min": 0, + "max": 100, + "unit_of_measurement": "%" + } + }, + "name": "Percentage", + "description": "Speed of the fan." + } + }, + "target": { + "entity": [ + { + "domain": [ + "fan" + ], + "supported_features": [ + 1 + ] + } + ] + } + }, + "set_preset_mode": { + "name": "Set preset mode", + "description": "Sets preset mode.", + "fields": { + "preset_mode": { + "required": true, + "example": "auto", + "selector": { + "text": null + }, + "name": "Preset mode", + "description": "Preset mode." + } + }, + "target": { + "entity": [ + { + "domain": [ + "fan" + ], + "supported_features": [ + 8 + ] + } + ] + } + } + }, + "lock": { + "unlock": { + "name": "Unlock", + "description": "Unlocks a lock.", + "fields": { + "code": { + "example": 1234, + "selector": { + "text": null + }, + "name": "Code", + "description": "Code used to unlock the lock." + } + }, + "target": { + "entity": [ + { + "domain": [ + "lock" + ] + } + ] + } + }, + "lock": { + "name": "Lock", + "description": "Locks a lock.", + "fields": { + "code": { + "example": 1234, + "selector": { + "text": null + }, + "name": "Code", + "description": "Code used to lock the lock." + } + }, + "target": { + "entity": [ + { + "domain": [ + "lock" + ] + } + ] + } + }, + "open": { + "name": "Open", + "description": "Opens a lock.", + "fields": { + "code": { + "example": 1234, + "selector": { + "text": null + }, + "name": "Code", + "description": "Code used to open the lock." + } + }, + "target": { + "entity": [ + { + "domain": [ + "lock" + ], + "supported_features": [ + 1 + ] + } + ] + } + } + }, + "number": { + "set_value": { + "name": "Set", + "description": "Sets the value of a number.", + "fields": { + "value": { + "example": 42, + "selector": { + "text": null + }, + "name": "Value", + "description": "The target value to set." + } + }, + "target": { + "entity": [ + { + "domain": [ + "number" + ] + } + ] + } + } + }, + "humidifier": { + "turn_on": { + "name": "Turn on", + "description": "Turns the humidifier on.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "humidifier" + ] + } + ] + } + }, + "turn_off": { + "name": "Turn off", + "description": "Turns the humidifier off.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "humidifier" + ] + } + ] + } + }, + "toggle": { + "name": "Toggle", + "description": "Toggles the humidifier on/off.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "humidifier" + ] + } + ] + } + }, + "set_mode": { + "name": "Set mode", + "description": "Sets the humidifier operation mode.", + "fields": { + "mode": { + "required": true, + "example": "away", + "selector": { + "text": null + }, + "name": "Mode", + "description": "Operation mode. For example, _normal_, _eco_, or _away_. For a list of possible values, refer to the integration documentation." + } + }, + "target": { + "entity": [ + { + "domain": [ + "humidifier" + ], + "supported_features": [ + 1 + ] + } + ] + } + }, + "set_humidity": { + "name": "Set humidity", + "description": "Sets the target humidity.", + "fields": { + "humidity": { + "required": true, + "selector": { + "number": { + "min": 0, + "max": 100, + "unit_of_measurement": "%" + } + }, + "name": "Humidity", + "description": "Target humidity." + } + }, + "target": { + "entity": [ + { + "domain": [ + "humidifier" + ] + } + ] + } + } + }, + "siren": { + "turn_on": { + "name": "Turn on", + "description": "Turns the siren on.", + "fields": { + "tone": { + "example": "fire", + "filter": { + "supported_features": [ + 4 + ] + }, + "required": false, + "selector": { + "text": null + }, + "name": "Tone", + "description": "The tone to emit. When \u0060available_tones\u0060 property is a map, either the key or the value can be used. Must be supported by the integration." + }, + "volume_level": { + "example": 0.5, + "filter": { + "supported_features": [ + 8 + ] + }, + "required": false, + "selector": { + "number": { + "min": 0, + "max": 1, + "step": 0.05 + } + }, + "name": "Volume", + "description": "The volume. 0 is inaudible, 1 is the maximum volume. Must be supported by the integration." + }, + "duration": { + "example": 15, + "filter": { + "supported_features": [ + 16 + ] + }, + "required": false, + "selector": { + "text": null + }, + "name": "Duration", + "description": "Number of seconds the sound is played. Must be supported by the integration." + } + }, + "target": { + "entity": [ + { + "domain": [ + "siren" + ], + "supported_features": [ + 1 + ] + } + ] + } + }, + "turn_off": { + "name": "Turn off", + "description": "Turns the siren off.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "siren" + ], + "supported_features": [ + 2 + ] + } + ] + } + }, + "toggle": { + "name": "Toggle", + "description": "Toggles the siren on/off.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "siren" + ], + "supported_features": [ + 3 + ] + } + ] + } + } + }, + "vacuum": { + "turn_on": { + "name": "Turn on", + "description": "Starts a new cleaning task.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "vacuum" + ], + "supported_features": [ + 1 + ] + } + ] + } + }, + "turn_off": { + "name": "Turn off", + "description": "Stops the current cleaning task and returns to its dock.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "vacuum" + ], + "supported_features": [ + 2 + ] + } + ] + } + }, + "toggle": { + "name": "", + "description": "", + "fields": {} + }, + "start_pause": { + "name": "Start/pause", + "description": "Starts, pauses, or resumes the cleaning task.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "vacuum" + ], + "supported_features": [ + 4 + ] + } + ] + } + }, + "start": { + "name": "Start", + "description": "Starts or resumes the cleaning task.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "vacuum" + ], + "supported_features": [ + 8192 + ] + } + ] + } + }, + "pause": { + "name": "Pause", + "description": "Pauses the cleaning task.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "vacuum" + ], + "supported_features": [ + 4 + ] + } + ] + } + }, + "return_to_base": { + "name": "Return to dock", + "description": "Tells the vacuum cleaner to return to its dock.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "vacuum" + ], + "supported_features": [ + 16 + ] + } + ] + } + }, + "clean_spot": { + "name": "Clean spot", + "description": "Tells the vacuum cleaner to do a spot clean-up.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "vacuum" + ] + } + ] + } + }, + "locate": { + "name": "Locate", + "description": "Locates the vacuum cleaner robot.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "vacuum" + ], + "supported_features": [ + 512 + ] + } + ] + } + }, + "stop": { + "name": "Stop", + "description": "Stops the current cleaning task.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "vacuum" + ], + "supported_features": [ + 8 + ] + } + ] + } + }, + "set_fan_speed": { + "name": "Set fan speed", + "description": "Sets the fan speed of the vacuum cleaner.", + "fields": { + "fan_speed": { + "required": true, + "example": "low", + "selector": { + "text": null + }, + "name": "Fan speed", + "description": "Fan speed. The value depends on the integration. Some integrations have speed steps, like \u0027medium\u0027. Some use a percentage, between 0 and 100." + } + }, + "target": { + "entity": [ + { + "domain": [ + "vacuum" + ] + } + ] + } + }, + "send_command": { + "name": "Send command", + "description": "Sends a command to the vacuum cleaner.", + "fields": { + "command": { + "required": true, + "example": "set_dnd_timer", + "selector": { + "text": null + }, + "name": "Command", + "description": "Command to execute. The commands are integration-specific." + }, + "params": { + "example": "{ \u0022key\u0022: \u0022value\u0022 }", + "selector": { + "object": null + }, + "name": "Parameters", + "description": "Parameters for the command. The parameters are integration-specific." + } + }, + "target": { + "entity": [ + { + "domain": [ + "vacuum" + ] + } + ] + } + } + }, + "water_heater": { + "turn_on": { + "name": "Turn on", + "description": "Turns water heater on.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "water_heater" + ] + } + ] + } + }, + "turn_off": { + "name": "Turn off", + "description": "Turns water heater off.", + "fields": {}, + "target": { + "entity": [ + { + "domain": [ + "water_heater" + ] + } + ] + } + }, + "set_away_mode": { + "name": "Set away mode", + "description": "Turns away mode on/off.", + "fields": { + "away_mode": { + "required": true, + "selector": { + "boolean": null + }, + "name": "Away mode", + "description": "New value of away mode." + } + }, + "target": { + "entity": [ + { + "domain": [ + "water_heater" + ] + } + ] + } + }, + "set_temperature": { + "name": "Set temperature", + "description": "Sets the target temperature.", + "fields": { + "temperature": { + "required": true, + "selector": { + "number": { + "min": 0, + "max": 100, + "step": 0.5, + "unit_of_measurement": "\u00B0" + } + }, + "name": "Temperature", + "description": "New target temperature for the water heater." + }, + "operation_mode": { + "example": "eco", + "selector": { + "text": null + }, + "name": "Operation mode", + "description": "New value of the operation mode. For a list of possible modes, refer to the integration documentation." + } + }, + "target": { + "entity": [ + { + "domain": [ + "water_heater" + ] + } + ] + } + }, + "set_operation_mode": { + "name": "Set operation mode", + "description": "Sets the operation mode.", + "fields": { + "operation_mode": { + "required": true, + "example": "eco", + "selector": { + "text": null + }, + "name": "Operation mode", + "description": "New value of the operation mode. For a list of possible modes, refer to the integration documentation." + } + }, + "target": { + "entity": [ + { + "domain": [ + "water_heater" + ] + } + ] + } + } + }, + "text": { + "set_value": { + "name": "Set value", + "description": "Sets the value.", + "fields": { + "value": { + "required": true, + "example": "Hello world!", + "selector": { + "text": null + }, + "name": "Value", + "description": "Enter your text." + } + }, + "target": { + "entity": [ + { + "domain": [ + "text" + ] + } + ] + } + } + }, + "light": { + "turn_on": { + "name": "Turn on", + "description": "Turn on one or more lights and adjust properties of the light, even when they are turned on already.", + "fields": { + "transition": { + "filter": { + "supported_features": [ + 32 + ] + }, + "selector": { + "number": { + "min": 0, + "max": 300, + "unit_of_measurement": "seconds" + } + }, + "name": "Transition", + "description": "Duration it takes to get to next state." + }, + "rgb_color": { + "filter": { + "attribute": { + "supported_color_modes": [ + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "selector": { + "color_rgb": null + }, + "name": "Color", + "description": "The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue." + }, + "rgbw_color": { + "filter": { + "attribute": { + "supported_color_modes": [ + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "example": "[255, 100, 100, 50]", + "selector": { + "object": null + }, + "name": "RGBW-color", + "description": "The color in RGBW format. A list of four integers between 0 and 255 representing the values of red, green, blue, and white." + }, + "rgbww_color": { + "filter": { + "attribute": { + "supported_color_modes": [ + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "example": "[255, 100, 100, 50, 70]", + "selector": { + "object": null + }, + "name": "RGBWW-color", + "description": "The color in RGBWW format. A list of five integers between 0 and 255 representing the values of red, green, blue, cold white, and warm white." + }, + "color_name": { + "filter": { + "attribute": { + "supported_color_modes": [ + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "selector": { + "select": { + "translation_key": "color_name", + "options": [ + "homeassistant", + "aliceblue", + "antiquewhite", + "aqua", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blue", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "fuchsia", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "gray", + "green", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "lime", + "limegreen", + "linen", + "magenta", + "maroon", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "navy", + "navyblue", + "oldlace", + "olive", + "olivedrab", + "orange", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "purple", + "red", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "silver", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "teal", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "white", + "whitesmoke", + "yellow", + "yellowgreen" + ] + } + }, + "name": "Color name", + "description": "A human-readable color name." + }, + "hs_color": { + "filter": { + "attribute": { + "supported_color_modes": [ + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "example": "[300, 70]", + "selector": { + "object": null + }, + "name": "Hue/Sat color", + "description": "Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100." + }, + "xy_color": { + "filter": { + "attribute": { + "supported_color_modes": [ + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "example": "[0.52, 0.43]", + "selector": { + "object": null + }, + "name": "XY-color", + "description": "Color in XY-format. A list of two decimal numbers between 0 and 1." + }, + "color_temp": { + "filter": { + "attribute": { + "supported_color_modes": [ + "color_temp", + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "selector": { + "color_temp": { + "min_mireds": 153, + "max_mireds": 500 + } + }, + "name": "Color temperature", + "description": "Color temperature in mireds." + }, + "kelvin": { + "filter": { + "attribute": { + "supported_color_modes": [ + "color_temp", + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "selector": { + "number": { + "min": 2000, + "max": 6500, + "step": 100, + "unit_of_measurement": "K" + } + }, + "name": "Color temperature", + "description": "Color temperature in Kelvin." + }, + "brightness": { + "filter": { + "attribute": { + "supported_color_modes": [ + "brightness", + "color_temp", + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "selector": { + "number": { + "min": 0, + "max": 255 + } + }, + "name": "Brightness value", + "description": "Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness." + }, + "brightness_pct": { + "filter": { + "attribute": { + "supported_color_modes": [ + "brightness", + "color_temp", + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "selector": { + "number": { + "min": 0, + "max": 100, + "unit_of_measurement": "%" + } + }, + "name": "Brightness", + "description": "Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness." + }, + "brightness_step": { + "filter": { + "attribute": { + "supported_color_modes": [ + "brightness", + "color_temp", + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "selector": { + "number": { + "min": -225, + "max": 255 + } + }, + "name": "Brightness step value", + "description": "Change brightness by an amount." + }, + "brightness_step_pct": { + "filter": { + "attribute": { + "supported_color_modes": [ + "brightness", + "color_temp", + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "selector": { + "number": { + "min": -100, + "max": 100, + "unit_of_measurement": "%" + } + }, + "name": "Brightness step", + "description": "Change brightness by a percentage." + }, + "white": { + "filter": { + "attribute": { + "supported_color_modes": [ + "white" + ] + } + }, + "advanced": true, + "selector": { + "constant": { + "value": true, + "label": "Enabled" + } + }, + "name": "White", + "description": "Set the light to white mode." + }, + "profile": { + "advanced": true, + "example": "relax", + "selector": { + "text": null + }, + "name": "Profile", + "description": "Name of a light profile to use." + }, + "flash": { + "filter": { + "supported_features": [ + 8 + ] + }, + "advanced": true, + "selector": { + "select": { + "options": [ + { + "label": "Long", + "value": "long" + }, + { + "label": "Short", + "value": "short" + } + ] + } + }, + "name": "Flash", + "description": "Tell light to flash, can be either value short or long." + }, + "effect": { + "filter": { + "supported_features": [ + 4 + ] + }, + "selector": { + "text": null + }, + "name": "Effect", + "description": "Light effect." + } + }, + "target": { + "entity": [ + { + "domain": [ + "light" + ] + } + ] + } + }, + "turn_off": { + "name": "Turn off", + "description": "Turn off one or more lights.", + "fields": { + "transition": { + "filter": { + "supported_features": [ + 32 + ] + }, + "selector": { + "number": { + "min": 0, + "max": 300, + "unit_of_measurement": "seconds" + } + }, + "name": "Transition", + "description": "Duration it takes to get to next state." + }, + "flash": { + "filter": { + "supported_features": [ + 8 + ] + }, + "advanced": true, + "selector": { + "select": { + "options": [ + { + "label": "Long", + "value": "long" + }, + { + "label": "Short", + "value": "short" + } + ] + } + }, + "name": "Flash", + "description": "Tell light to flash, can be either value short or long." + } + }, + "target": { + "entity": [ + { + "domain": [ + "light" + ] + } + ] + } + }, + "toggle": { + "name": "Toggle", + "description": "Toggles one or more lights, from on to off, or, off to on, based on their current state.", + "fields": { + "transition": { + "filter": { + "supported_features": [ + 32 + ] + }, + "selector": { + "number": { + "min": 0, + "max": 300, + "unit_of_measurement": "seconds" + } + }, + "name": "Transition", + "description": "Duration it takes to get to next state." + }, + "rgb_color": { + "filter": { + "attribute": { + "supported_color_modes": [ + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "example": "[255, 100, 100]", + "selector": { + "object": null + }, + "name": "Color", + "description": "The color in RGB format. A list of three integers between 0 and 255 representing the values of red, green, and blue." + }, + "color_name": { + "filter": { + "attribute": { + "supported_color_modes": [ + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "selector": { + "select": { + "translation_key": "color_name", + "options": [ + "homeassistant", + "aliceblue", + "antiquewhite", + "aqua", + "aquamarine", + "azure", + "beige", + "bisque", + "blanchedalmond", + "blue", + "blueviolet", + "brown", + "burlywood", + "cadetblue", + "chartreuse", + "chocolate", + "coral", + "cornflowerblue", + "cornsilk", + "crimson", + "cyan", + "darkblue", + "darkcyan", + "darkgoldenrod", + "darkgray", + "darkgreen", + "darkgrey", + "darkkhaki", + "darkmagenta", + "darkolivegreen", + "darkorange", + "darkorchid", + "darkred", + "darksalmon", + "darkseagreen", + "darkslateblue", + "darkslategray", + "darkslategrey", + "darkturquoise", + "darkviolet", + "deeppink", + "deepskyblue", + "dimgray", + "dimgrey", + "dodgerblue", + "firebrick", + "floralwhite", + "forestgreen", + "fuchsia", + "gainsboro", + "ghostwhite", + "gold", + "goldenrod", + "gray", + "green", + "greenyellow", + "grey", + "honeydew", + "hotpink", + "indianred", + "indigo", + "ivory", + "khaki", + "lavender", + "lavenderblush", + "lawngreen", + "lemonchiffon", + "lightblue", + "lightcoral", + "lightcyan", + "lightgoldenrodyellow", + "lightgray", + "lightgreen", + "lightgrey", + "lightpink", + "lightsalmon", + "lightseagreen", + "lightskyblue", + "lightslategray", + "lightslategrey", + "lightsteelblue", + "lightyellow", + "lime", + "limegreen", + "linen", + "magenta", + "maroon", + "mediumaquamarine", + "mediumblue", + "mediumorchid", + "mediumpurple", + "mediumseagreen", + "mediumslateblue", + "mediumspringgreen", + "mediumturquoise", + "mediumvioletred", + "midnightblue", + "mintcream", + "mistyrose", + "moccasin", + "navajowhite", + "navy", + "navyblue", + "oldlace", + "olive", + "olivedrab", + "orange", + "orangered", + "orchid", + "palegoldenrod", + "palegreen", + "paleturquoise", + "palevioletred", + "papayawhip", + "peachpuff", + "peru", + "pink", + "plum", + "powderblue", + "purple", + "red", + "rosybrown", + "royalblue", + "saddlebrown", + "salmon", + "sandybrown", + "seagreen", + "seashell", + "sienna", + "silver", + "skyblue", + "slateblue", + "slategray", + "slategrey", + "snow", + "springgreen", + "steelblue", + "tan", + "teal", + "thistle", + "tomato", + "turquoise", + "violet", + "wheat", + "white", + "whitesmoke", + "yellow", + "yellowgreen" + ] + } + }, + "name": "Color name", + "description": "A human-readable color name." + }, + "hs_color": { + "filter": { + "attribute": { + "supported_color_modes": [ + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "example": "[300, 70]", + "selector": { + "object": null + }, + "name": "Hue/Sat color", + "description": "Color in hue/sat format. A list of two integers. Hue is 0-360 and Sat is 0-100." + }, + "xy_color": { + "filter": { + "attribute": { + "supported_color_modes": [ + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "example": "[0.52, 0.43]", + "selector": { + "object": null + }, + "name": "XY-color", + "description": "Color in XY-format. A list of two decimal numbers between 0 and 1." + }, + "color_temp": { + "filter": { + "attribute": { + "supported_color_modes": [ + "color_temp", + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "selector": { + "color_temp": null + }, + "name": "Color temperature", + "description": "Color temperature in mireds." + }, + "kelvin": { + "filter": { + "attribute": { + "supported_color_modes": [ + "color_temp", + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "selector": { + "number": { + "min": 2000, + "max": 6500, + "step": 100, + "unit_of_measurement": "K" + } + }, + "name": "Color temperature", + "description": "Color temperature in Kelvin." + }, + "brightness": { + "filter": { + "attribute": { + "supported_color_modes": [ + "brightness", + "color_temp", + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "advanced": true, + "selector": { + "number": { + "min": 0, + "max": 255 + } + }, + "name": "Brightness value", + "description": "Number indicating brightness, where 0 turns the light off, 1 is the minimum brightness, and 255 is the maximum brightness." + }, + "brightness_pct": { + "filter": { + "attribute": { + "supported_color_modes": [ + "brightness", + "color_temp", + "hs", + "xy", + "rgb", + "rgbw", + "rgbww" + ] + } + }, + "selector": { + "number": { + "min": 0, + "max": 100, + "unit_of_measurement": "%" + } + }, + "name": "Brightness", + "description": "Number indicating the percentage of full brightness, where 0 turns the light off, 1 is the minimum brightness, and 100 is the maximum brightness." + }, + "white": { + "filter": { + "attribute": { + "supported_color_modes": [ + "white" + ] + } + }, + "advanced": true, + "selector": { + "constant": { + "value": true, + "label": "Enabled" + } + }, + "name": "White", + "description": "Set the light to white mode." + }, + "profile": { + "advanced": true, + "example": "relax", + "selector": { + "text": null + }, + "name": "Profile", + "description": "Name of a light profile to use." + }, + "flash": { + "filter": { + "supported_features": [ + 8 + ] + }, + "advanced": true, + "selector": { + "select": { + "options": [ + { + "label": "Long", + "value": "long" + }, + { + "label": "Short", + "value": "short" + } + ] + } + }, + "name": "Flash", + "description": "Tell light to flash, can be either value short or long." + }, + "effect": { + "filter": { + "supported_features": [ + 4 + ] + }, + "selector": { + "text": null + }, + "name": "Effect", + "description": "Light effect." + } + }, + "target": { + "entity": [ + { + "domain": [ + "light" + ] + } + ] + } + } + }, + "notify": { + "whatsapp": { + "name": "Send a notification with whatsapp", + "description": "Sends a notification message using the whatsapp service.", + "fields": { + "message": { + "required": true, + "example": "The garage door has been open for 10 minutes.", + "selector": { + "text": null + } + }, + "title": { + "example": "Your Garage Door Friend", + "selector": { + "text": null + } + }, + "target": { + "example": "platform specific", + "selector": { + "object": null + } + }, + "data": { + "example": "platform specific", + "selector": { + "object": null + } + } + } + }, + "persistent_notification": { + "name": "Send a persistent notification", + "description": "Sends a notification that is visible in the **Notifications** panel.", + "fields": { + "message": { + "required": true, + "example": "The garage door has been open for 10 minutes.", + "selector": { + "text": null + }, + "name": "Message", + "description": "Message body of the notification." + }, + "title": { + "example": "Your Garage Door Friend", + "selector": { + "text": null + }, + "name": "Title", + "description": "Title of the notification." + }, + "data": { + "example": "platform specific", + "selector": { + "object": null + }, + "name": "Data", + "description": "Some integrations provide extended functionality. For information on how to use _data_, refer to the integration documentation.." + } + } + }, + "mobile_app_deengph001": { + "name": "Send a notification via mobile_app_deengph001", + "description": "Sends a notification message using the mobile_app_deengph001 integration.", + "fields": { + "message": { + "required": true, + "example": "The garage door has been open for 10 minutes.", + "selector": { + "text": null + } + }, + "title": { + "example": "Your Garage Door Friend", + "selector": { + "text": null + } + }, + "target": { + "example": "platform specific", + "selector": { + "object": null + } + }, + "data": { + "example": "platform specific", + "selector": { + "object": null + } + } + } + }, + "mobile_app_deengph002": { + "name": "Send a notification via mobile_app_deengph002", + "description": "Sends a notification message using the mobile_app_deengph002 integration.", + "fields": { + "message": { + "required": true, + "example": "The garage door has been open for 10 minutes.", + "selector": { + "text": null + } + }, + "title": { + "example": "Your Garage Door Friend", + "selector": { + "text": null + } + }, + "target": { + "example": "platform specific", + "selector": { + "object": null + } + }, + "data": { + "example": "platform specific", + "selector": { + "object": null + } + } + } + }, + "notify": { + "name": "Send a notification with notify", + "description": "Sends a notification message using the notify service.", + "fields": { + "message": { + "required": true, + "example": "The garage door has been open for 10 minutes.", + "selector": { + "text": null + } + }, + "title": { + "example": "Your Garage Door Friend", + "selector": { + "text": null + } + }, + "target": { + "example": "platform specific", + "selector": { + "object": null + } + }, + "data": { + "example": "platform specific", + "selector": { + "object": null + } + } + } + } + }, + "tts": { + "google_translate_say": { + "name": "Say a TTS message with google_translate", + "description": "Say something using text-to-speech on a media player with google_translate.", + "fields": { + "entity_id": { + "required": true, + "selector": { + "entity": { + "domain": "media_player" + } + } + }, + "message": { + "example": "My name is hanna", + "required": true, + "selector": { + "text": null + } + }, + "cache": { + "default": false, + "selector": { + "boolean": null + } + }, + "language": { + "example": "ru", + "selector": { + "text": null + } + }, + "options": { + "advanced": true, + "example": "platform specific", + "selector": { + "object": null + } + } + } + }, + "speak": { + "name": "Speak", + "description": "Speaks something using text-to-speech on a media player.", + "fields": { + "media_player_entity_id": { + "required": true, + "selector": { + "entity": { + "domain": "media_player" + } + }, + "name": "Media player entity", + "description": "Media players to play the message." + }, + "message": { + "example": "My name is hanna", + "required": true, + "selector": { + "text": null + }, + "name": "Message", + "description": "The text you want to convert into speech so that you can listen to it on your device." + }, + "cache": { + "default": true, + "selector": { + "boolean": null + }, + "name": "Cache", + "description": "Stores this message locally so that when the text is requested again, the output can be produced more quickly." + }, + "language": { + "example": "ru", + "selector": { + "text": null + }, + "name": "Language", + "description": "Language to use for speech generation." + }, + "options": { + "advanced": true, + "example": "platform specific", + "selector": { + "object": null + }, + "name": "Options", + "description": "A dictionary containing integration-specific options." + } + }, + "target": { + "entity": [ + { + "domain": [ + "tts" + ] + } + ] + } + }, + "clear_cache": { + "name": "Clear TTS cache", + "description": "Removes all cached text-to-speech files and purges the memory.", + "fields": {} + } + }, + "cast": { + "show_lovelace_view": { + "name": "Show dashboard view", + "description": "Shows a dashboard view on a Chromecast device.", + "fields": { + "entity_id": { + "required": true, + "selector": { + "entity": { + "integration": "cast", + "domain": "media_player" + } + }, + "name": "Entity", + "description": "Media player entity to show the dashboard view on." + }, + "dashboard_path": { + "required": true, + "example": "lovelace-cast", + "selector": { + "text": null + }, + "name": "Dashboard path", + "description": "The URL path of the dashboard to show." + }, + "view_path": { + "example": "downstairs", + "selector": { + "text": null + }, + "name": "View path", + "description": "The path of the dashboard view to show." + } + } + } + }, + "zha": { + "permit": { + "name": "Permit", + "description": "Allows nodes to join the Zigbee network.", + "fields": { + "duration": { + "default": 60, + "selector": { + "number": { + "min": 0, + "max": 254, + "unit_of_measurement": "seconds" + } + }, + "name": "Duration", + "description": "Time to permit joins." + }, + "ieee": { + "example": "00:0d:6f:00:05:7d:2d:34", + "selector": { + "text": null + }, + "name": "IEEE", + "description": "IEEE address of the node permitting new joins." + }, + "source_ieee": { + "example": "00:0a:bf:00:01:10:23:35", + "selector": { + "text": null + }, + "name": "Source IEEE", + "description": "IEEE address of the joining device (must be used with the install code)." + }, + "install_code": { + "example": "1234-5678-1234-5678-AABB-CCDD-AABB-CCDD-EEFF", + "selector": { + "text": null + }, + "name": "Install code", + "description": "Install code of the joining device (must be used with the source_ieee)." + }, + "qr_code": { + "example": "Z:000D6FFFFED4163B$I:52797BF4A5084DAA8E1712B61741CA024051", + "selector": { + "text": null + }, + "name": "QR code", + "description": "Value of the QR install code (different between vendors)." + } + } + }, + "remove": { + "name": "Remove", + "description": "Removes a node from the Zigbee network.", + "fields": { + "ieee": { + "required": true, + "example": "00:0d:6f:00:05:7d:2d:34", + "selector": { + "text": null + }, + "name": "IEEE", + "description": "IEEE address of the node to remove." + } + } + }, + "set_zigbee_cluster_attribute": { + "name": "Set zigbee cluster attribute", + "description": "Sets an attribute value for the specified cluster on the specified entity.", + "fields": { + "ieee": { + "required": true, + "example": "00:0d:6f:00:05:7d:2d:34", + "selector": { + "text": null + }, + "name": "IEEE", + "description": "IEEE address for the device." + }, + "endpoint_id": { + "required": true, + "selector": { + "number": { + "min": 1, + "max": 65535, + "mode": "box" + } + }, + "name": "Endpoint ID", + "description": "Endpoint ID for the cluster." + }, + "cluster_id": { + "required": true, + "selector": { + "number": { + "min": 1, + "max": 65535 + } + }, + "name": "Cluster ID", + "description": "ZCL cluster to retrieve attributes for." + }, + "cluster_type": { + "default": "in", + "selector": { + "select": { + "options": [ + "in", + "out" + ] + } + }, + "name": "Cluster Type", + "description": "Type of the cluster." + }, + "attribute": { + "required": true, + "example": 0, + "selector": { + "number": { + "min": 1, + "max": 65535 + } + }, + "name": "Attribute", + "description": "ID of the attribute to set." + }, + "value": { + "required": true, + "example": 1, + "selector": { + "text": null + }, + "name": "Value", + "description": "Value to write to the attribute." + }, + "manufacturer": { + "example": 252, + "selector": { + "text": null + }, + "name": "Manufacturer", + "description": "Manufacturer code." + } + } + }, + "issue_zigbee_cluster_command": { + "name": "Issue zigbee cluster command", + "description": "Issues a command on the specified cluster on the specified entity.", + "fields": { + "ieee": { + "required": true, + "example": "00:0d:6f:00:05:7d:2d:34", + "selector": { + "text": null + }, + "name": "IEEE", + "description": "IEEE address for the device." + }, + "endpoint_id": { + "required": true, + "selector": { + "number": { + "min": 1, + "max": 65535 + } + }, + "name": "Endpoint ID", + "description": "Endpoint ID for the cluster." + }, + "cluster_id": { + "required": true, + "selector": { + "number": { + "min": 1, + "max": 65535 + } + }, + "name": "Cluster ID", + "description": "ZCL cluster to retrieve attributes for." + }, + "cluster_type": { + "default": "in", + "selector": { + "select": { + "options": [ + "in", + "out" + ] + } + }, + "name": "Cluster Type", + "description": "Type of the cluster." + }, + "command": { + "required": true, + "selector": { + "number": { + "min": 1, + "max": 65535 + } + }, + "name": "Command", + "description": "ID of the command to execute." + }, + "command_type": { + "required": true, + "selector": { + "select": { + "options": [ + "client", + "server" + ] + } + }, + "name": "Command Type", + "description": "Type of the command to execute." + }, + "args": { + "example": "[arg1, arg2, argN]", + "selector": { + "object": null + }, + "name": "Args", + "description": "Arguments to pass to the command." + }, + "params": { + "selector": { + "object": null + }, + "name": "Params", + "description": "Parameters to pass to the command." + }, + "manufacturer": { + "example": 252, + "selector": { + "text": null + }, + "name": "Manufacturer", + "description": "Manufacturer code." + } + } + }, + "issue_zigbee_group_command": { + "name": "Issue zigbee group command", + "description": "Issue command on the specified cluster on the specified group.", + "fields": { + "group": { + "required": true, + "example": 546, + "selector": { + "text": null + }, + "name": "Group", + "description": "Hexadecimal address of the group." + }, + "cluster_id": { + "required": true, + "selector": { + "number": { + "min": 1, + "max": 65535 + } + }, + "name": "Cluster ID", + "description": "ZCL cluster to send command to." + }, + "cluster_type": { + "default": "in", + "selector": { + "select": { + "options": [ + "in", + "out" + ] + } + }, + "name": "Cluster type", + "description": "Type of the cluster." + }, + "command": { + "required": true, + "selector": { + "number": { + "min": 1, + "max": 65535 + } + }, + "name": "Command", + "description": "ID of the command to execute." + }, + "args": { + "example": "[arg1, arg2, argN]", + "selector": { + "object": null + }, + "name": "Args", + "description": "Arguments to pass to the command." + }, + "manufacturer": { + "example": 252, + "selector": { + "text": null + }, + "name": "Manufacturer", + "description": "Manufacturer code." + } + } + }, + "warning_device_squawk": { + "name": "Warning device squawk", + "description": "This service uses the WD capabilities to emit a quick audible/visible pulse called a \u0022squawk\u0022. The squawk command has no effect if the WD is currently active (warning in progress).", + "fields": { + "ieee": { + "required": true, + "example": "00:0d:6f:00:05:7d:2d:34", + "selector": { + "text": null + }, + "name": "IEEE", + "description": "IEEE address for the device." + }, + "mode": { + "default": 0, + "selector": { + "number": { + "min": 0, + "max": 1, + "mode": "box" + } + }, + "name": "Mode", + "description": "The Squawk Mode field is used as a 4-bit enumeration, and can have one of the values shown in Table 8-24 of the ZCL spec - Squawk Mode Field. The exact operation of each mode (how the WD \u201Csquawks\u201D) is implementation specific." + }, + "strobe": { + "default": 1, + "selector": { + "number": { + "min": 0, + "max": 1, + "mode": "box" + } + }, + "name": "Strobe", + "description": "The strobe field is used as a Boolean, and determines if the visual indication is also required in addition to the audible squawk, as shown in Table 8-25 of the ZCL spec - Strobe Bit." + }, + "level": { + "default": 2, + "selector": { + "number": { + "min": 0, + "max": 3, + "mode": "box" + } + }, + "name": "Level", + "description": "The squawk level field is used as a 2-bit enumeration, and determines the intensity of audible squawk sound as shown in Table 8-26 of the ZCL spec - Squawk Level Field Values." + } + } + }, + "warning_device_warn": { + "name": "Warning device starts alert", + "description": "This service starts the operation of the warning device. The warning device alerts the surrounding area by audible (siren) and visual (strobe) signals.", + "fields": { + "ieee": { + "required": true, + "example": "00:0d:6f:00:05:7d:2d:34", + "selector": { + "text": null + }, + "name": "IEEE", + "description": "IEEE address for the device." + }, + "mode": { + "default": 3, + "selector": { + "number": { + "min": 0, + "max": 6, + "mode": "box" + } + }, + "name": "Mode", + "description": "The Warning Mode field is used as a 4-bit enumeration, can have one of the values 0-6 defined below in table 8-20 of the ZCL spec. The exact behavior of the warning device in each mode is according to the relevant security standards." + }, + "strobe": { + "default": 1, + "selector": { + "number": { + "min": 0, + "max": 1, + "mode": "box" + } + }, + "name": "Strobe", + "description": "The Strobe field is used as a 2-bit enumeration, and determines if the visual indication is required in addition to the audible siren, as indicated in Table 8-21 of the ZCL spec. \u00220\u0022 means no strobe, \u00221\u0022 means strobe. If the strobe field is \u201C1\u201D and the Warning Mode is \u201C0\u201D (\u201CStop\u201D), then only the strobe is activated." + }, + "level": { + "default": 2, + "selector": { + "number": { + "min": 0, + "max": 3, + "mode": "box" + } + }, + "name": "Level", + "description": "The Siren Level field is used as a 2-bit enumeration, and indicates the intensity of audible squawk sound as shown in Table 8-22 of the ZCL spec." + }, + "duration": { + "default": 5, + "selector": { + "number": { + "min": 0, + "max": 65535, + "unit_of_measurement": "seconds" + } + }, + "name": "Duration", + "description": "Requested duration of warning, in seconds (16 bit). If both Strobe and Warning Mode are \u00220\u0022 this field is ignored." + }, + "duty_cycle": { + "default": 0, + "selector": { + "number": { + "min": 0, + "max": 100, + "step": 10 + } + }, + "name": "Duty cycle", + "description": "Indicates the length of the flash cycle. This allows you to vary the flash duration for different alarm types (e.g., fire, police, burglar). The valid range is 0-100 in increments of 10. All other values must be rounded to the nearest valid value. Strobe calculates a duty cycle over a duration of one second. The ON state must precede the OFF state. For example, if the Strobe Duty Cycle field specifies \u201C40,\u201D, then the strobe flashes ON for 4/10ths of a second and then turns OFF for 6/10ths of a second." + }, + "intensity": { + "default": 2, + "selector": { + "number": { + "min": 0, + "max": 3, + "mode": "box" + } + }, + "name": "Intensity", + "description": "Indicates the intensity of the strobe as shown in Table 8-23 of the ZCL spec. This attribute is designed to vary the output of the strobe (i.e., brightness) and not its frequency, which is detailed in section 8.4.2.3.1.6 of the ZCL spec." + } + } + }, + "set_lock_user_code": { + "name": "Set lock user code", + "description": "Sets a user code on a lock.", + "fields": { + "code_slot": { + "required": true, + "example": 1, + "selector": { + "text": null + }, + "name": "Code slot", + "description": "Code slot to set the code in." + }, + "user_code": { + "required": true, + "example": 1234, + "selector": { + "text": null + }, + "name": "Code", + "description": "Code to set." + } + }, + "target": { + "entity": [ + { + "domain": [ + "lock" + ], + "integration": "zha" + } + ] + } + }, + "enable_lock_user_code": { + "name": "Enable lock user", + "description": "Enables a user code on a lock.", + "fields": { + "code_slot": { + "required": true, + "example": 1, + "selector": { + "text": null + }, + "name": "Code slot", + "description": "Code slot to enable." + } + }, + "target": { + "entity": [ + { + "domain": [ + "lock" + ], + "integration": "zha" + } + ] + } + }, + "disable_lock_user_code": { + "name": "Disable lock user", + "description": "Disables a user code on a lock.", + "fields": { + "code_slot": { + "required": true, + "example": 1, + "selector": { + "text": null + }, + "name": "Code slot", + "description": "Code slot to disable." + } + }, + "target": { + "entity": [ + { + "domain": [ + "lock" + ], + "integration": "zha" + } + ] + } + }, + "clear_lock_user_code": { + "name": "Clear lock user", + "description": "Clears a user code from a lock.", + "fields": { + "code_slot": { + "required": true, + "example": 1, + "selector": { + "text": null + }, + "name": "Code slot", + "description": "Code slot to clear code from." + } + }, + "target": { + "entity": [ + { + "domain": [ + "lock" + ], + "integration": "zha" + } + ] + } + } + }, + "fritz": { + "cleanup": { + "name": "Remove stale device tracker entities", + "description": "Remove FRITZ!Box stale device_tracker entities.", + "fields": { + "device_id": { + "required": true, + "selector": { + "device": { + "integration": "fritz", + "entity": { + "device_class": "connectivity" + } + } + }, + "name": "Fritz!Box Device", + "description": "Select the Fritz!Box to check." + } + } + }, + "reboot": { + "name": "Reboot", + "description": "Reboots your FRITZ!Box.", + "fields": { + "device_id": { + "required": true, + "selector": { + "device": { + "integration": "fritz", + "entity": { + "device_class": "connectivity" + } + } + }, + "name": "Fritz!Box Device", + "description": "Select the Fritz!Box to reboot." + } + } + }, + "reconnect": { + "name": "Reconnect", + "description": "Reconnects your FRITZ!Box internet connection.", + "fields": { + "device_id": { + "required": true, + "selector": { + "device": { + "integration": "fritz", + "entity": { + "device_class": "connectivity" + } + } + }, + "name": "Fritz!Box Device", + "description": "Select the Fritz!Box to reconnect." + } + } + }, + "set_guest_wifi_password": { + "name": "Set guest Wi-Fi password", + "description": "Sets a new password for the guest Wi-Fi. The password must be between 8 and 63 characters long. If no additional parameter is set, the password will be auto-generated with a length of 12 characters.", + "fields": { + "device_id": { + "required": true, + "selector": { + "device": { + "integration": "fritz", + "entity": { + "device_class": "connectivity" + } + } + }, + "name": "Fritz!Box Device", + "description": "Select the Fritz!Box to configure." + }, + "password": { + "required": false, + "selector": { + "text": null + }, + "name": "Password", + "description": "New password for the guest Wi-Fi." + }, + "length": { + "required": false, + "selector": { + "number": { + "min": 8, + "max": 63 + } + }, + "name": "Password length", + "description": "Length of the new password. The password will be auto-generated, if no password is set." + } + } + } + } +} \ No newline at end of file diff --git a/NetDaemonApps/NetDaemonApps/Properties/launchSettings.json b/NetDaemonApps/NetDaemonApps/Properties/launchSettings.json new file mode 100644 index 0000000..3c9fde3 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "NetDaemonApps": { + "commandName": "Project", + "workingDirectory": "$(ProjectDir)", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development", + "DOTNET_ENVIRONMENT": "Development" + } + } + } +} diff --git a/NetDaemonApps/NetDaemonApps/README.md b/NetDaemonApps/NetDaemonApps/README.md new file mode 100644 index 0000000..ec45f4a --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/README.md @@ -0,0 +1,18 @@ +# Project template for binary deploy +This is the project template for binary deploy. This allows you to build a binary package and deploy it to NetDaemon. + +This is generated using NetDaemon runtime version 3.1 and .NET 7. + +## Getting started +Please see [netdaemon.xyz](https://netdaemon.xyz/docs/v3) for more information about getting starting developing apps for Home Assistant using NetDaemon. + +Please add code generation features in `program.cs` when using code generation features by removing comments! + +## Issues + +- If you have issues or suggestions of improvements to this template, please [add an issue](https://github.com/net-daemon/netdaemon-app-template) +- If you have issues or suggestions of improvements to NetDaemon, please [add an issue](https://github.com/net-daemon/netdaemon/issues) + +## Discuss the NetDaemon + +Please [join the Discord server](https://discord.gg/K3xwfcX) to get support or if you want to contribute and help others. diff --git a/NetDaemonApps/NetDaemonApps/apps/CallServiceEventHandlerApp.cs b/NetDaemonApps/NetDaemonApps/apps/CallServiceEventHandlerApp.cs new file mode 100644 index 0000000..1de24d2 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/apps/CallServiceEventHandlerApp.cs @@ -0,0 +1,69 @@ +using NetDaemon.HassModel.Entities; +using NetDaemonApps.DeviceLib.UseeLink; +using NetDaemonInterface; +using NetDaemonInterface; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace NetDaemonApps.apps; + +[NetDaemonApp] +public class CallServiceEventHandlerApp : MyNetDaemonBaseApp +{ + private ButtonMapping mapping; + private IAreaCollection AreaCollection { get; } + + public CallServiceEventHandlerApp(IHaContext haContext, IScheduler scheduler, ILogger logger, IAreaCollection areaCollection) + : base(haContext, scheduler, logger) + { + //{ + //"event_type": "call_service", + //"data": { + // "domain": "light", + // "service": "turn_on", + // "service_data": { + // "color_temp": 370, + // "entity_id": ["light.woonkamer_kamer"] + // } + // } + //} + AreaCollection = areaCollection; + mapping = new(entities); + CallServiceDataElement dataElement = new CallServiceDataElement(); + + haContext.Events.Where(x => x.EventType == "call_service").Subscribe(x => + { + try + { + if (x.DataElement.HasValue) + { + dataElement = System.Text.Json.JsonSerializer.Deserialize(x.DataElement.Value); + dataElement.Entity = x.DataElement?.GetProperty("service_data").GetProperty("entity_id").ToString(); + } + + if (dataElement == null || dataElement.Entity == null || dataElement.Service == null) + { + logger.LogWarning($"Unable to parse deconz event: {x.DataElement.Value}"); + return; + } + + var map = mapping.mapping.SingleOrDefault(x => x.Item2 == dataElement.Entity); + + if (map != null) + { + AreaCollection.GetArea(map.Item1).ButtonPressed(map.Item2, dataElement); + } + //else + //{ + // logger.LogWarning($"Unmapped button pressed '{dataElement.Entity}'"); + //} + } + catch + { + //ignore exceptions + + } + }); + } +} \ No newline at end of file diff --git a/NetDaemonApps/NetDaemonApps/apps/IdleSettingApp.cs b/NetDaemonApps/NetDaemonApps/apps/IdleSettingApp.cs new file mode 100644 index 0000000..a829bcf --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/apps/IdleSettingApp.cs @@ -0,0 +1,29 @@ +using NetDaemonApps.Modules; +using NetDaemonInterface; +using NetDaemonInterface; +using System.Linq; + +namespace NetDaemonApps.apps; + +[NetDaemonApp] +public class IdleSettingApp : MyNetDaemonBaseApp +{ + private IDeviceCollection DeviceCollection { get; } + + public IdleSettingApp(IHaContext haContext, IScheduler scheduler, ILogger logger, IDeviceCollection deviceCollection) + : base(haContext, scheduler, logger) + { + DeviceCollection = deviceCollection; + + entities.Sensor.Deengph001BatteryLevel.StateChanges() + .Throttle(TimeSpan.FromSeconds(1), scheduler) + .Where(x => x.Old?.State > x.New?.State && x.New?.State <= 25) + .Subscribe(x => new NotifyServices(haContext) + .Whatsapp(x.Entity.EntityId.ToString() + Environment.NewLine + "Akku bei " + x.New.State + " %")); + + foreach (var device in Enum.GetValues(typeof(DeviceControlEnum))) + { + DeviceCollection.GetDevice((DeviceControlEnum)device).Idle(entities, scheduler); + } + } +} \ No newline at end of file diff --git a/NetDaemonApps/NetDaemonApps/apps/NetDaemonAppBase.cs b/NetDaemonApps/NetDaemonApps/apps/NetDaemonAppBase.cs new file mode 100644 index 0000000..f719344 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/apps/NetDaemonAppBase.cs @@ -0,0 +1,25 @@ +using NetDaemonInterface; + +namespace NetDaemonApps.apps; + +/// +/// A base for the NetDaemon apps +/// It provides access to all essentials +/// +public class MyNetDaemonBaseApp +{ + internal readonly IHaContext haContext; + internal readonly IScheduler scheduler; + internal readonly ILogger logger; + internal readonly IEntities entities; + internal readonly IServices services; + + public MyNetDaemonBaseApp(IHaContext haContext, IScheduler scheduler, ILogger logger) + { + haContext = haContext; + scheduler = scheduler; + logger = logger; + entities = new Entities(haContext); + services = new Services(haContext); + } +} diff --git a/NetDaemonApps/NetDaemonApps/apps/PersistanceHandlerApp.cs b/NetDaemonApps/NetDaemonApps/apps/PersistanceHandlerApp.cs new file mode 100644 index 0000000..cc421bb --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/apps/PersistanceHandlerApp.cs @@ -0,0 +1,23 @@ +using NetDaemonInterface; + +namespace NetDaemonApps.apps; + +[NetDaemonApp] +public class PersistanceHandlerApp : MyNetDaemonBaseApp +{ + public PersistanceHandlerApp(IHaContext haContext, IScheduler scheduler, ILogger logger) + : base(haContext, scheduler, logger) + { + // Creation is only once but i keep them here just so i know what i created + + //_services.Netdaemon.EntityCreate(entityId: "sensor.housestate"); + //_services.Netdaemon.EntityCreate(entityId: "sensor.daynight", DayNightEnum.Day.ToString()); + //_services.Netdaemon.EntityCreate(entityId: "sensor.daynight_lastdaytrigger", DateTime.Now.ToString(Statics.dateTime_TimeFormat)); + //_services.Netdaemon.EntityCreate(entityId: "sensor.daynight_lastnighttrigger", DateTime.Now.ToString(Statics.dateTime_TimeFormat)); + //_services.Netdaemon.EntityCreate(entityId: "switch.watchdog_buiten"); + //_services.Netdaemon.EntityRemove(entityId: "switch.watchdog_wandlamp"); + + //_services.Netdaemon.EntityUpdate(entityId: "sensor.daynight_lastdaytrigger", "08:57:58"); + //_services.Netdaemon.EntityUpdate(entityId: "sensor.daynight_lastnighttrigger", "16:39:39"); + } +} \ No newline at end of file diff --git a/NetDaemonApps/NetDaemonApps/apps/Scheduler.cs b/NetDaemonApps/NetDaemonApps/apps/Scheduler.cs new file mode 100644 index 0000000..db9d47c --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/apps/Scheduler.cs @@ -0,0 +1,65 @@ +using NetDaemon.Extensions.Scheduler; +using NetDaemonApps.Modules; +using NetDaemonInterface; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonApps.apps +{ + [NetDaemonApp] + public class Scheduler : MyNetDaemonBaseApp + { + private IAreaCollection AreaCollection { get; } + private NotifyServices notifyServices; + + public Scheduler(IHaContext haContext, IScheduler scheduler, ILogger logger, IAreaCollection areaCollection) + : base(haContext, scheduler, logger) + { + AreaCollection = areaCollection; + notifyServices = new NotifyServices(haContext); + + scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextDawn.State), () => SunDawn()); // Morgendämmerung + scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextRising.State), () => SunRising()); // Sonnenaufgang + + scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextDusk.State), () => SunDusk()); // Abenddämmerung + scheduler.Schedule(DateTime.Parse(entities.Sensor.SunNextSetting.State), () => SunSetting()); // Sonnenuntergang + + } + + private void SunDawn() + { + foreach (var area in Enum.GetValues(typeof(AreaControlEnum))) + { + AreaCollection.GetArea((AreaControlEnum)area).SunDawn(); + } + } + + private async void SunRising() + { + foreach (var area in Enum.GetValues(typeof(AreaControlEnum))) + { + AreaCollection.GetArea((AreaControlEnum)area).SunRising(); + } + } + + private void SunDusk() + { + foreach (var area in Enum.GetValues(typeof(AreaControlEnum))) + { + AreaCollection.GetArea((AreaControlEnum)area).SunDusk(); + } + } + + private void SunSetting() + { + foreach (var area in Enum.GetValues(typeof(AreaControlEnum))) + { + AreaCollection.GetArea((AreaControlEnum)area).SunSetting(); + } + } + } +} + diff --git a/NetDaemonApps/NetDaemonApps/appsettings.json b/NetDaemonApps/NetDaemonApps/appsettings.json new file mode 100644 index 0000000..d06de46 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/appsettings.json @@ -0,0 +1,23 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "Microsoft": "Warning" + }, + "ConsoleThemeType": "Ansi" + }, + "HomeAssistant": { + "Host": "deengha001.duckdns.org", + "Port": 8123, + "Ssl": true, + "Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJiYWU3YTMwOWNjMzM0Y2VhYTI3MmUwZGIyZjBmYTY0MCIsImlhdCI6MTY4OTI2NzYyOSwiZXhwIjoyMDA0NjI3NjI5fQ.dCWiVbZ2Uhxym-WLFkGGfw5tFXP9My_S7VeXX-Gnwa4" + }, + "NetDaemon": { + "ApplicationConfigurationFolder": "./apps" + }, + "CodeGeneration": { + "Namespace": "HomeAssistantGenerated", + "OutputFile": "HomeAssistantGenerated.cs", + "UseAttributeBaseClasses" : "false" + } +} diff --git a/NetDaemonApps/NetDaemonApps/program.cs b/NetDaemonApps/NetDaemonApps/program.cs new file mode 100644 index 0000000..9205c25 --- /dev/null +++ b/NetDaemonApps/NetDaemonApps/program.cs @@ -0,0 +1,39 @@ +using System.Reflection; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using NetDaemon.Extensions.Logging; +using NetDaemon.Extensions.Scheduler; +using NetDaemon.Extensions.Tts; +using NetDaemon.Runtime; +using NetDaemonApps.Modules; +using NetDaemonInterface; +// Add next line if using code generator +//using HomeAssistantGenerated; + +try +{ + Console.WriteLine("Starting v0.0.0"); + + await Host.CreateDefaultBuilder(args) + .UseNetDaemonAppSettings() + .UseNetDaemonDefaultLogging() + .UseNetDaemonRuntime() + .UseNetDaemonTextToSpeech() + .ConfigureServices((_, services) => + { + services + .AddAppsFromAssembly(Assembly.GetExecutingAssembly()) + .AddNetDaemonStateManager() + .AddNetDaemonScheduler(); + services.AddSingleton(); + services.AddSingleton(); + }) + .Build() + .RunAsync() + .ConfigureAwait(false); +} +catch (Exception e) +{ + Console.WriteLine($"Failed to start host... {e}"); + throw; +} \ No newline at end of file diff --git a/NetDaemonApps/NetDeamonInterface/AreaControlEnum.cs b/NetDaemonApps/NetDeamonInterface/AreaControlEnum.cs new file mode 100644 index 0000000..2829407 --- /dev/null +++ b/NetDaemonApps/NetDeamonInterface/AreaControlEnum.cs @@ -0,0 +1,17 @@ +namespace NetDaemonInterface; +public enum AreaControlEnum +{ + Bath, + Bedroom, + Corridor1stFloor, + Corridor2ndFloor, + CorridorGroundFloor, + EntranceArea, + KidsRoom, + Kitchen, + LivingRoom, + Office, + Studio, + TechnicalRoom, + TmpArea +} \ No newline at end of file diff --git a/NetDaemonApps/NetDeamonInterface/CallServiceDataElement.cs b/NetDaemonApps/NetDeamonInterface/CallServiceDataElement.cs new file mode 100644 index 0000000..bbd6c78 --- /dev/null +++ b/NetDaemonApps/NetDeamonInterface/CallServiceDataElement.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json.Serialization; +using System.Threading.Tasks; + +namespace NetDaemonInterface; + +public record CallServiceDataElement +{ + [JsonPropertyName("domain")] + public string? Domain { get; init; } + + [JsonPropertyName("service")] + public string? Service { get; init; } + + [JsonPropertyName("entity_id")] + public string? Entity { get; set; } + + +} \ No newline at end of file diff --git a/NetDaemonApps/NetDeamonInterface/DeviceControlEnum.cs b/NetDaemonApps/NetDeamonInterface/DeviceControlEnum.cs new file mode 100644 index 0000000..8422160 --- /dev/null +++ b/NetDaemonApps/NetDeamonInterface/DeviceControlEnum.cs @@ -0,0 +1,7 @@ +namespace NetDaemonInterface; + +public enum DeviceControlEnum +{ + deengph001, + deengph002, +} \ No newline at end of file diff --git a/NetDaemonApps/NetDeamonInterface/EntityEvents.cs b/NetDaemonApps/NetDeamonInterface/EntityEvents.cs new file mode 100644 index 0000000..3db9ded --- /dev/null +++ b/NetDaemonApps/NetDeamonInterface/EntityEvents.cs @@ -0,0 +1,104 @@ +using NetDaemonInterface; +using System; +using System.ComponentModel; + +namespace NetDaemonInterface; + +public class EntityEvents : ViewModelBase +{ + private int clickCnt; + private System.Timers.Timer timer; + + public EntityEvents() + { + Init(); + } + + + + public EntityEvents(string varName) + { + Init(); + VarName = varName; + } + + private void Init() + { + PropertyChanged += CounterClass_PropertyChanged; + timer = new System.Timers.Timer(500); + timer.Elapsed += Timer_Elapsed; + timer.AutoReset = false; + } + + private void CounterClass_PropertyChanged(object? sender, PropertyChangedEventArgs e) + { + if (clickCnt == 0) + { + timer.Start(); + } + + trigger = false; + clickCnt++; + } + + private void Timer_Elapsed(object? sender, System.Timers.ElapsedEventArgs e) + { + timer.Stop(); + + switch (clickCnt) + { + case 1: + if (Click is not null) + Click(this, e); + break; + + case 2: + if (DoubleClick is not null) + DoubleClick(this, e); + break; + + case 3: + if (TribleClick is not null) + TribleClick(this, e); + break; + } + clickCnt = 0; + } + + public event EventHandler? Click; + public event EventHandler? DoubleClick; + public event EventHandler? TribleClick; + + private bool trigger; + public bool Trigger + { + get { return trigger; } + set + { + if (trigger != value) + { + trigger = value; + OnPropertyChanged(); + } + } + } + + private string varName; + public string VarName + { + get { return varName; } + set + { + if (varName != value) + { + varName = value; + OnPropertyChanged(); + + timer.Stop(); + clickCnt = 0; + } + + } + } +} + diff --git a/NetDaemonApps/NetDeamonInterface/IAreaCollection.cs b/NetDaemonApps/NetDeamonInterface/IAreaCollection.cs new file mode 100644 index 0000000..d175df8 --- /dev/null +++ b/NetDaemonApps/NetDeamonInterface/IAreaCollection.cs @@ -0,0 +1,6 @@ +namespace NetDaemonInterface; + +public interface IAreaCollection +{ + IAreaControl GetArea(AreaControlEnum area); +} \ No newline at end of file diff --git a/NetDaemonApps/NetDeamonInterface/IAreaControl.cs b/NetDaemonApps/NetDeamonInterface/IAreaControl.cs new file mode 100644 index 0000000..7cf41d4 --- /dev/null +++ b/NetDaemonApps/NetDeamonInterface/IAreaControl.cs @@ -0,0 +1,37 @@ +using NetDaemonInterface; + +namespace NetDaemonInterface; + +/// +/// Interface used for providing inputs/events to area's +/// +public interface IAreaControl +{ + + /// + /// Ein Button wurde betätigt + /// + /// Sensor, der gedrückt wurde + public void ButtonPressed(string entityId, CallServiceDataElement dataElement); + + /// + /// Morgendämmerung + /// + public void SunDawn(); + + /// + /// Sonnenaufgang + /// + public void SunRising(); + + /// + /// Abenddämmerung + /// + public void SunDusk(); + + /// + /// Sonnenuntergang + /// + public void SunSetting(); + +} diff --git a/NetDaemonApps/NetDeamonInterface/IDeviceCollection.cs b/NetDaemonApps/NetDeamonInterface/IDeviceCollection.cs new file mode 100644 index 0000000..d10f829 --- /dev/null +++ b/NetDaemonApps/NetDeamonInterface/IDeviceCollection.cs @@ -0,0 +1,8 @@ +using NetDaemonInterface; + +namespace NetDaemonInterface; + +public interface IDeviceCollection +{ + IDeviceControl GetDevice(DeviceControlEnum area); +} \ No newline at end of file diff --git a/NetDaemonApps/NetDeamonInterface/IDeviceControl.cs b/NetDaemonApps/NetDeamonInterface/IDeviceControl.cs new file mode 100644 index 0000000..7a76cc5 --- /dev/null +++ b/NetDaemonApps/NetDeamonInterface/IDeviceControl.cs @@ -0,0 +1,18 @@ +using HomeAssistantGenerated; +using NetDaemonInterface; +using System.Reactive.Concurrency; + +namespace NetDaemonInterface; + +/// +/// Interface used for providing inputs/events to area's +/// +public interface IDeviceControl +{ + + /// + /// Werteänderung + /// + public void Idle(IEntities entities, IScheduler scheduler); + +} diff --git a/NetDaemonApps/NetDeamonInterface/NetDaemonInterface.csproj b/NetDaemonApps/NetDeamonInterface/NetDaemonInterface.csproj new file mode 100644 index 0000000..212eb63 --- /dev/null +++ b/NetDaemonApps/NetDeamonInterface/NetDaemonInterface.csproj @@ -0,0 +1,27 @@ + + + + net7.0 + 11.0 + enable + + + + + + + + + + + + + + + + + + + + + diff --git a/NetDaemonApps/NetDeamonInterface/StateEnum.cs b/NetDaemonApps/NetDeamonInterface/StateEnum.cs new file mode 100644 index 0000000..9e59201 --- /dev/null +++ b/NetDaemonApps/NetDeamonInterface/StateEnum.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace NetDaemonInterface; + +public static class StateEnum +{ + public static readonly string Press = "press"; + public static readonly string TurnOn = "turn_on"; + public static readonly string TurnOff = "turn_off"; + +} + diff --git a/NetDaemonApps/NetDeamonInterface/ViewModelBase.cs b/NetDaemonApps/NetDeamonInterface/ViewModelBase.cs new file mode 100644 index 0000000..bc0c075 --- /dev/null +++ b/NetDaemonApps/NetDeamonInterface/ViewModelBase.cs @@ -0,0 +1,45 @@ +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace NetDaemonInterface +{ + public class ViewModelBase : INotifyPropertyChanged + { + /// + /// Multicast event for property change notifications. + /// + public event PropertyChangedEventHandler PropertyChanged; + + /// + /// Checks if a property already matches the desired value. Sets the property and + /// notifies listeners only when necessary. + /// + /// Type of the property. + /// Reference to a property with both getter and setter. + /// Desired value for the property. + /// Name of the property used to notify listeners.This + /// value is optional and can be provided automatically when invoked from compilers that + /// support CallerMemberName. + /// True if the value was changed, false if the existing value matched the + /// desired value. + protected virtual bool SetProperty(ref T storage, T value, [CallerMemberName] string propertyName = null) + { + if (object.Equals(storage, value)) return false; + storage = value; + // Log.DebugFormat("{0}.{1} = {2}", this.GetType().Name, propertyName, storage); + this.OnPropertyChanged(propertyName); + return true; + } + + /// + /// Notifies listeners that a property value has changed. + /// + /// Name of the property used to notify listeners. This + /// value is optional and can be provided automatically when invoked from compilers + /// that support . + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + } +}