2024年11月24日星期日 上午7:38:20

基于wifi无线信号来检测人体 -HA Android App Wifi Connection sensor for presence detection

2 年 前
#121 引用
Quick start

Install ha app on s21
connetct to ha server on ha app -> you will get sm-g9910 app devices
add device-sm-g9910 app devices to person -> you will get device_tracker.sm-g9910




An Empirical Study of WiFi-based Radio Tomographic Imaging

https://www.researchgate.net/publication/323788309_An_Empirical_Study_of_WiFi-based_Radio_Tomographic_Imaging

大概意思是用一圈WIFI设备把房间围起来,然后实时监测各个节点的WIFI信号变化,来推断哪里有人。听上去不是啥难事,但是实际上应用起来还是要动些脑筋,

电子围栏?
0
2 年 前
#126 引用
yolo属于多物体识别,还得靠摄像头,我司已研发出wifi人体探测,
0
1 年 前
#22409 引用
HA Android App Wifi Connection sensor for presence detection
https://community.home-assistant.io/t/ha-android-app-wifi-connection-sensor-for-presence-detection/579685

Here is an example how i did this with a template binary_sensor:



template:
  - binary_sensor:
      - unique_id: smartphone_mike_wlan_home_connected
        state: "{{ is_state('sensor.YOURPHONENAME_wifi_connection', 'YOUR_SSID') or is_state('sensor.YOURPHONENAME_wifi_connection', 'YOUR_SSID_5GHz') or is_state('sensor.YOURPHONENAME_wifi_connection', 'GastWIFI') }}"
        delay_off:
          seconds: 10
        attributes:
          friendly_name: "smartphone_mike_wlan_home_connected"



This turns on when connected to one of the three SSIDs and off if it is not connected for about 10 seconds. This works really good on my Samsung S21, even when the wifi of the phone goes to sleep (which it does on every phone i think when it is not used for a longer time), the sensor still says you are connected. Only when coming home sometimes it is a little bit slow when the phone is in my pocket and screen is off.


sensor.sm_g9910_wifi_connection



{{ states.sensor.wu_qiang_de_iphone_connection_type }}
0
1 年 前
#22410 引用
python_script.set_state没有找到这个服务 - Unable to find service python_script.set_state

https://community.home-assistant.io/t/using-the-my-wifi-ssid-for-presence-detection/420978/25

Home Assistant Python Script to force set an entity state

http://192.168.2.50:38123/config/automation/edit/1694552277394


@raspberrypi:/# find / -name "set_state.py"





Scripts are placed in a python_scripts folder under the configuration directory, in my case it is /home/homeassistant/.homeassistant/python_scripts. You then need to either restart Home Assistant or click RELOAD SCRIPTS under Configuration, General, Configuration Reloading.

source:https://community.home-assistant.io/t/how-to-manually-set-state-value-of-sensor/43975/6?u=msly


Manual Installation Hints


Create <config>/python_scripts folder if you haven't already.

Copy set_state.py into the <config>/python_scripts folder.

Add python_script: to <config>/configuration.yaml if you haven't already.

python_script:

Restart Home Assistant.


source:https://github.com/rodpayne/home-assistant

step by step

cd /home/homeassistant20221103/.homeassistant
mkdir python_scripts
new file set_state.py

Add python_script: to /home/homeassistant20221103/.homeassistant/configuration.yaml

RELOAD SCRIPTS under Configuration
goto:http://192.168.2.50:38123/developer-tools/yaml



useful links
https://github.com/rodpayne/home-assistant/blob/88875142d709ed9f0aa738d68f61ab533c6eb9d5/.homeassistant/python_scripts/set_state.py

https://github.com/xannor/hass_py_set_state/blob/master/python_scripts/set_state.py
0
11 个月 前
#23939 引用


{{ states.sensor.wu_qiang_de_iphone_connection_type }}

{{ states.sensor.wu_qiang_de_iphone_ssid}}





output



<template TemplateState(<state sensor.wu_qiang_de_iphone_connection_type=Wi-Fi; icon=mdi:wifi, friendly_name=吴强的iPhone Connection Type @ 2023-11-22T03:04:18.745137+08:00>)>

<template TemplateState(<state sensor.wu_qiang_de_iphone_ssid=ChinaNet-94EA-5G; icon=mdi:wifi, friendly_name=吴强的iPhone SSID @ 2023-11-22T03:04:18.746115+08:00>)>

0
11 个月 前
#24074 引用

I have the WiFi sensor in a bayesian sensor with GPS and bluetooth all rolled into one, It’s working perfectly



- platform: bayesian
  prior: 0.6
  name: Dad Presence
  device_class: 'presence'
  probability_threshold: 0.9
  observations:
  - entity_id: 'device_tracker.sm_g975f'
    prob_given_true: 0.9
    prob_given_false: 0.4
    platform: 'state'
    to_state: 'home'
  - entity_id: 'device_tracker.galaxy_s10'
    prob_given_true: 0.9
    prob_given_false: 0.2
    platform: 'state'
    to_state: 'home'
  - entity_id: 'sensor.wifi_connection'
    prob_given_true: 0.9
    prob_given_false: 0.2
    platform: 'state'
    to_state: 'Pool area'



https://community.home-assistant.io/t/wifi-presence-detection/168258/12?u=msly


https://www.home-assistant.io/integrations/bayesian/
0