Skip to content

Instantly share code, notes, and snippets.

@theundefined
Last active July 3, 2023 21:39
Show Gist options
  • Save theundefined/b5397c4b4bfb7fcde269603c3222eaf7 to your computer and use it in GitHub Desktop.
Save theundefined/b5397c4b4bfb7fcde269603c3222eaf7 to your computer and use it in GitHub Desktop.
sensor:
- platform: rest
scan_interval: 900
name: pse
resource: https://www.pse.pl/transmissionMapService
value_template: " {{ status }}"
json_attributes:
- data
- platform: template
sensors:
pse_hz:
friendly_name: "PSE Hz"
value_template: '{{ states.sensor.pse.attributes["data"]["podsumowanie"]["czestotliwosc"] }}'
unit_of_measurement: 'Hz'
pse_pv:
friendly_name: "PSE PV"
value_template: '{{ states.sensor.pse.attributes["data"]["podsumowanie"]["PV"] }}'
unit_of_measurement: 'MW'
pse_wiatrowe:
friendly_name: "PSE Wiatrowe"
value_template: '{{ states.sensor.pse.attributes["data"]["podsumowanie"]["wiatrowe"] }}'
unit_of_measurement: 'MW'
pse_wodne:
friendly_name: "PSE wodne"
value_template: '{{ states.sensor.pse.attributes["data"]["podsumowanie"]["wodne"] }}'
unit_of_measurement: 'MW'
pse_cieplne:
friendly_name: "PSE Cieplne"
value_template: '{{ states.sensor.pse.attributes["data"]["podsumowanie"]["cieplne"] }}'
unit_of_measurement: 'MW'
pse_inne:
friendly_name: "PSE Inne"
value_template: '{{ states.sensor.pse.attributes["data"]["podsumowanie"]["inne"] }}'
unit_of_measurement: 'MW'
pse_generacja:
friendly_name: "PSE Generacja"
value_template: '{{ states.sensor.pse.attributes["data"]["podsumowanie"]["generacja"] }}'
unit_of_measurement: 'MW'
pse_zapotrzebowanie:
friendly_name: "PSE zapotrzebowanie"
value_template: '{{ states.sensor.pse.attributes["data"]["podsumowanie"]["zapotrzebowanie"] }}'
unit_of_measurement: 'MW'
pse_se:
friendly_name: "PSE SE"
value_template: '{{ states.sensor.pse.attributes["data"]["przesyly"] | selectattr("id", "eq", "SE") | map(attribute="wartosc") |first }}'
unit_of_measurement: 'MW'
pse_de:
friendly_name: "PSE DE"
value_template: '{{ states.sensor.pse.attributes["data"]["przesyly"] | selectattr("id", "eq", "DE") | map(attribute="wartosc") |first }}'
unit_of_measurement: 'MW'
pse_cz:
friendly_name: "PSE CZ"
value_template: '{{ states.sensor.pse.attributes["data"]["przesyly"] | selectattr("id", "eq", "CZ") | map(attribute="wartosc") |first }}'
unit_of_measurement: 'MW'
pse_sk:
friendly_name: "PSE SK"
value_template: '{{ states.sensor.pse.attributes["data"]["przesyly"] | selectattr("id", "eq", "SK") | map(attribute="wartosc") |first }}'
unit_of_measurement: 'MW'
pse_ua:
friendly_name: "PSE UA"
value_template: '{{ states.sensor.pse.attributes["data"]["przesyly"] | selectattr("id", "eq", "UA") | map(attribute="wartosc") |first }}'
unit_of_measurement: 'MW'
pse_lt:
friendly_name: "PSE LT"
value_template: '{{ states.sensor.pse.attributes["data"]["przesyly"] | selectattr("id", "eq", "LT") | map(attribute="wartosc") |first }}'
unit_of_measurement: 'MW'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment