Fibaro multisensor

Had my sensor working like a charm, upgraded home assistant; from there things fell apart.
Working config looked like


sensors.yaml:
- platform: template
  sensors:
    fibaro_multisensor_motion:  
      value_template: "{%if states.sensor.fibaro_system_fgms001_zw5_motion_sensor_burglar.state == '8' %}motion detected{% elif states.sensor.fibaro_system_fgms001_zw5_motion_sensor_burglar.state == '3' %}tamper{% elif states.sensor.fibaro_system_fgms001_zw5_motion_sensor_burglar.state == '0' %}standby{% endif %}"
      friendly_name: "Fibaro Motion"

automations.yaml:
- alias: Lights on based on motion
  trigger:
    platform: state
    entity_id: binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor
    to: 'on'
  condition:
    condition: or
    conditions:
      - condition: sun
        after: sunset
        after_offset: "00:30:00"
      - condition: sun
        before: sunrise
        before_offset: "-00:30:00"
  action:
    service: homeassistant.turn_on
    entity_id: switch.neo_coolcam_power_plug_12a_switch_3
- alias: Lights off based on no motion
  trigger:
    platform: state
    entity_id: binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor
    to: 'off'
    for:
      minutes: 1
      seconds: 30
  condition:
    condition: state
    entity_id: switch.neo_coolcam_power_plug_12a_switch_3
    state: 'on'
  action:
    service: homeassistant.turn_off
    entity_id: switch.neo_coolcam_power_plug_12a_switch_3


And that was working in harmony, until update; trying to convert it so it’s functional within editor and such.

automations.yaml:
- id: '6982383996'  
  alias: Lights on based on motion hall
  trigger:
  - entity_id: binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor
    from: 'off'
    platform: state
    to: 'on'
  condition:
  - after: sunrise
    after_offset: "-00:30:00"
    before: sunset
    before_offset: "00:30:00"
    condition: sun 
  action:
    entity_id: switch.neo_coolcam_power_plug_12a_switch_3
    service: homeassistant.turn_on
- id: '323868583438'  
  alias: Lights off based on no motion hall
  trigger:
  - entity_id: binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor
    platform: state
    to: 'off'
    for:
      minutes: 1
      seconds: 30
  condition:
    - condition: state
      entity_id: switch.neo_coolcam_power_plug_12a_switch_3
      state: 'on'
  action: 
    entity_id: switch.neo_coolcam_power_plug_12a_switch_3
    service: homeassistant.turn_off


Problem is that it never turns off, suggestions to why ?

Please follow the big blue box at the top of the page and format your code so it is readable.

I’m sorry for my spoopid :smile:

1 Like

Hi Jewalin,
I too have Fibaro motion sensors, and have noticed problems over last few builds.

Not sure if coming from ZWave controller or not.

There was a bug of extra underscores, but believe correct in last build. Check for “__”

Here is a config to show you a sample, but you are using templates, so may not be helpful.

####################################################################

Motion in Bedroom

####################################################################

  • id: Motion in BR # Normal Weekdays
    alias: ‘Motion in BR’
    trigger:
    platform: state
    entity_id: binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor_2, binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor_3
    to: ‘on’
    condition:
    • condition: numeric_state
      entity_id: ‘sensor.fibaro_system_fgms001zw5_motion_sensor_luminance_2’ # Read LUX levels to ensure room is dark
      below: ‘50’
    • condition: time
      after: ‘06:40:00’
      before: ‘22:15:00’
    • condition: time
      weekday:
      • mon
      • tue
      • wed
      • thu
      • fri
        action:
    • service: homeassistant.turn_on
      entity_id:
      • switch.mbr_bryan_light
    • service: homeassistant.turn_on
      data_template:
      entity_id: light.b2mbrled
      brightness: 255
      color_name: >-
      {% if is_state(“sensor.dark_sky_icon”, “snow”) %}
      blue
      {% elif is_state(“sensor.dark_sky_icon”, “partly-cloud-day”) %}
      yellow
      {% elif is_state(“sensor.dark_sky_icon”, “rain”) %}
      white
      {% else %}
      white
      {% endif %}

~Bryan

One thing I would suggest doing is removing the before_sunset and after_sunset from your automatons, and use the sun.sun elevation level instead. e.g. below.

  - condition: template
    value_template: "{{ states.sun.sun.attributes.elevation  | int < 10 }}"

This example makes an automation work if the sun is below 10°. You can play around with the sun angle and see what works best for you depending on your location.

Also, double check the breaking changes that are listed for whatever the version of HA is that you have upgraded to (you haven’t mentioned it)

Oh well my YAML-skills arent that good, you entered no formatting so hard for me to replicate :smiley:
Maybe you thought about everything, but where I live, sun never sets in the summer; so useless to turn light on :wink:
So to get it working perfectly I would prolly have to have some solution that looks like yours; mine was quite dumb to start with.

Hi, I have notices that HA changed entity names. This applied to all Fibaro switches, motion sensors, etc.

note the zw5 has changed.

Old Syntax:

`sensor.fibaro_system_fgms001zw5_motion_sensor_luminance_2

New Syntax:

`

[sensor.fibaro_system_fgms001_zw5_motion_sensor_luminance_2](http://192.168.178.6:8123/dev-state#)

Just in case it helps. Check there.

1 Like

After a lot of tinkering, this was the solution I came up with, not as elegant but uses lightsensor:

- id: '1549238398649'
  alias: Jordglob light on
  trigger:
  - entity_id: binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor
from: 'off'
platform: state
to: 'on'
  condition:
  - below: '50'
condition: numeric_state
entity_id: sensor.fibaro_system_fgms001_zw5_motion_sensor_luminance
  - condition: state
entity_id: switch.neo_coolcam_power_plug_12a_switch_3
state: 'off'
  action:
  - data:
  entity_id: switch.neo_coolcam_power_plug_12a_switch_3
service: homeassistant.turn_on
- id: '1549239062677'
  alias: Jordglob Light Off
  trigger:
  - entity_id: binary_sensor.fibaro_system_fgms001_zw5_motion_sensor_sensor
for:
  minutes: 1
  seconds: 30 
platform: state
to: 'off'
  condition: []
  action:
  - data:
  entity_id: switch.neo_coolcam_power_plug_12a_switch_3
service: homeassistant.turn_off

Sure there are way more cooler ways to get around this, but my expertise is limited :slight_smile: Thanks for all the imput!