iguza
May 19, 2025, 8:18pm
1
Hello. I’m working on a project where I need my motion sensor and touch sensors to be displayed on a map.Tell me how to do this, I saw two options by creating a person in the configuration or add a tracker device.
configuration.yaml
mqtt:
device_tracker:
- name: touch_sensors_tracker
state_topic: "home/sensor_tracker/state"
json_attributes_topic: "home/sensor_tracker/attributes"
payload_home: "home"
payload_not_home: "not_home"
person:
- name: Touch Sensors Location
id: touch_sensors
device_trackers:
- device_tracker.touch_sensors_tracker
default_config:
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
To be displayed on a map, a sensor must have latitude and longitude as attributes.
iguza
May 21, 2025, 7:00pm
3
Can you help me with this, where exactly should I specify these coordinates in the configuration file?
I will attach below my file with esphome so that you understand what entities I have in the project
esphome:
name: esp32
friendly_name: esp32
esp32:
board: esp32dev
framework:
type: arduino
esp32_touch:
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
platform: esphome
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
ssid: ""
password: ""
captive_portal:
i2s_audio:
i2s_lrclk_pin: GPIO33
i2s_bclk_pin: GPIO19
media_player:
- platform: i2s_audio
name: ESPHome I2S Media Player
dac_type: external
i2s_dout_pin: GPIO22
mode: mono
binary_sensor:
- platform: esp32_touch
name: "Touch Sensor T0"
pin: GPIO4
threshold: 700
- platform: esp32_touch
name: "Touch Sensor T1"
pin: GPIO15
threshold: 700
- platform: esp32_touch
name: "Touch Sensor T2"
pin: GPIO32
threshold: 700
- platform: esp32_touch
name: "Touch Sensor T3"
pin: GPIO27
threshold: 700
- platform: esp32_touch
name: "Touch Sensor T4"
pin: GPIO14
threshold: 700
- platform: esp32_touch
name: "Touch Sensor T5"
pin: GPIO12
threshold: 700
- platform: gpio
pin: 13
name: "PIR Sensor"
device_class: motion
I will be very grateful for your help
iguza
May 21, 2025, 7:29pm
4
I’ve got something, now i need to make them appear only when they’re active
type: map
entities:
- entity: zone.pir_sensor
- entity: zone.touch_sensor_t0
- entity: zone.touch_sensor_t1
- entity: zone.touch_sensor_t2
- entity: zone.touch_sensor_t3
- entity: zone.touch_sensor_t4
- entity: zone.touch_sensor_t5
and configuration.yaml
default_config:
zone:
- name: "Touch Sensor T0"
latitude: 48.9226
longitude: 24.7111
radius: 10
icon: mdi:gesture-tap
- name: "Touch Sensor T1"
latitude: 48.9227
longitude: 25.7112
radius: 10
icon: mdi:gesture-tap
- name: "Touch Sensor T2"
latitude: 48.9228
longitude: 27.7113
radius: 10
icon: mdi:gesture-tap
- name: "Touch Sensor T3"
latitude: 48.9229
longitude: 28.7114
radius: 10
icon: mdi:gesture-tap
- name: "Touch Sensor T4"
latitude: 48.9230
longitude: 30.7115
radius: 10
icon: mdi:gesture-tap
- name: "Touch Sensor T5"
latitude: 48.9231
longitude: 31.7116
radius: 10
icon: mdi:gesture-tap
- name: "PIR Sensor"
latitude: 48.9232
longitude: 24.7117
radius: 10
icon: mdi:motion-sensor