Automations with Fibaro motion sensor: work with accelerometer, vibration, orientation in space

Background & Motivation:

The Fibaro Motion Sensor FGMS-001 is a powerful sensor that can detect motion, measure temperature and luminosity. Yet there’s another feature which I did not seen in ANY comfort-oriented automation, except for very specific “do not tamper with my security device”-scenarios: the burglar sensor. “The Motion Sensor has a built-in accelerometer [which reports] on the sensor’s orientation in space by sending report after triggering tamper alarm” (source: Fibaro motion sensor manual). In consequence, this sensor is able to detect the tiniest “movement in space”, such as vibrations, up-down or left-right movements. Even the finest acceleration can be measured as I found out during my tests.

So why all these experiments? We are currently in the process of building a 3-story house and the 2 upper floors will be connected by open-string stairs (see example picture below). Since I want to be able to measure temperature, motion, etc. in almost every room and thus equip them with Fibaro motion sensors anyway, I thought it would be interesting to push this concept a little further. So how about taking into consideration “vibrations” in automations?

Real-life use cases:

Think about anything in your household that moves or “accelerates” while turned on or something/somebody makes them move or vibrate:

  • washing machine
  • any kind of doors (gates, main entry doors, garage doors, sliding doors, etc.)
  • windows
  • open-string stairs
  • vacuum cleaner
  • coffee machine
  • awnings on the terrace which get shaken by wind gusts
  • grass mower
  • Piano corpus (vibrates when piano plays)
    …in short: anything that can “move” in your household :slight_smile:

What if you could make use of these moving or vibrating objects in your comfort or security-based home automations?

My initial use case: light automation triggered by vibrations on stairs

In this example, my open-string stairs will connect the first floor with the second floor. How would you build an intelligent light automation that switches on the light in the destination corridor as soon as somebody uses the stairs to go up or down, whilst turning off lights in the corridor you came from?

Here’s the code that I put together in order to illustrate the logic behind my approach. Two main thoughts:

  1. If you go upstairs, then the motion sensor will have detected you before you step on the stairs and create any vibration. Conclusion: you you up!
  2. If you go downstairs, the motion sensor will not have detected anything before you step on the stairs and create any vibration. Conclusion: you go downstairs!

You can now use this information in order to add other conditions (luminosity, night/day, etc.) and actions (light on/off, heating on/off, etc.)

- alias: 'auto light on-off with burglar'
  initial_state: true
  trigger:
    - platform: state
      entity_id: sensor.fibaro_system_fgms001zw5_motion_sensor_burglar
      to: '3'
  action:
    service_template: >
      {% if states.binary_sensor.fibaro_system_fgms001zw5_motion_sensor_sensor.state == "on" %} 
        light.turn_off
      {% else %}
        light.turn_on  
      {%endif%}
    data:
      entity_id: light.zipato_unknown_type0002_id0003_level

My second use case: automate light in bathrooms, etc.

What if you took the above example and installed the sensor inside the bathroom, right onto the door? Once the door swings open, the sensor reports back with a burglar event and this kicks-off an automation. For short “visits” in the bathroom or similar I would recommend to the decrease the “alarm cancellation delay” (setting 22), for the automation to work properly. Otherwise, in case you leave the bathroom after 10 seconds, the trigger for turning off the light won’t kick in most likely.

Settings & Considerations:

If you already own a Fibaro Multisensor, then you’ll have to adjust some settings in the z-wave configuration tab, so that the sensor works fine with burglar/vibration automations:

  • (20) Tamper - sensitivity -> put “1” for highest sensitivity
  • (22) Tamper - alarm cancellation delay -> depending on your use case
  • (24) Tamper - operating modes -> put to setting 2 (tamper and orientation in space)

Please see the official manual for more information: https://manuals.fibaro.com/content/manuals/en/FGMS-001/FGMS-001-EN-T-v2.1.pdf

Limitations:

  • Not all objects can be physically equipped with a sensor or it wouldn’t make sense to install a $50 sensor on them (e.g. vacuum cleaner). In the end however, it’s your personal use cases which determines the sense or non-sense of such an installation.

  • You cannot tell (at least I didn’t find anything) the direction of the acceleration.

  • If the correct positioning of the burglar sensor is critical for your use case, please keep in mind that the accuracy of the other 3 sensors could deteriorate. Imagine you install the Fibaro motion sensor as per the example in the above picture: The motion sensor would have difficulties to accurately report motion under some circumstances, due to its suboptimal position in the room. So please be aware of possible trade-offs before you start implementing!

As usual, looking forward to your comments or questions. Please be aware that the code provided is not exhaustive and that my main objective is to get across new approaches for automation use cases rather than a complete set of code.

Hang loose,
Markus

5 Likes

Hi,
just a question.
Did you use the sensor only with HA, or is there another box involved? I only found out, that I need a Fibaro box, which did most the same than HA, but only with Fibaro products and HA only talk with this box.
With best regards
Gerhard