Advertisement
Guest User

home assistant pergola zenisun sensor

a guest
Sep 8th, 2024
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.94 KB | Source Code | 0 0
  1. sensor:
  2.   - platform: rest
  3.     name: "Pergola"
  4.     scan_interval: 15
  5.     resource: http://192.168.1.100/pergola/zns.cgi?cmd=d&p=os
  6.     json_attributes_path: "$.root"
  7.     value_template: "OK"
  8.     json_attributes:
  9.      - "gpo6"      # white dimmer
  10.       - "s_elev"    # Elevation
  11.       - "s_azi"     # Azimut
  12.       - "s_prj"     # Projection
  13.       - "user"      # mode (pluie, hiver, suivi,
  14.       - "Mot0"      # Moteur
  15.       - "date"      # Moteur
  16.       - "sun_delay" # Actualisation
  17.       - "VDC2"      # Voltage VDC2
  18.  
  19.   - platform: rest
  20.     name: "Pergola Core"
  21.     scan_interval: 15
  22.     resource: http://192.168.1.100/pergola/zns.cgi?cmd=c
  23.     json_attributes_path: "$.root"
  24.     value_template: "OK"
  25.     json_attributes:
  26.      - "orient"      # orientation
  27.       - "lon"    # Longitude
  28.       - "lat"     # Latitude
  29.  
  30.  
  31.   - platform: template
  32.     sensors:
  33.       pergola_watt:
  34.         value_template: "{{ (((states.sensor.pergola.attributes['gpo6'].split(';')[1] | float(0) ) * (states.sensor.pergola.attributes['VDC2'] | float(0) / 1000)) / 1000) | round(2, default=0) }}"
  35.         device_class: power
  36.         unit_of_measurement: 'W'
  37.         friendly_name: "Pergola lumière Watt"
  38.       pergola_dimmer:
  39.         value_template: "{{ (((states.sensor.pergola.attributes['gpo6'].split(';')[0]| float(0) ) * 100)/255) | round(0, default=0) }}"
  40.         device_class: power_factor
  41.         unit_of_measurement: '%'
  42.         friendly_name: "Pergola lumière pourcentage"
  43.       pergola_motor:
  44.         value_template: "{{ (((states.sensor.pergola.attributes['Mot0'].split(';')[0]| float(0) ) * 100)/(states.sensor.pergola.attributes['Mot0'].split(';')[1]| float(0) )) | float(0) }}"
  45.         device_class: power_factor
  46.         unit_of_measurement: '%'
  47.         friendly_name: "Pergola lames"
  48.       pergola_sundelay:
  49.         value_template: "{{ (states.sensor.pergola.attributes['sun_delay']| float(0) ) }}"
  50.         friendly_name: "Pergola actualisation"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement