-
Notifications
You must be signed in to change notification settings - Fork 0
/
espresense_sensor.yaml
78 lines (75 loc) · 2.34 KB
/
espresense_sensor.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# espresense_sensor.yaml
#
# Copyright (C) 2022-2024 Daniele Bochicchio, All Rights Reserved
# For updates see https://github.com/dbochicchio/reactor-mqtt-contrib
#
# *** IMPORTANT ***
# Every time you update the files, a restart is needed.
---
templates:
# ESPresense binary device
espresense_sensor:
type: BinarySensor
capabilities: ["presence_sensor", "string_sensor", "x_espresense", "wifi_status"]
primary_attribute: presence_sensor.state
requires: [deviceid]
description: ESPresense sensor mapped as binary sensor
contributor_name: "Daniele Bochicchio <[email protected]>"
license: MIT
contributor_url: https://github.com/dbochicchio/reactor-mqtt-contrib
#query:
# topic: "espresense/rooms/%room%/status"
# payload: "update"
# qos: 0
# retain: false
events:
"espresense/devices/%deviceid%/#":
"presence_sensor.state":
json_payload: true
expr: "float(payload.rssi) >= (rssiForHome??-100)"
"string_sensor.value":
json_payload: true
expr: >
float(payload.rssi) >= (rssiForHome??-100)? slice( split(topic, '/'), -1 )[0] : 'not_home'
"x_espresense.rssi": # deprecated
json_payload: true
expr: "float(payload.rssi)"
"x_espresense.raw":
json_payload: true
expr: "float(payload.raw)"
"x_espresense.distance":
json_payload: true
expr: "float(payload.distance)"
"x_espresense.speed":
json_payload: true
expr: "float(payload.speed)"
"x_espresense.interval":
json_payload: true
expr: "float(payload.interval)"
"x_mqtt_device.online": true
# "espresense/rooms/%room%/status":
# "x_mqtt_device.online":
# expr: "payload == 'online'"
"espresense/devices/%deviceid%/telemetry":
"wifi_status.rssi":
json_payload: true
expr: 'payload?.rssi'
# "wifi_status.ssid":
# json_payload: true
# expr: 'payload?.Wifi?.SSId'
"wifi_status.station_ip":
json_payload: true
expr: "payload?.ip"
capabilities:
x_espresense:
attributes:
rssi:
type: real
raw:
type: real
distance:
type: real
speed:
type: real
interval:
type: real