Skip to content

Instantly share code, notes, and snippets.

View jorgror's full-sized avatar

Jørgen Rørvik jorgror

View GitHub Profile
@jorgror
jorgror / configuration.yaml
Last active November 4, 2023 21:54
Low spot price sensor
template:
- binary_sensor:
- name: Lav Spotpris
state: |
{% set today_price = state_attr('sensor.nordpool','today') %}
{% set current = state_attr('sensor.nordpool', 'current_price') %}
{% set number_of_hours = states('input_number.number_of_hours') | int %}
{% set max_price = states('input_number.max_price') | float %}
{% if number_of_hours == 0 %}
{% set price_limit = 0 %}