Ik kan je niet helemaal volgen, wil je dus alleen 's nachts een andere kleur ALS de lamp is aangegaan via de knop? Of wil je in het algemeen een andere kleur 's nachts, ongeacht of de lamp wordt getriggerd door de knop of de motion sensor?Lelletje schreef op vrijdag 6 augustus 2021 @ 12:25:
Ik kom er even niet uit:
Bewegingssensor en lamp:
code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 - id: '1608481005359' alias: 'Motion: Light Overloop Zolder' description: '' trigger: - type: motion platform: device device_id: f9e774e9176a7dd3e7e0745ad969fec8 entity_id: binary_sensor.presence_2 domain: binary_sensor condition: - condition: or conditions: - condition: sun before: sunrise before_offset: +01:00:00 - condition: sun after: sunset after_offset: -01:00:00 - condition: state entity_id: input_boolean.set_zolder_on_off state: 'off' action: - service: light.turn_on target: device_id: bdc454edaee8455f80a80c4f12b792a2 data: brightness_pct: 1 rgb_color: - 0 - 0 - 255 - delay: hours: 0 minutes: 1 seconds: 0 milliseconds: 0 - type: turn_off device_id: bdc454edaee8455f80a80c4f12b792a2 entity_id: light.18455822c44f33b8f650 domain: light mode: single
Lamp met knop aanzetten:
code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 - id: '1614083979152' alias: 'Change: Turn Light Overloop Zolder On' description: '' trigger: - device_id: 9cf03bd9306eb517c3681e42f7202829 domain: deconz platform: device type: remote_button_short_press subtype: turn_on condition: - condition: device type: is_off device_id: bdc454edaee8455f80a80c4f12b792a2 entity_id: light.18455822c44f33b8f650 domain: light action: - service: light.turn_on target: device_id: bdc454edaee8455f80a80c4f12b792a2 data: brightness_pct: 100 rgb_color: - 255 - 255 - 255 - service: input_boolean.turn_on target: entity_id: input_boolean.set_zolder_on_off
Het is hier of 100% brightness of kleur.
Uitleg:
Ik heb een motion sensor die prima werkt als de zon onder is, brightness gaat naar 1%. Na 1 minuut gaat deze weer uit.
Maar ik heb ook een knop die dus naar 100% gaat. Deze lamp blijft altijd aan tot we op de uit knop drukken, vandaar de input boolean.
Nu wil ik voor de nacht dus een andere kleur dan wanneer we op de knop drukken. Hoe kan ik deze 2 combineren?
Het is een Tuya plafondlamp van de Action.
Anyway, je zou gebruik kunnen maken van de chooser om twee verschillende actions te maken afhankelijk van de status van sun.sun of eventueel van het attribuut elevation (of je maakt een template sensor voor je offset, leef je uit
YAML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
| overloop_aan: sequence: choose: - conditions: - condition: state entity_id: sun.sun state: 'below_horizon' - condition: state entity_id: input_boolean.welterusten state: 'off' sequence: - service: light.turn_on entity_id: light.overlooplampen data: transition: 1 brightness_pct: 25 color_temp: 366 - conditions: - condition: state entity_id: sun.sun state: 'below_horizon' - condition: state entity_id: input_boolean.welterusten state: 'on' sequence: - service: light.turn_on entity_id: light.overlooplampen data: transition: 1 brightness_pct: 10 color_temp: 366 default: - service: light.turn_on entity_id: light.overlooplampen data: transition: 1 brightness_pct: 50 color_temp: 366 |