Hello!
I am starting with nodered trying to convert yaml automations to nodered as training but I am stuck now, maybe you can help me.
I have automations where if my pir sensor and microweave sensor is on and it is night (30min before sunset and 30min before sunrise) turn on light and turn off if there is no movement. There is code:
- alias: Włączenie światła w trakcie nocy
trigger:
- platform: state
entity_id: binary_sensor.pokoj_gniewka
to: 'on'
- platform: state
entity_id: binary_sensor.pokoj_gniewka_2
to: 'on'
condition:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.pokoj_gniewka
state: 'on'
- condition: state
entity_id: binary_sensor.pokoj_gniewka_2
state: 'on'
- condition: state
entity_id: light.lampka_nad_monitorem
state: 'off'
- condition: or
conditions:
- condition: sun
after: sunset
after_offset: "-00:30:00"
- condition: sun
before: sunrise
before_offset: "-00:30:00"
action:
entity_id: light.lampka_nad_ubraniami
service: light.turn_on
- alias: Wyłączenie światła przy nie wykryciu ruchu przez 1 min
trigger:
- entity_id: binary_sensor.pokoj_gniewka
platform: state
to: 'off'
for:
minutes: 1
- entity_id: binary_sensor.pokoj_gniewka_2
platform: state
to: 'off'
for:
minutes: 1
condition:
condition: and
conditions:
- condition: state
entity_id: binary_sensor.pokoj_gniewka
state: 'off'
- condition: state
entity_id: binary_sensor.pokoj_gniewka_2
state: 'off'
action:
entity_id: light.lampka_nad_ubraniami
service: light.turn_off
Can somone tell me how do it on nodered? I could leave it that way but i want to be better at it