Conbee, Deconz Xiaomi Vibration sensor issues

Thank you Rasser.

If I subscribe to deconz_event in Developer Tools -> Events [START LISTENING] I see nothing for Vibration sensor.

Example for my Tradfri remote control:

{
    "event_type": "deconz_event",
    "data": {
        "id": "tradfri_remote_control",
        "unique_id": "ec:1b:bd:ff:",
        "event": 1002
    },
    "origin": "LOCAL",
    "time_fired": "2020-01-22T09:44:29.131540+00:00",
    "context": {
        "id": "9d36bb086a0648919f",
        "parent_id": null,
        "user_id": null
    }
}

My vibration sensor is working, because I created a test

- id: '1579210113408'
  alias: Check mailbox.
  description: ''
  trigger:
  - device_id: cddb61386a8c443493b3
    domain: binary_sensor
    entity_id: binary_sensor.vibration_sensor
    platform: device
    type: motion
  condition: []
  action:
  - data:
      message: Message.
    service: notify.notify

I created this automation on this page:

…but because the subscribe to event is not working, how do I know values for:

event_data:
        id: XXXX
        event: XXXX

Anyone? I can’t find any event for vibration sensor. Maybe something changed in later versions, because sensor is now a separate entity?

Zigbee sensors are either having a state (on/off or a value) or they are stateless sensors.

If a sensors has a state they are represented as sensors in Home Assistant. E.g. a binary sensor for moving or not moving and a % value for a battery

Remote controls / push button switches are stateless. They send an event when you push a button. Once the button is released the switch has no state. It is not on or off.

So a vibration sensor changes between vibration and no vibration. It is on as long as it vibrates. So it is a binary_sensor with on and off.

A remote control with buttons sends events.
But it has a battery sensor that reports level which is a “sensor” in HA

Kenneth

The problem is that this vibration sensor has a function “tilt” alert/reporting, not only vibration alert.

Yes. I have this vibration sensor. It creates a binary_sensor which is on or off.
When it changes state to on you can read the attributes of the this binary sensor.

You can see the attribute names and values in the Developer tools -> states.

Mine currently says

on: true
temperature: 28
orientation: 10,-74,13
tiltangle: 8
vibrationstrength: 8
friendly_name: Washer Vibration
device_class: none

Hi, would anybody know how to use the temperature below value from the state as an entity for temperature?

'on': true
temperature: 19
orientation:
  - 7
  - 71
  - 17
tiltangle: 106
vibrationstrength: 4
friendly_name: Cat Door Vibration
device_class: vibration

You can create a sensor like this:

sensor:
  - platform: template
    sensors:
      temperature_cat_door_vibration:
        friendly_name: "Cat Door Temperature"
        unit_of_measurement: '°C'
        value_template: "{{ state_attr('binary_sensor.cat_door_vibration', 'temperature') }}"
1 Like