homeassistant-fullykiosk icon indicating copy to clipboard operation
homeassistant-fullykiosk copied to clipboard

Add support for motion detection

Open cgarwood opened this issue 4 years ago • 6 comments

Fully has a built-in motion detection system using the device camera. However, there's not a REST endpoint (and polling wouldn't work anyway for motion detection).

Newer versions of Fully have an MQTT client, and publish motion events to MQTT. We'd need to add in MQTT support to listen for these events.

cgarwood avatar Apr 24 '20 00:04 cgarwood

Workaround: if FKB is configured to turn on the screen on motion you could use that to detect motion / presence.

SamMousa avatar Feb 17 '21 15:02 SamMousa

Workaround: if FKB is configured to turn on the screen on motion you could use that to detect motion / presence.

But there is currently no sensor to detect if the screen is on or off? The light.*_screen entity doesn't response accurate if the screen is on or off..

/update My fault, Home Assistant just doesn't update the sensor so fast.. need to figure out how to create an own sensor for this...

Senbei123 avatar Mar 27 '21 16:03 Senbei123

Workaround: if FKB is configured to turn on the screen on motion you could use that to detect motion / presence.

But there is currently no sensor to detect if the screen is on or off? The light.*_screen entity doesn't response accurate if the screen is on or off..

/update My fault, Home Assistant just doesn't update the sensor so fast.. need to figure out how to create an own sensor for this...

Did you meanwhile?

bcutter avatar Sep 20 '21 19:09 bcutter

Actually OP is correct. MQTT is needed for the live updates

SamMousa avatar Nov 29 '21 18:11 SamMousa

I've got separate motion, sound, and device vibration detectors going with some manual MQTT entities. Seems like this could be a part of the integration pretty easily. If Fully only exposes the right events and data over MQTT, then the integration can implement it internally as an MQTT sensor, am I right?

First, I changed the topics in the Fully config to be less noisy: Device info topic: $appId/$deviceId Events topic base: $appId/$deviceId/event

Then, these go in your configuration.yaml or some include thereto:

binary_sensor:
  - platform: mqtt
    name: "Fully Kiosk Motion Sensor"
    unique_id: "fully_kiosk_{YOUR_DEVICE_ID}_motion"
    availability_topic: "fully/{YOUR_DEVICE_ID}"
    availability_template: |-
      {{ 'online' if value_json.motionDetectorStatus > 0 else 'offline' }}
    device_class: motion
    off_delay: 60
    state_topic: "fully/{YOUR_DEVICE_ID}/event/onMotion"
    value_template: |-
      {{ 'ON' if value_json.type == 'visual' and value_json.event == 'onMotion' }}
  - platform: mqtt
    name: "Fully Kiosk Sound Sensor"
    unique_id: "fully_kiosk_{YOUR_DEVICE_ID}_sound"
    availability_topic: "fully/{YOUR_DEVICE_ID}"
    availability_template: |-
      {{ 'online' if value_json.motionDetectorStatus == 2 else 'offline' }}
    device_class: sound
    off_delay: 60
    state_topic: "fully/{YOUR_DEVICE_ID}/event/onMotion"
    value_template: |-
      {{ 'ON' if value_json.type == 'acoustic' and value_json.event == 'onMotion' }}
  - platform: mqtt
    name: "Fully Kiosk Movement Sensor"
    unique_id: "fully_kiosk_{YOUR_DEVICE_ID}_movement"
    availability_topic: "fully/{YOUR_DEVICE_ID}"
    availability_template: |-
      {{ 'online' if value_json.mqttConnected else 'offline' }}
    device_class: moving
    off_delay: 60
    state_topic: "fully/{YOUR_DEVICE_ID}/event/onMovement"
    value_template: |-
      {{ 'ON' if value_json.event == 'onMovement' }}

zetlen avatar Jan 23 '22 01:01 zetlen

Very interested in this feature. I currently use the screen sensor (turn on screen on motion detection) to trigger light switch automation in my kitchen. However I find it laggy and slow. If only the motion sensor would be exposed, maybe response times would be better

comedido avatar Jan 26 '23 17:01 comedido