Skip to content

Commit

Permalink
Merge pull request #26 from htvekov/0.7.0-1
Browse files Browse the repository at this point in the history
Update sampl_conf.md
  • Loading branch information
fvanroie authored Aug 21, 2023
2 parents 367b9bd + 63726f7 commit 53a335b
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions docs/integrations/home-assistant/sampl_conf.md
Original file line number Diff line number Diff line change
Expand Up @@ -1042,14 +1042,14 @@ relevant **openHASP-custom-component config:**
{%- if not is_state('weather.openweathermap','unavailable') %}
{%- set update = states('sensor.date') %}
{%- set midnight = now().replace(hour=0, minute=0, second=0, microsecond=0).timestamp() %}
{%- set event = as_timestamp(strptime(state_attr('weather.openweathermap','forecast')[1]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-00T00:00:00+00:00')) %}
{%- set event = as_timestamp(strptime(state_attr('weather.openweathermap','forecast')[1]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-01T00:00:00+00:00')) %}
{%- set delta = ((event - midnight) // 86400) | int %}
{%- if delta == 0 %}
Today
{%- elif delta == 1 %}
Tomorrow
{%- endif %}
{{- event | timestamp_custom(" %-I %p") }}
{{ event | timestamp_custom(" %-I %p") }}
{%- endif %}
- obj: "p5b22" # Forecast temp +1h
Expand All @@ -1067,7 +1067,7 @@ relevant **openHASP-custom-component config:**
properties:
"text": >
{%- if not is_state('weather.openweathermap','unavailable') %}
{%- set hour = as_timestamp(strptime(state_attr('weather.openweathermap','forecast')[3]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-00T00:00:00+00:00')) | timestamp_custom("%-H") | int %}
{%- set hour = as_timestamp(strptime(state_attr('weather.openweathermap','forecast')[3]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-01T00:00:00+00:00')) | timestamp_custom("%-H") | int %}
{%- if 4 <= hour < 6 %}
Dawning
{%- elif 6 <= hour < 9 %}
Expand Down Expand Up @@ -1101,14 +1101,14 @@ relevant **openHASP-custom-component config:**
{%- if not is_state('weather.openweathermap','unavailable') %}
{%- set update = states('sensor.date') %}
{%- set midnight = now().replace(hour=0, minute=0, second=0, microsecond=0).timestamp() %}
{%- set event = as_timestamp(strptime(state_attr('weather.openweathermap','forecast')[6]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-00T00:00:00+00:00')) %}
{%- set event = as_timestamp(strptime(state_attr('weather.openweathermap','forecast')[6]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-01T00:00:00+00:00')) %}
{%- set delta = ((event - midnight) // 86400) | int %}
{%- if delta == 0 %}
Today
{%- elif delta == 1 %}
Tomorrow
{%- endif %}
{{- event | timestamp_custom(" %-I %p") }}
{{ event | timestamp_custom(" %-I %p") }}
{%- endif %}
- obj: "p5b42" # Forecast temp +4h
Expand All @@ -1128,14 +1128,14 @@ relevant **openHASP-custom-component config:**
{%- if not is_state('weather.openweathermap','unavailable') %}
{%- set update = states('sensor.date') %}
{%- set midnight = now().replace(hour=0, minute=0, second=0, microsecond=0).timestamp() %}
{%- set event = as_timestamp(strptime(state_attr('weather.openweathermap','forecast')[12]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-00T00:00:00+00:00')) %}
{%- set event = as_timestamp(strptime(state_attr('weather.openweathermap','forecast')[12]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-01T00:00:00+00:00')) %}
{%- set delta = ((event - midnight) // 86400) | int %}
{%- if delta == 0 %}
Today
{%- elif delta == 1 %}
Tomorrow
{%- endif %}
{{- event | timestamp_custom(" %-I %p") }}
{{ event | timestamp_custom(" %-I %p") }}
{%- endif %}
- obj: "p5b52" # Forecast temp +8h
Expand All @@ -1153,10 +1153,10 @@ relevant **openHASP-custom-component config:**
properties:
"text": >
{%- if not is_state('weather.your_homename','unavailable') %}
{%- set now = as_timestamp(strptime(state_attr('weather.your_homename','forecast')[0]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-00T00:00:00+00:00')) %}
{%- set day = now | timestamp_custom("%w") %}
{%- set now1 = as_timestamp(strptime(state_attr('weather.your_homename','forecast')[0]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-01T00:00:00+00:00')) %}
{%- set day = now1 | timestamp_custom("%w") %}
{%- set days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] %}
{{ days[ day | int -1 ] }}{{- now | timestamp_custom(" %d") }}
{{ days[ day | int -1 ] }}{{ now1 | timestamp_custom(" %d") }}
{%- endif %}
- obj: "p5b62" # Forecast temp min +1d
Expand All @@ -1178,10 +1178,10 @@ relevant **openHASP-custom-component config:**
properties:
"text": >
{%- if not is_state('weather.your_homename','unavailable') %}
{%- set now = as_timestamp(strptime(state_attr('weather.your_homename','forecast')[1]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-00T00:00:00+00:00')) %}
{%- set day = now | timestamp_custom("%w") %}
{%- set now1 = as_timestamp(strptime(state_attr('weather.your_homename','forecast')[1]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-01T00:00:00+00:00')) %}
{%- set day = now1 | timestamp_custom("%w") %}
{%- set days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] %}
{{ days[ day | int -1 ] }}{{- now | timestamp_custom(" %d") }}
{{ days[ day | int -1 ] }}{{ now1 | timestamp_custom(" %d") }}
{%- endif %}
- obj: "p5b72" # Forecast temp min +2d
Expand All @@ -1203,10 +1203,10 @@ relevant **openHASP-custom-component config:**
properties:
"text": >
{%- if not is_state('weather.your_homename','unavailable') %}
{%- set now = as_timestamp(strptime(state_attr('weather.your_homename','forecast')[2]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-00T00:00:00+00:00')) %}
{%- set day = now | timestamp_custom("%w") %}
{%- set now1 = as_timestamp(strptime(state_attr('weather.your_homename','forecast')[2]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-01T00:00:00+00:00')) %}
{%- set day = now1 | timestamp_custom("%w") %}
{%- set days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] %}
{{ days[ day | int -1 ] }}{{- now | timestamp_custom(" %d") }}
{{ days[ day | int -1 ] }}{{ now1 | timestamp_custom(" %d") }}
{%- endif %}
- obj: "p5b82" # Forecast temp min +3d
Expand All @@ -1228,10 +1228,10 @@ relevant **openHASP-custom-component config:**
properties:
"text": >
{%- if not is_state('weather.your_homename','unavailable') %}
{%- set now = as_timestamp(strptime(state_attr('weather.your_homename','forecast')[3]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-00T00:00:00+00:00')) %}
{%- set day = now | timestamp_custom("%w") %}
{%- set now1 = as_timestamp(strptime(state_attr('weather.your_homename','forecast')[3]['datetime'], '%Y-%m-%dT%H:%M:%S%z', default='2020-01-01T00:00:00+00:00')) %}
{%- set day = now1 | timestamp_custom("%w") %}
{%- set days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] %}
{{ days[ day | int -1 ] }}{{- now | timestamp_custom(" %d") }}
{{ days[ day | int -1 ] }}{{ now1 | timestamp_custom(" %d") }}
{%- endif %}
- obj: "p5b92" # Forecast temp min +4d
Expand Down

0 comments on commit 53a335b

Please sign in to comment.