-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsensor.yaml
110 lines (94 loc) · 2.64 KB
/
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
- platform: yr
name: Meteo
monitored_conditions:
- symbol
- temperature
- platform: snmp
name: snmp_wan_in
host: 192.168.1.1
baseoid: 1.3.6.1.2.1.2.2.1.10.1
- platform: snmp
name: snmp_wan_out
host: 192.168.1.1
baseoid: 1.3.6.1.2.1.2.2.1.16.1
#- platform: openweathermap
# name: owm
# api_key: 5bf2dc024f73beecb7c38da5ed25740f
# language: it
# monitored_conditions:
# - weather
# - temperature
# - wind_speed
# - wind_bearing
# - humidity
# - pressure
# - clouds
- platform: time_date
display_options:
- 'time_date'
#- platform: speedtest
# monitored_conditions:
# - ping
# - download
# - upload
- platform: command_line
name: "HASS Uptime"
command: ps -o etimes= -p $(pidof /home/ha/homeassistant/bin/python3 /home/ha/homeassistant/bin/hass -c /home/ha/.homeassistant)
scan_interval: 600
value_template: >-
{% set uptime = value | int %}
{% set seconds = uptime % 60 %}
{% set minutes = ((uptime % 3600) / 60) | int %}
{% set hours = ((uptime % 86400) / 3600) | int %}
{% set days = (uptime / 86400) | int %}
{%- if days > 0 -%}
{%- if days == 1 -%}
1 day
{%- else -%}
{{ days }} days
{%- endif -%}
{{ ', ' }}
{%- endif -%}
{{ '%02d' % hours }}:{{ '%02d' % minutes }}
- platform: mqtt
name: "LUCE Potenza"
state_topic: "tele/POW/SENSOR"
qos: 0
unit_of_measurement: "W"
value_template: "{{ value_json.ENERGY.Power }}"
- platform: mqtt
name: "LUCE Tensione"
state_topic: "tele/POW/SENSOR"
qos: 0
unit_of_measurement: "V"
value_template: "{{ value_json.ENERGY.Voltage }}"
- platform: mqtt
name: "LUCE Consumo di oggi"
state_topic: "tele/POW/SENSOR"
qos: 0
unit_of_measurement: "kWh"
value_template: "{{ value_json.ENERGY.Today }}"
- platform: mqtt
name: "LUCE Consumo di ieri"
state_topic: "tele/POW/SENSOR"
qos: 0
unit_of_measurement: "kWh"
value_template: "{{ value_json.ENERGY.Yesterday }}"
- platform: template
sensors:
internet_speed_in:
friendly_name: 'Internet Speed IN'
value_template: '{{ ((states.input_number.internet_traffic_delta_in.state | float ) / 1000000 ) | round(2) }}'
unit_of_measurement: 'Mbps'
- platform: template
sensors:
internet_speed_out:
friendly_name: 'Internet Speed OUT'
value_template: '{{ ((states.input_number.internet_traffic_delta_out.state | float ) / 1000000 ) | round(2) }}'
unit_of_measurement: 'Mbps'
- platform: statistics
name: 'WAN Traffic In'
entity_id: sensor.internet_speed_in
- platform: statistics
name: 'WAN Traffic Out'
entity_id: sensor.internet_speed_out