HA ma co takiego jak “Pomocnik” , możesz go wykorzystać do utworzenia sensora i nie ingerować w pliku konfiguracyjnym.
Co do do pliku configuration.yaml
proponuje rozbić go na poszczególne sekcje
...
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
light: !include light.yaml
switch: !include switch.yaml
camera: !include camera.yaml
sensor: !include sensor.yaml
history: !include history.yaml
binary_sensor: !include binary_sensor.yaml
template: !include template.yaml
I teraz tworzyć wpisu w odpowiednim pliku.
Np.
W binary_sensor.yaml
- platform: ping
host: 192.168.68.123
name: "Zamek lock dostępny"
count: 1
scan_interval: 10
W sensor.yaml
- platform: history_stats
name: Ile razy płakał
entity_id: light.placz_xxxxx_alexa
state: "on"
type: count
start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now() }}"
W template.yaml
- sensor:
- name: Salon Grzejnik ON
state: >-
{% if states('sensor.living_room_heating')|int(0) > 1 %}
on
{% else %}
off
{% endif %}