FGS-213 + PIR + Switch

Hi!

I have:

  • FGS-213 switch to control a light (working :ok_hand: )
  • PIR sensor to switch the light on on presence detection (working :ok_hand: )
  • A wall switch, wired to the S1 entry of FGS for local light control (working :ok_hand: )

My problem is:

  • I switch the light on with the wall switch, the light is on
  • The PIR sensor see a move, the light stay on
  • After 60s without motion in front of the PIR, the light is switched off

My need: how to use the wall switch to force the light on, regardless of the PIR input?

I think it’s just a config of the FGS, but I can’t find it out :thinking:

Thanks!
Mike

Without knowing your automations, it’s hard.

But here’s what I do.


- alias: Light on motion
  trigger:
    - platform: state
      entity_id: binary_sensor.pir_motion
      to: 'on'
  conditions:
    # Only do this if the light was off to begin with. If the light was on,
    # don't auto turn it off in 60 seconds. 
    condition: state
    entity_id: light.light_id
    state: 'off'
  action:
    - service: light.turn_on
      entity_id: light.light_id
    - delay: "00:01:00"
    - service: light.turn_off
      entity_id: light.light_id

So the auto shutoff will only happen if the PIR is what turned it on. If there is a way to turn on the light before PIR trigger, this would be sufficient. It’s a little harder if the motion triggered the light and you want to override. When the light is on, the switch is going to turn it off no matter what you do. You could just quickly turn it off/on to override this. Without a custom switch and custom actions (hold), there’s not much you’ll be able to do.

I also like to make my on/off actions as scripts so that I can cancel the scripts.

script:
  bathroom_light_timer:
    sequence:
      - service: homeassistant.turn_on
        entity_id: light.bathroom_light
      - delay: "00:{{minutes}}:00"
      - service: homeassistant.turn_off
        entity_id: light.bathroom_light

Sadly you can’t run the same script multiple times, so I can’t just make a generic light_timer and pass in an entity id. You can only run a script one at a time. Now I just use the script like so.


- alias: Light on motion
  trigger:
    - platform: state
      entity_id: binary_sensor.pir_motion
      to: 'on'
  conditions:
    # Only do this if the light was off to begin with. If the light was on,
    # don't auto turn it off in 60 seconds. 
    condition: state
    entity_id: light.light_id
    state: 'off'
  action:
    - service: script.bathroom_light_timer
      data:
        minutes: "2"

If I want to cancel the auto shutoff part of the automation, I simply have to kill the script.

service: script.turn_off
entity_id: script.bathroom_light_timer

However you can think to kill that script, go for it. Long press on the light switch…using your phone…anything really.

Hi,

Thanks for your answer and all your advices.
Actually I was looking to do it with groups to be gateway independent, but it’s not possible with the Fibaro TriSensor PIR (it’s not able to send group alert depending on lux value).

So I’ll follow your advices and do it with automation.

Thanks,
Mike

Hi,

Long time before my first post… wasn’t a priority last months…
But I’ve a working solution:

  • Automation “A” to light on when a motion is detected and lux is low
  • Automation “B” to light off when motion is clear
  • Automation “C” to disable automation “A” and “B” when the wall plug is switched ON
  • Automation “D” to enable automation “A” and “B” when the wall plug is switched OFF

For “A” and “B” the trigger is on state change on the motion binary sensor.
For “C” and “D” the trigger is on zwave_js notification : the FGS-213 send a notification on S1 button switched.
The only thing is that the FGS send the same notification is the switch is turn on or off. So the tricks is to trigger on the event, and add a condition on the light state. Switched + light ON = switched form off to on > disable automations A and B. And the contrary if light if OFF.