Skip to content

Car charging #16

Answered by overas
overas asked this question in Q&A
Dec 4, 2022 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

Sorry I did not read good enough. For making the binary sensor I need only this variabel {{tonight.is_in_cheapest_hours}}.
So I have made the template binary_sensor "binary_sensor.pricenanalyzer_five_cheapest_tonight" with this template:

template:
  - binary_sensor: 
      - name: "Pricenanalyzer five cheapest tonight"
        state: >
          {% set today=state_attr('sensor.priceanalyzer_kr_sand', 'raw_today') %}
          {% set tomorrow=state_attr('sensor.priceanalyzer_kr_sand', 'raw_tomorrow') %}
          {%-set nowTime = now().hour-%}
          {% set tonight = namespace(values=[], sorted = [], five_cheapest = [], is_in_cheapest_hours = false) %}
          {% for hour in today %}
…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@erlendsellie
Comment options

@overas
Comment options

Answer selected by overas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants