Home Assistant и Yandex Transport

Аватар автора
JS Project Experiments
Компонент Home Assistant "Яндекс-Транспорт". Не самый полезный, но вполне интересный. Подключаем, изучаем настройки, разбираемся с особенностями использования. Код из видео: # SENSOR sensor: - platform: yandex_transport stop_id: 9642162 name: bus_station_1 - platform: yandex_transport stop_id: 9642162 name: bus_station_1_with_routes routes: - 12 - 116 - т18 - т54 - platform: template sensors: bus_to_subway_min: value_template: "{{ ((as_timestamp(states(&- as_timestamp(now())) / 60) | round(2) }}" unit_of_measurement: 'мин' friendly_name: "Автобус в метро" # LOVELACE views: - title: Work path: work id: work icon: mdi:dev-to cards: - type: entities title: Alarm show_name: true show_state: true show_header_toggle: false entities: - sensor.bus_station_1 - sensor.bus_station_1_with_routes - sensor.bus_to_subway_min # TEMPLATE State: {{ states.sensor.bus_station_1.state }} Attributes: {{ states.sensor.bus_station_1.attributes }} т54: {{ states.sensor.bus_station_1.attributes[&}} т54[0]: {{ states.sensor.bus_station_1.attributes[&}} Times in cicle: {% for time in states.sensor.bus_station_1.attributes[&-%} {%- if loop.first %}{% elif loop.last %}, {% else %}, {% endif -%} {{ time }} {%- endfor %} * * * * *

0/0


0/0

0/0

0/0