Advertisement
arushear

PRÓBA 3

Oct 23rd, 2024
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.15 KB | None | 0 0
  1. - platform: rest
  2.   name: szambo
  3.   resource: http://mojdomek.eu/api/api2.php?id=TUTAJ_ID
  4.   method: GET
  5.   value_template: "{{ value_json.locations[0].measurement }}"
  6.   json_attributes:
  7.    - batt_level
  8.     - cm
  9.     - lastempty
  10.     - nextfull
  11.     - percent
  12.   scan_interval: 1800
  13.  
  14. - platform: template
  15.   sensors:
  16.     szambo_poziom:
  17.       friendly_name: "Poziom szamba"
  18.       value_template: "{{ state_attr('sensor.szambo', 'percent') | float(default=0) }}"
  19.       unit_of_measurement: '%'
  20.  
  21.     szambo_bateria:
  22.       friendly_name: "Stan baterii"
  23.       value_template: "{{ state_attr('sensor.szambo', 'batt_level') | float(default=0) }}"
  24.       unit_of_measurement: '%'
  25.  
  26.     szambo_cm:
  27.       friendly_name: "Poziom szamba w cm"
  28.       value_template: "{{ state_attr('sensor.szambo', 'cm') | float(default=0) }}"
  29.       unit_of_measurement: 'cm'
  30.  
  31.     szambo_nastepne_oproznienie:
  32.       friendly_name: "Następne opróżnienie"
  33.       value_template: "{{ state_attr('sensor.szambo', 'nextfull') }}"
  34.  
  35.     szambo_ostatnie_oproznienie:
  36.       friendly_name: "Ostatnie opróżnienie"
  37.       value_template: "{{ state_attr('sensor.szambo', 'lastempty') }}"
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement