hoffmation-base 3.0.0-alpha.30 → 3.0.0-alpha.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/lib/models/action/baseAction.d.ts +4 -0
  2. package/lib/models/action/baseAction.js +10 -0
  3. package/lib/models/action/humiditySensorChangeAction.d.ts +16 -0
  4. package/lib/models/action/humiditySensorChangeAction.js +15 -0
  5. package/lib/models/action/index.d.ts +1 -0
  6. package/lib/models/action/index.js +5 -0
  7. package/lib/models/action/motionSensorAction.d.ts +16 -0
  8. package/lib/models/action/motionSensorAction.js +15 -0
  9. package/lib/models/action/presenceGroupFirstEnterAction.d.ts +7 -0
  10. package/lib/models/action/presenceGroupFirstEnterAction.js +13 -0
  11. package/lib/models/action/presenceGroupLastLeftAction.d.ts +7 -0
  12. package/lib/models/action/presenceGroupLastLeftAction.js +13 -0
  13. package/lib/models/action/shutterPositionChangedAction.d.ts +13 -0
  14. package/lib/models/action/shutterPositionChangedAction.js +15 -0
  15. package/lib/models/action/temperatureSensorChangeAction.d.ts +16 -0
  16. package/lib/models/action/temperatureSensorChangeAction.js +15 -0
  17. package/lib/models/command/ShutterSetLevelCommand.d.ts +1 -1
  18. package/lib/models/command/ShutterSetLevelCommand.js +1 -1
  19. package/lib/models/command/WindowRestoreDesiredPositionCommand.d.ts +1 -1
  20. package/lib/models/command/WindowRestoreDesiredPositionCommand.js +1 -1
  21. package/lib/models/command/WindowSetDesiredPositionCommand.d.ts +1 -1
  22. package/lib/models/command/WindowSetDesiredPositionCommand.js +1 -1
  23. package/lib/models/command/WindowSetRolloByWeatherStatusCommand.d.ts +1 -1
  24. package/lib/models/command/WindowSetRolloByWeatherStatusCommand.js +1 -1
  25. package/lib/models/command/actuatorSetStateCommand.d.ts +1 -1
  26. package/lib/models/command/actuatorSetStateCommand.js +1 -1
  27. package/lib/models/command/actuatorToggleCommand.d.ts +1 -1
  28. package/lib/models/command/actuatorToggleCommand.js +1 -1
  29. package/lib/models/command/actuatorWriteStateToDeviceCommand.d.ts +1 -1
  30. package/lib/models/command/actuatorWriteStateToDeviceCommand.js +1 -1
  31. package/lib/models/command/baseCommand.d.ts +1 -1
  32. package/lib/models/command/baseCommand.js +2 -2
  33. package/lib/models/command/blockAutomaticCommand.d.ts +1 -1
  34. package/lib/models/command/blockAutomaticCommand.js +1 -1
  35. package/lib/models/command/blockAutomaticLiftBlockCommand.d.ts +1 -1
  36. package/lib/models/command/blockAutomaticLiftBlockCommand.js +1 -1
  37. package/lib/models/command/blockAutomaticUntilCommand.d.ts +1 -1
  38. package/lib/models/command/blockAutomaticUntilCommand.js +1 -1
  39. package/lib/models/command/commandType.d.ts +6 -0
  40. package/lib/models/command/commandType.js +6 -0
  41. package/lib/models/command/dimmerSetLightCommand.d.ts +1 -1
  42. package/lib/models/command/dimmerSetLightCommand.js +1 -1
  43. package/lib/models/command/floorSetAllShuttersCommand.d.ts +1 -1
  44. package/lib/models/command/floorSetAllShuttersCommand.js +1 -1
  45. package/lib/models/command/lampSetLightCommand.d.ts +1 -1
  46. package/lib/models/command/lampSetLightCommand.js +1 -1
  47. package/lib/models/command/lampSetTimeBasedCommand.d.ts +1 -1
  48. package/lib/models/command/lampSetTimeBasedCommand.js +1 -1
  49. package/lib/models/command/lampToggleLightCommand.d.ts +1 -1
  50. package/lib/models/command/lampToggleLightCommand.js +1 -1
  51. package/lib/models/command/ledSetLightCommand.d.ts +1 -1
  52. package/lib/models/command/ledSetLightCommand.js +1 -1
  53. package/lib/models/command/lightGroupSwitchTimeConditionalCommand.d.ts +1 -1
  54. package/lib/models/command/lightGroupSwitchTimeConditionalCommand.js +1 -1
  55. package/lib/models/command/restoreTargetAutomaticValueCommand.d.ts +1 -1
  56. package/lib/models/command/restoreTargetAutomaticValueCommand.js +1 -1
  57. package/lib/models/command/roomRestoreLightCommand.d.ts +1 -1
  58. package/lib/models/command/roomRestoreLightCommand.js +1 -1
  59. package/lib/models/command/roomRestoreShutterPositionCommand.d.ts +1 -1
  60. package/lib/models/command/roomRestoreShutterPositionCommand.js +1 -1
  61. package/lib/models/command/roomSetLightTimeBasedCommand.d.ts +1 -1
  62. package/lib/models/command/roomSetLightTimeBasedCommand.js +1 -1
  63. package/lib/models/command/shutterSunriseUpCommand.d.ts +1 -1
  64. package/lib/models/command/shutterSunriseUpCommand.js +1 -1
  65. package/lib/models/command/shutterSunsetDownCommand.d.ts +1 -1
  66. package/lib/models/command/shutterSunsetDownCommand.js +1 -1
  67. package/lib/models/command/wledSetLightCommand.d.ts +1 -1
  68. package/lib/models/command/wledSetLightCommand.js +1 -1
  69. package/lib/models/index.d.ts +1 -0
  70. package/lib/models/index.js +1 -0
  71. package/lib/server/devices/baseDeviceInterfaces/iHumiditySensor.d.ts +2 -1
  72. package/lib/server/devices/baseDeviceInterfaces/iMotionSensor.d.ts +2 -1
  73. package/lib/server/devices/baseDeviceInterfaces/iShutter.d.ts +1 -1
  74. package/lib/server/devices/baseDeviceInterfaces/iTemperatureSensor.d.ts +2 -1
  75. package/lib/server/devices/blueIris/cameraDevice.d.ts +2 -1
  76. package/lib/server/devices/blueIris/cameraDevice.js +2 -1
  77. package/lib/server/devices/dachs/dachsTemperatureSensor.d.ts +2 -1
  78. package/lib/server/devices/dachs/dachsTemperatureSensor.js +3 -2
  79. package/lib/server/devices/groups/Window.d.ts +2 -1
  80. package/lib/server/devices/groups/Window.js +4 -4
  81. package/lib/server/devices/groups/presenceGroup.d.ts +5 -2
  82. package/lib/server/devices/groups/presenceGroup.js +36 -39
  83. package/lib/server/devices/hmIPDevices/hmIpBewegung.d.ts +2 -1
  84. package/lib/server/devices/hmIPDevices/hmIpBewegung.js +2 -1
  85. package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.d.ts +4 -2
  86. package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.js +6 -4
  87. package/lib/server/devices/hmIPDevices/hmIpPraezenz.d.ts +8 -7
  88. package/lib/server/devices/hmIPDevices/hmIpPraezenz.js +10 -9
  89. package/lib/server/devices/hmIPDevices/hmIpRoll.js +2 -1
  90. package/lib/server/devices/sharedFunctions/lampUtils.d.ts +10 -2
  91. package/lib/server/devices/sharedFunctions/lampUtils.js +29 -5
  92. package/lib/server/devices/wledDevice.js +7 -0
  93. package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.js +7 -0
  94. package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.d.ts +3 -2
  95. package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.js +2 -1
  96. package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.d.ts +1 -1
  97. package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +2 -1
  98. package/lib/server/devices/zigbee/zigbeeSonoffTemp.d.ts +4 -2
  99. package/lib/server/devices/zigbee/zigbeeSonoffTemp.js +6 -4
  100. package/lib/server/services/ac/ac-device.js +3 -3
  101. package/lib/server/services/govee/own-govee-device.js +7 -0
  102. package/lib/tsconfig.tsbuildinfo +1 -1
  103. package/package.json +1 -1
@@ -14,7 +14,7 @@ class LightGroupSwitchTimeConditionalCommand extends baseCommand_1.BaseCommand {
14
14
  super(source, reason);
15
15
  this.time = time;
16
16
  /** @inheritDoc */
17
- this._commandType = commandType_1.CommandType.LightGroupSwitchTimeConditional;
17
+ this.type = commandType_1.CommandType.LightGroupSwitchTimeConditional;
18
18
  }
19
19
  }
20
20
  exports.LightGroupSwitchTimeConditionalCommand = LightGroupSwitchTimeConditionalCommand;
@@ -3,7 +3,7 @@ import { CommandSource } from './commandSource';
3
3
  import { CommandType } from './commandType';
4
4
  export declare class RestoreTargetAutomaticValueCommand extends BaseCommand {
5
5
  /** @inheritDoc */
6
- _commandType: CommandType;
6
+ type: CommandType;
7
7
  /**
8
8
  * Command to restore the target automatic value of an actuator
9
9
  * @param source - The source of the command
@@ -12,7 +12,7 @@ class RestoreTargetAutomaticValueCommand extends baseCommand_1.BaseCommand {
12
12
  constructor(source, reason = '') {
13
13
  super(source, reason);
14
14
  /** @inheritDoc */
15
- this._commandType = commandType_1.CommandType.ActuatorRestoreTargetAutomaticValueCommand;
15
+ this.type = commandType_1.CommandType.ActuatorRestoreTargetAutomaticValueCommand;
16
16
  }
17
17
  }
18
18
  exports.RestoreTargetAutomaticValueCommand = RestoreTargetAutomaticValueCommand;
@@ -3,7 +3,7 @@ import { CommandType } from './commandType';
3
3
  import { CommandSource } from './commandSource';
4
4
  export declare class RoomRestoreLightCommand extends BaseCommand {
5
5
  /** @inheritDoc */
6
- _commandType: CommandType;
6
+ type: CommandType;
7
7
  /**
8
8
  * Command to restore the normal automatic light-state of a room
9
9
  * @param source - The source of the command
@@ -12,7 +12,7 @@ class RoomRestoreLightCommand extends baseCommand_1.BaseCommand {
12
12
  constructor(source, reason = '') {
13
13
  super(source, reason);
14
14
  /** @inheritDoc */
15
- this._commandType = commandType_1.CommandType.RoomRestoreLightCommand;
15
+ this.type = commandType_1.CommandType.RoomRestoreLightCommand;
16
16
  }
17
17
  }
18
18
  exports.RoomRestoreLightCommand = RoomRestoreLightCommand;
@@ -4,7 +4,7 @@ import { CommandType } from './commandType';
4
4
  export declare class RoomRestoreShutterPositionCommand extends BaseCommand {
5
5
  readonly recalc: boolean;
6
6
  /** @inheritDoc */
7
- _commandType: CommandType;
7
+ type: CommandType;
8
8
  /**
9
9
  * Command to restore the normal automatic shutter position of a room
10
10
  * @param source - The source of the command
@@ -14,7 +14,7 @@ class RoomRestoreShutterPositionCommand extends baseCommand_1.BaseCommand {
14
14
  super(source, reason);
15
15
  this.recalc = recalc;
16
16
  /** @inheritDoc */
17
- this._commandType = commandType_1.CommandType.RoomRestoreShutterPositionCommand;
17
+ this.type = commandType_1.CommandType.RoomRestoreShutterPositionCommand;
18
18
  }
19
19
  }
20
20
  exports.RoomRestoreShutterPositionCommand = RoomRestoreShutterPositionCommand;
@@ -4,7 +4,7 @@ import { CommandSource } from './commandSource';
4
4
  export declare class RoomSetLightTimeBasedCommand extends BaseCommand {
5
5
  readonly movementDependant: boolean;
6
6
  /** @inheritDoc */
7
- _commandType: CommandType;
7
+ type: CommandType;
8
8
  /**
9
9
  * Sets the light based on the current time, rollo Position and room Settings
10
10
  * @param source - The source of the command
@@ -14,7 +14,7 @@ class RoomSetLightTimeBasedCommand extends baseCommand_1.BaseCommand {
14
14
  super(source, reason);
15
15
  this.movementDependant = movementDependant;
16
16
  /** @inheritDoc */
17
- this._commandType = commandType_1.CommandType.RoomSetLightTimeBasedCommand;
17
+ this.type = commandType_1.CommandType.RoomSetLightTimeBasedCommand;
18
18
  }
19
19
  }
20
20
  exports.RoomSetLightTimeBasedCommand = RoomSetLightTimeBasedCommand;
@@ -3,7 +3,7 @@ import { CommandSource } from './commandSource';
3
3
  import { CommandType } from './commandType';
4
4
  export declare class ShutterSunriseUpCommand extends BaseCommand {
5
5
  /** @inheritDoc */
6
- _commandType: CommandType;
6
+ type: CommandType;
7
7
  /**
8
8
  * Command to perform actions when the shutter should be opened due to sunrise
9
9
  * @param source - The source of the command
@@ -12,7 +12,7 @@ class ShutterSunriseUpCommand extends baseCommand_1.BaseCommand {
12
12
  constructor(source, reason = '') {
13
13
  super(source, reason);
14
14
  /** @inheritDoc */
15
- this._commandType = commandType_1.CommandType.ShutterSunriseUpCommand;
15
+ this.type = commandType_1.CommandType.ShutterSunriseUpCommand;
16
16
  }
17
17
  }
18
18
  exports.ShutterSunriseUpCommand = ShutterSunriseUpCommand;
@@ -3,7 +3,7 @@ import { CommandSource } from './commandSource';
3
3
  import { CommandType } from './commandType';
4
4
  export declare class ShutterSunsetDownCommand extends BaseCommand {
5
5
  /** @inheritDoc */
6
- _commandType: CommandType;
6
+ type: CommandType;
7
7
  /**
8
8
  * Command to perform actions when the shutter is closing due to sunset
9
9
  * @param source - The source of the command
@@ -12,7 +12,7 @@ class ShutterSunsetDownCommand extends baseCommand_1.BaseCommand {
12
12
  constructor(source, reason = '') {
13
13
  super(source, reason);
14
14
  /** @inheritDoc */
15
- this._commandType = commandType_1.CommandType.SunsetDownCommand;
15
+ this.type = commandType_1.CommandType.SunsetDownCommand;
16
16
  }
17
17
  }
18
18
  exports.ShutterSunsetDownCommand = ShutterSunsetDownCommand;
@@ -8,7 +8,7 @@ import { BlockAutomaticCommand } from './blockAutomaticCommand';
8
8
  export declare class WledSetLightCommand extends DimmerSetLightCommand {
9
9
  preset?: number | undefined;
10
10
  /** @inheritDoc */
11
- _commandType: CommandType;
11
+ type: CommandType;
12
12
  /**
13
13
  * Command to set the light state of a WLED device
14
14
  * @param source - The source of the command
@@ -20,7 +20,7 @@ class WledSetLightCommand extends dimmerSetLightCommand_1.DimmerSetLightCommand
20
20
  super(source, on, reason, disableAutomatic, brightness, transitionTime);
21
21
  this.preset = preset;
22
22
  /** @inheritDoc */
23
- this._commandType = commandType_1.CommandType.WledSetLightCommand;
23
+ this.type = commandType_1.CommandType.WledSetLightCommand;
24
24
  }
25
25
  get logMessage() {
26
26
  var _a;
@@ -1,3 +1,4 @@
1
+ export * from './action/index';
1
2
  export * from './rooms/index';
2
3
  export * from './deviceSettings/index';
3
4
  export * from './persistence/index';
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.BlockAutomaticSettings = void 0;
18
+ __exportStar(require("./action/index"), exports);
18
19
  __exportStar(require("./rooms/index"), exports);
19
20
  __exportStar(require("./deviceSettings/index"), exports);
20
21
  __exportStar(require("./persistence/index"), exports);
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { iRoomDevice } from './iRoomDevice';
3
+ import { HumiditySensorChangeAction } from '../../../models/action/humiditySensorChangeAction';
3
4
  export declare const UNDEFINED_HUMIDITY_VALUE = -1;
4
5
  /**
5
6
  * This interface represents a humidity sensor device.
@@ -20,7 +21,7 @@ export interface iHumiditySensor extends iRoomDevice {
20
21
  * Add a callback that is called when the humidity changes
21
22
  * @param pCallback - The callback to fire
22
23
  */
23
- addHumidityCallback(pCallback: (pValue: number) => void): void;
24
+ addHumidityCallback(pCallback: (action: HumiditySensorChangeAction) => void): void;
24
25
  /**
25
26
  * Persists the current humidity information to the database
26
27
  */
@@ -1,5 +1,6 @@
1
1
  import { MotionSensorSettings } from '../../../models';
2
2
  import { iRoomDevice } from './iRoomDevice';
3
+ import { MotionSensorAction } from '../../../models/action/motionSensorAction';
3
4
  /**
4
5
  * This interface represents a motion sensor device.
5
6
  *
@@ -26,7 +27,7 @@ export interface iMotionSensor extends iRoomDevice {
26
27
  * Adds a callback for when a motion state has changed.
27
28
  * @param pCallback - Function that accepts the new state as parameter
28
29
  */
29
- addMovementCallback(pCallback: (newState: boolean) => void): void;
30
+ addMovementCallback(pCallback: (action: MotionSensorAction) => void): void;
30
31
  /**
31
32
  * Persists the current motion information to the database
32
33
  */
@@ -14,7 +14,7 @@ export interface iShutter extends iRoomDevice {
14
14
  /**
15
15
  * The current level of the shutter (0 = closed, 100 = open)
16
16
  */
17
- currentLevel: number;
17
+ readonly currentLevel: number;
18
18
  /**
19
19
  * The desired level of the shutter for this window (this might be different from the current level due to the desired level being set by the user)
20
20
  */
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { iRoomDevice } from './iRoomDevice';
3
+ import { TemperatureSensorChangeAction } from '../../../models/action/temperatureSensorChangeAction';
3
4
  export declare const UNDEFINED_TEMP_VALUE = -99;
4
5
  /**
5
6
  * This interface represents a temperature sensor device.
@@ -28,7 +29,7 @@ export interface iTemperatureSensor extends iRoomDevice {
28
29
  * Adds a callback to be called when the temperature changes
29
30
  * @param pCallback - The callback to be called
30
31
  */
31
- addTempChangeCallback(pCallback: (pValue: number) => void): void;
32
+ addTempChangeCallback(pCallback: (action: TemperatureSensorChangeAction) => void): void;
32
33
  /**
33
34
  * Inform the temperature sensor that the temperature in the room has changed
34
35
  * @param newTemperatur - The new temperature in the room in Celsius
@@ -4,6 +4,7 @@ import { LogDebugType } from '../../services';
4
4
  import { DeviceInfo } from '../DeviceInfo';
5
5
  import { DeviceCapability } from '../DeviceCapability';
6
6
  import { DeviceType } from '../deviceType';
7
+ import { MotionSensorAction } from '../../../models/action/motionSensorAction';
7
8
  export declare class CameraDevice implements iCameraDevice {
8
9
  /**
9
10
  * The name of the camera in BlueIris
@@ -66,7 +67,7 @@ export declare class CameraDevice implements iCameraDevice {
66
67
  /** @inheritDoc */
67
68
  get room(): RoomBase | undefined;
68
69
  /** @inheritDoc */
69
- addMovementCallback(pCallback: (newState: boolean) => void): void;
70
+ addMovementCallback(pCallback: (action: MotionSensorAction) => void): void;
70
71
  /** @inheritDoc */
71
72
  blockForDevice(device: iBaseDevice, block: boolean): void;
72
73
  /** @inheritDoc */
@@ -13,6 +13,7 @@ const DeviceInfo_1 = require("../DeviceInfo");
13
13
  const DeviceCapability_1 = require("../DeviceCapability");
14
14
  const deviceType_1 = require("../deviceType");
15
15
  const ioBroker_1 = require("../../ioBroker");
16
+ const motionSensorAction_1 = require("../../../models/action/motionSensorAction");
16
17
  class CameraDevice {
17
18
  constructor(mqttName, roomName, blueIrisName) {
18
19
  var _a;
@@ -237,7 +238,7 @@ class CameraDevice {
237
238
  this.log(models_1.LogLevel.Trace, `This is movement no. ${this.detectionsToday}`);
238
239
  }
239
240
  for (const c of this._movementDetectedCallback) {
240
- c(newState);
241
+ c(new motionSensorAction_1.MotionSensorAction(this));
241
242
  }
242
243
  }
243
244
  resetPersonDetectFallbackTimer() {
@@ -5,6 +5,7 @@ import { DeviceCapability } from '../DeviceCapability';
5
5
  import { DeviceType } from '../deviceType';
6
6
  import { DeviceInfo } from '../DeviceInfo';
7
7
  import { DeviceSettings, LogLevel, RoomBase } from '../../../models';
8
+ import { TemperatureSensorChangeAction } from '../../../models/action/temperatureSensorChangeAction';
8
9
  export declare class DachsTemperatureSensor implements iTemperatureSensor {
9
10
  /** @inheritDoc */
10
11
  settings: DeviceSettings | undefined;
@@ -39,7 +40,7 @@ export declare class DachsTemperatureSensor implements iTemperatureSensor {
39
40
  private set temperature(value);
40
41
  update(newTemp: number): void;
41
42
  /** @inheritDoc */
42
- addTempChangeCallback(pCallback: (pValue: number) => void): void;
43
+ addTempChangeCallback(pCallback: (action: TemperatureSensorChangeAction) => void): void;
43
44
  /** @inheritDoc */
44
45
  onTemperaturChange(newTemperatur: number): void;
45
46
  /** @inheritDoc */
@@ -11,6 +11,7 @@ const deviceType_1 = require("../deviceType");
11
11
  const DeviceInfo_1 = require("../DeviceInfo");
12
12
  const devices_1 = require("../devices");
13
13
  const lodash_1 = __importDefault(require("lodash"));
14
+ const temperatureSensorChangeAction_1 = require("../../../models/action/temperatureSensorChangeAction");
14
15
  class DachsTemperatureSensor {
15
16
  constructor(roomName, shortKey, longKey) {
16
17
  /** @inheritDoc */
@@ -76,7 +77,7 @@ class DachsTemperatureSensor {
76
77
  set temperature(val) {
77
78
  this._temperature = val;
78
79
  for (const cb of this._temperaturCallbacks) {
79
- cb(val);
80
+ cb(new temperatureSensorChangeAction_1.TemperatureSensorChangeAction(this, val));
80
81
  }
81
82
  }
82
83
  update(newTemp) {
@@ -86,7 +87,7 @@ class DachsTemperatureSensor {
86
87
  addTempChangeCallback(pCallback) {
87
88
  this._temperaturCallbacks.push(pCallback);
88
89
  if (this._temperature > baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE) {
89
- pCallback(this._temperature);
90
+ pCallback(new temperatureSensorChangeAction_1.TemperatureSensorChangeAction(this, this._temperature));
90
91
  }
91
92
  }
92
93
  /** @inheritDoc */
@@ -4,6 +4,7 @@ import { WindowRestoreDesiredPositionCommand, WindowSetDesiredPositionCommand }
4
4
  import { iShutter, iVibrationSensor } from '../baseDeviceInterfaces';
5
5
  import { BaseGroup } from './base-group';
6
6
  import { ZigbeeMagnetContact } from '../zigbee';
7
+ import { ShutterPositionChangedAction } from '../../../models/action/shutterPositionChangedAction';
7
8
  export declare class Window extends BaseGroup {
8
9
  readonly handleIds: string[];
9
10
  readonly vibrationIds: string[];
@@ -27,6 +28,6 @@ export declare class Window extends BaseGroup {
27
28
  getVibration(): iVibrationSensor[];
28
29
  griffeInPosition(pPosition: WindowPosition): number;
29
30
  initialize(): void;
30
- rolloPositionChange(pValue: number): void;
31
+ rolloPositionChange(action: ShutterPositionChangedAction): void;
31
32
  restoreDesiredPosition(c: WindowRestoreDesiredPositionCommand): void;
32
33
  }
@@ -104,10 +104,10 @@ class Window extends base_group_1.BaseGroup {
104
104
  });
105
105
  }, 5, this);
106
106
  }
107
- rolloPositionChange(pValue) {
108
- this.log(models_2.LogLevel.Debug, `Rollo Position Change in ${this.roomName} to ${pValue}`, pValue == this._desiredPosition ? services_1.LogDebugType.None : services_1.LogDebugType.ShutterPositionChange);
109
- if (pValue === 0 || pValue === 100) {
110
- this.getRoom().setLightTimeBased(new models_2.RoomSetLightTimeBasedCommand(models_2.CommandSource.Automatic, true, 'Window.rolloPositionChange'));
107
+ rolloPositionChange(action) {
108
+ this.log(models_2.LogLevel.Debug, `Rollo Position Change in ${this.roomName}: ${action.reasonTrace}`, action.newPosition == this._desiredPosition ? services_1.LogDebugType.None : services_1.LogDebugType.ShutterPositionChange);
109
+ if (action.newPosition === 0 || action.newPosition === 100) {
110
+ this.getRoom().setLightTimeBased(new models_2.RoomSetLightTimeBasedCommand(action, true));
111
111
  }
112
112
  }
113
113
  restoreDesiredPosition(c) {
@@ -1,5 +1,7 @@
1
1
  import { BaseGroup } from './base-group';
2
2
  import { iMotionSensor } from '../baseDeviceInterfaces';
3
+ import { PresenceGroupFirstEnterAction } from '../../../models/action/presenceGroupFirstEnterAction';
4
+ import { PresenceGroupLastLeftAction } from '../../../models/action/presenceGroupLastLeftAction';
3
5
  export declare class PresenceGroup extends BaseGroup {
4
6
  private _lastMovement;
5
7
  private _lastLeftTimeout;
@@ -8,10 +10,11 @@ export declare class PresenceGroup extends BaseGroup {
8
10
  constructor(roomName: string, motionSensorIds: string[]);
9
11
  getMotionDetector(): Array<iMotionSensor>;
10
12
  initCallbacks(): void;
13
+ addLastLeftCallback(cb: (action: PresenceGroupLastLeftAction) => void): void;
11
14
  presentAmount(): number;
12
15
  anyPresent(): boolean;
13
- addLastLeftCallback(cb: () => void): void;
14
- addFirstEnterCallback(cb: () => void): void;
16
+ addFirstEnterCallback(cb: (action: PresenceGroupFirstEnterAction) => void): void;
17
+ private motionSensorAnyMovement;
15
18
  private motionSensorOnLastLeft;
16
19
  /**
17
20
  * In case of an existing delayed last left callback timeout, this removes it.
@@ -7,6 +7,8 @@ const base_group_1 = require("./base-group");
7
7
  const device_cluster_type_1 = require("../device-cluster-type");
8
8
  const group_type_1 = require("./group-type");
9
9
  const device_list_1 = require("../device-list");
10
+ const presenceGroupFirstEnterAction_1 = require("../../../models/action/presenceGroupFirstEnterAction");
11
+ const presenceGroupLastLeftAction_1 = require("../../../models/action/presenceGroupLastLeftAction");
10
12
  class PresenceGroup extends base_group_1.BaseGroup {
11
13
  constructor(roomName, motionSensorIds) {
12
14
  super(roomName, group_type_1.GroupType.Presence);
@@ -21,43 +23,28 @@ class PresenceGroup extends base_group_1.BaseGroup {
21
23
  }
22
24
  initCallbacks() {
23
25
  this.getMotionDetector().forEach((b) => {
24
- b.addMovementCallback((val) => {
25
- var _a;
26
- if (!val) {
27
- return;
28
- }
29
- if (services_1.RoomService.awayModeActive || (services_1.RoomService.nightAlarmActive && !b.settings.excludeFromNightAlarm)) {
30
- services_1.RoomService.startIntrusionAlarm(this.getRoom(), b);
31
- }
32
- if (!b.settings.seesWindow) {
33
- (_a = this.getRoom().WindowGroup) === null || _a === void 0 ? void 0 : _a.changeVibrationMotionBlock(true);
34
- }
35
- services_1.RoomService.movementHistory.add(`${services_1.Utils.nowString()}: Raum "${this.roomName}" Gerät "${b.info.fullName}"`);
26
+ b.addMovementCallback((action) => {
27
+ this.motionSensorOnFirstEnter(action);
28
+ this.motionSensorOnLastLeft(action);
29
+ this.motionSensorAnyMovement(action);
36
30
  });
37
31
  });
38
- this.addLastLeftCallback(() => {
32
+ this.addLastLeftCallback((action) => {
39
33
  var _a, _b;
40
34
  (_a = this.getRoom().WindowGroup) === null || _a === void 0 ? void 0 : _a.changeVibrationMotionBlock(false);
41
- (_b = this.getRoom().LightGroup) === null || _b === void 0 ? void 0 : _b.switchAll(new models_1.ActuatorSetStateCommand(models_1.CommandSource.Automatic, false, 'Presence Group LastLeftCallback'));
35
+ (_b = this.getRoom().LightGroup) === null || _b === void 0 ? void 0 : _b.switchAll(new models_1.ActuatorSetStateCommand(action, false, 'Presence Group LastLeftCallback'));
42
36
  });
43
- this.addFirstEnterCallback(() => {
37
+ this.addFirstEnterCallback((action) => {
44
38
  if (!this.getRoom().settings.lampenBeiBewegung) {
45
39
  return;
46
40
  }
47
41
  this.log(models_1.LogLevel.DeepTrace, `Bewegung im Raum ${this.roomName} festgestellt --> Licht einschalten`);
48
- this.getRoom().setLightTimeBased(new models_1.RoomSetLightTimeBasedCommand(models_1.CommandSource.Automatic, true, 'Motion detected'));
49
- });
50
- this.getMotionDetector().forEach((b) => {
51
- b.addMovementCallback((val) => {
52
- this.motionSensorOnFirstEnter(val);
53
- });
54
- });
55
- this.getMotionDetector().forEach((b) => {
56
- b.addMovementCallback((val) => {
57
- this.motionSensorOnLastLeft(val);
58
- });
42
+ this.getRoom().setLightTimeBased(new models_1.RoomSetLightTimeBasedCommand(action, true));
59
43
  });
60
44
  }
45
+ addLastLeftCallback(cb) {
46
+ this._lastLeftCbs.push(cb);
47
+ }
61
48
  presentAmount() {
62
49
  let count = 0;
63
50
  for (let i = 0; i < this.getMotionDetector().length; i++) {
@@ -75,21 +62,31 @@ class PresenceGroup extends base_group_1.BaseGroup {
75
62
  }
76
63
  return false;
77
64
  }
78
- addLastLeftCallback(cb) {
79
- this._lastLeftCbs.push(cb);
80
- }
81
65
  addFirstEnterCallback(cb) {
82
66
  this._firstEnterCbs.push(cb);
83
67
  }
84
- motionSensorOnLastLeft(val) {
85
- if (val || this.anyPresent()) {
68
+ motionSensorAnyMovement(action) {
69
+ var _a;
70
+ if (!action.motionDetected) {
71
+ return;
72
+ }
73
+ if (services_1.RoomService.awayModeActive || (services_1.RoomService.nightAlarmActive && !action.sensor.settings.excludeFromNightAlarm)) {
74
+ services_1.RoomService.startIntrusionAlarm(this.getRoom(), action.sensor);
75
+ }
76
+ if (!action.sensor.settings.seesWindow) {
77
+ (_a = this.getRoom().WindowGroup) === null || _a === void 0 ? void 0 : _a.changeVibrationMotionBlock(true);
78
+ }
79
+ services_1.RoomService.movementHistory.add(`${services_1.Utils.nowString()}: Raum "${this.roomName}" Gerät "${action.sensor.info.fullName}"`);
80
+ }
81
+ motionSensorOnLastLeft(action) {
82
+ if (action.motionDetected || this.anyPresent()) {
86
83
  this.resetLastLeftTimeout();
87
84
  return;
88
85
  }
89
86
  let timeAfterReset = services_1.Utils.nowMS() - this._lastMovement.getTime() - this.getRoom().settings.movementResetTimer * 1000;
90
87
  if (timeAfterReset > 0) {
91
88
  this.log(models_1.LogLevel.Debug, `Movement reset. Active Motions: ${this.presentAmount()}\tTime after Last Movement including Reset: ${timeAfterReset}`);
92
- this.executeLastLeftCbs();
89
+ this.executeLastLeftCbs(new presenceGroupLastLeftAction_1.PresenceGroupLastLeftAction(action));
93
90
  return;
94
91
  }
95
92
  this.log(models_1.LogLevel.Debug, `Movement reset in ${this.roomName} delayed.`);
@@ -98,9 +95,9 @@ class PresenceGroup extends base_group_1.BaseGroup {
98
95
  timeAfterReset =
99
96
  services_1.Utils.nowMS() - this._lastMovement.getTime() - this.getRoom().settings.movementResetTimer * 1000;
100
97
  const presentAmount = this.presentAmount();
101
- this.log(models_1.LogLevel.Debug, `Delayed Movement reset. Active Motions: ${this.presentAmount()}\tTime after Last Movement including Reset: ${timeAfterReset}`);
98
+ this.log(models_1.LogLevel.Debug, `Delayed Movement reset. Active Motions: ${this.presentAmount()}\tTime after Last Movement including Reset: ${timeAfterReset}, action: ${action.reasonTrace}`);
102
99
  if (presentAmount <= 0 && timeAfterReset > 0) {
103
- this.executeLastLeftCbs();
100
+ this.executeLastLeftCbs(new presenceGroupLastLeftAction_1.PresenceGroupLastLeftAction(action));
104
101
  }
105
102
  }, Math.abs(timeAfterReset) + 500, this);
106
103
  }
@@ -112,8 +109,8 @@ class PresenceGroup extends base_group_1.BaseGroup {
112
109
  clearTimeout(this._lastLeftTimeout);
113
110
  }
114
111
  }
115
- motionSensorOnFirstEnter(val) {
116
- if (!val) {
112
+ motionSensorOnFirstEnter(action) {
113
+ if (!action.motionDetected) {
117
114
  return;
118
115
  }
119
116
  this._lastMovement = new Date();
@@ -121,12 +118,12 @@ class PresenceGroup extends base_group_1.BaseGroup {
121
118
  return;
122
119
  }
123
120
  for (const cb of this._firstEnterCbs) {
124
- cb();
121
+ cb(new presenceGroupFirstEnterAction_1.PresenceGroupFirstEnterAction(action));
125
122
  }
126
123
  }
127
- executeLastLeftCbs() {
124
+ executeLastLeftCbs(action) {
128
125
  for (const cb of this._lastLeftCbs) {
129
- cb();
126
+ cb(action);
130
127
  }
131
128
  }
132
129
  }
@@ -2,6 +2,7 @@ import { HmIPDevice } from './hmIpDevice';
2
2
  import { MotionSensorSettings } from '../../../models';
3
3
  import { iIlluminationSensor, iMotionSensor } from '../baseDeviceInterfaces';
4
4
  import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
5
+ import { MotionSensorAction } from '../../../models/action/motionSensorAction';
5
6
  export declare class HmIpBewegung extends HmIPDevice implements iIlluminationSensor, iMotionSensor {
6
7
  private static MOVEMENT_DETECTION;
7
8
  private static CURRENT_ILLUMINATION;
@@ -21,7 +22,7 @@ export declare class HmIpBewegung extends HmIPDevice implements iIlluminationSen
21
22
  get timeSinceLastMotion(): number;
22
23
  get currentIllumination(): number;
23
24
  private set currentIllumination(value);
24
- addMovementCallback(pCallback: (pValue: boolean) => void): void;
25
+ addMovementCallback(pCallback: (action: MotionSensorAction) => void): void;
25
26
  persistMotionSensor(): void;
26
27
  /** @inheritDoc */
27
28
  update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
@@ -6,6 +6,7 @@ const deviceType_1 = require("../deviceType");
6
6
  const models_1 = require("../../../models");
7
7
  const services_1 = require("../../services");
8
8
  const DeviceCapability_1 = require("../DeviceCapability");
9
+ const motionSensorAction_1 = require("../../../models/action/motionSensorAction");
9
10
  class HmIpBewegung extends hmIpDevice_1.HmIPDevice {
10
11
  constructor(pInfo) {
11
12
  var _a;
@@ -99,7 +100,7 @@ class HmIpBewegung extends hmIpDevice_1.HmIPDevice {
99
100
  this.log(models_1.LogLevel.Trace, `Dies ist die ${this.detectionsToday} Bewegung `);
100
101
  }
101
102
  for (const c of this._movementDetectedCallback) {
102
- c(pVal);
103
+ c(new motionSensorAction_1.MotionSensorAction(this));
103
104
  }
104
105
  }
105
106
  resetFallbackTimeout() {
@@ -4,6 +4,8 @@ import { iDisposable } from '../../services';
4
4
  import { HeaterSettings } from '../../../models';
5
5
  import { iHeater, iHumiditySensor, iTemperatureSensor } from '../baseDeviceInterfaces';
6
6
  import { IoBrokerDeviceInfo } from '../IoBrokerDeviceInfo';
7
+ import { HumiditySensorChangeAction } from '../../../models/action/humiditySensorChangeAction';
8
+ import { TemperatureSensorChangeAction } from '../../../models/action/temperatureSensorChangeAction';
7
9
  export declare class HmIpHeizgruppe extends HmIPDevice implements iTemperatureSensor, iHumiditySensor, iHeater, iDisposable {
8
10
  /** @inheritDoc */
9
11
  readonly persistHeaterInterval: NodeJS.Timeout;
@@ -48,14 +50,14 @@ export declare class HmIpHeizgruppe extends HmIPDevice implements iTemperatureSe
48
50
  /** @inheritDoc */
49
51
  get roomTemperature(): number;
50
52
  /** @inheritDoc */
51
- addHumidityCallback(pCallback: (pValue: number) => void): void;
53
+ addHumidityCallback(pCallback: (action: HumiditySensorChangeAction) => void): void;
52
54
  getBelongingHeizungen(): iHeater[];
53
55
  /** @inheritDoc */
54
56
  update(idSplit: string[], state: ioBroker.State, initial?: boolean): void;
55
57
  /** @inheritDoc */
56
58
  checkAutomaticChange(): void;
57
59
  /** @inheritDoc */
58
- addTempChangeCallback(pCallback: (pValue: number) => void): void;
60
+ addTempChangeCallback(pCallback: (action: TemperatureSensorChangeAction) => void): void;
59
61
  /** @inheritDoc */
60
62
  onTemperaturChange(newTemperatur: number): void;
61
63
  /** @inheritDoc */
@@ -8,6 +8,8 @@ const models_1 = require("../../../models");
8
8
  const baseDeviceInterfaces_1 = require("../baseDeviceInterfaces");
9
9
  const device_cluster_type_1 = require("../device-cluster-type");
10
10
  const DeviceCapability_1 = require("../DeviceCapability");
11
+ const humiditySensorChangeAction_1 = require("../../../models/action/humiditySensorChangeAction");
12
+ const temperatureSensorChangeAction_1 = require("../../../models/action/temperatureSensorChangeAction");
11
13
  class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
12
14
  constructor(pInfo) {
13
15
  super(pInfo, deviceType_1.DeviceType.HmIpHeizgruppe);
@@ -67,7 +69,7 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
67
69
  set temperature(val) {
68
70
  this._temperature = val;
69
71
  for (const cb of this._temperatureCallbacks) {
70
- cb(val);
72
+ cb(new temperatureSensorChangeAction_1.TemperatureSensorChangeAction(this, val));
71
73
  }
72
74
  }
73
75
  /** @inheritDoc */
@@ -77,7 +79,7 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
77
79
  set humidity(val) {
78
80
  this._humidity = val;
79
81
  for (const cb of this._humidityCallbacks) {
80
- cb(val);
82
+ cb(new humiditySensorChangeAction_1.HumiditySensorChangeAction(this, val));
81
83
  }
82
84
  }
83
85
  /** @inheritDoc */
@@ -115,7 +117,7 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
115
117
  addHumidityCallback(pCallback) {
116
118
  this._humidityCallbacks.push(pCallback);
117
119
  if (this._humidity > 0) {
118
- pCallback(this._humidity);
120
+ pCallback(new humiditySensorChangeAction_1.HumiditySensorChangeAction(this, this._humidity));
119
121
  }
120
122
  }
121
123
  getBelongingHeizungen() {
@@ -155,7 +157,7 @@ class HmIpHeizgruppe extends hmIpDevice_1.HmIPDevice {
155
157
  addTempChangeCallback(pCallback) {
156
158
  this._temperatureCallbacks.push(pCallback);
157
159
  if (this._temperature > baseDeviceInterfaces_1.UNDEFINED_TEMP_VALUE) {
158
- pCallback(this._temperature);
160
+ pCallback(new temperatureSensorChangeAction_1.TemperatureSensorChangeAction(this, this._temperature));
159
161
  }
160
162
  }
161
163
  /** @inheritDoc */