-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples for IDFM #6
Comments
Here is also an example of automation that I came up with (to prevent me from being late to my appointments because the next train was in too much time) alias: metro
description: "affiche un message donnant les horaires des prochains train (basé sur les informations temps réel et le temps de trajet jusqu'a la station) lorsqu'un evenement du calendrier approche et que vous etes encore chez vous"
trigger:
- platform: time_pattern
hours: '*'
minutes: /5
seconds: '*'
condition:
- condition: state
entity_id: binary_sensor.portable
state: 'on'
- condition: state
entity_id: calendar.cours
state: 'off'
- "{{ (as_timestamp(state_attr('calendar.cours','start_time'), 0) - as_timestamp(now(), 0)) < (30*60) }}"
action:
- service: input_text.set_value
data:
value: '{% set t1 = ((as_timestamp(states(''sensor.le_kremlin_bicetre_la_courneuve_8_mai_1945_0''),
0) - as_timestamp(now()))/60)|round %}
{% set t2 = ((as_timestamp(states(''sensor.le_kremlin_bicetre_la_courneuve_8_mai_1945_1''),
0) - as_timestamp(now()))/60)|round %}
{% set t3 = ((as_timestamp(states(''sensor.le_kremlin_bicetre_la_courneuve_8_mai_1945_2''),
0) - as_timestamp(now()))/60)|round %}
{% if t1 >= 8 %}
Prochain train dans {{ t1 }} min, le suivant dans {{ t2 }} min
{% elif t2 >= 8 %}
Prochain train dans {{ t2 }} min, le suivant dans {{ t3 }} min
{% else %}
Prochain train dans {{ t3 }} min
{% endif %}
'
target:
entity_id: input_text.afficheur_txt
mode: single |
it's clever ! |
I don't know, if it is the right place. The error on dedicated train/bus line has to be displayed on several lines. Then , I create the following card on dashboard (with sensor type: custom:multiline-entity-card
name: RER B Pb
entity: binary_sensor.idfm_rer_b_robinson_chatenay_malabry
attribute: description
show_name: true
card_mod:
style: |
ha-card .value {
color: blue;
font-size : 15px;
} |
Yes, I think that we could use this issue to share examples for this integration. Thanks for sharing ! |
Voilà la card que je me suis faite pour mes besoins :),
|
To use advanced filtering for time entities, see this issue: #25 |
Here a template to get remaining time to next train/bus/...
It allows to get a curve .
Hereafter an example, with the sensor for train RERB at robinson station.
In configuration.yaml,
And the results :
NB: on left side, the value is not relevant (due to test to find the right formula)
The text was updated successfully, but these errors were encountered: