Guest User

Untitled

a guest
Feb 22nd, 2025
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.40 KB | None | 0 0
  1. alias: Deye control
  2. description: ""
  3. triggers:
  4.   - trigger: time_pattern
  5.     seconds: /5
  6. conditions: []
  7. actions:
  8.   - if:
  9.       - condition: template
  10.         value_template: >-
  11.           {{ states('select.work_mode') !=
  12.           states('input_select.deye_desired_work_mode') }}
  13.     then:
  14.       - action: select.select_option
  15.         metadata: {}
  16.         target:
  17.           entity_id: select.work_mode
  18.         data:
  19.           option: "{{ states('input_select.deye_desired_work_mode') }}"
  20.       - delay:
  21.           hours: 0
  22.           minutes: 0
  23.           seconds: 1
  24.   - if:
  25.       - condition: template
  26.         value_template: >-
  27.           {{ states('switch.grid_charge_point_5') !=
  28.           states('input_boolean.deye_desired_grid_charge_point_5') }}
  29.     then:
  30.       - action: switch.toggle
  31.         metadata: {}
  32.         data: {}
  33.         target:
  34.           entity_id: switch.grid_charge_point_5
  35.       - delay:
  36.           hours: 0
  37.           minutes: 0
  38.           seconds: 1
  39.  
  40.   - if:
  41.       - condition: template
  42.         value_template: >-
  43.           {{ states('number.max_grid_charge_current') !=
  44.           states('input_number.deye_desired_max_grid_charge_current') }}
  45.     then:
  46.       - action: number.set_value
  47.         metadata: {}
  48.         data:
  49.           value: "{{ states('input_number.deye_desired_max_grid_charge_current') }}"
  50.         target:
  51.           entity_id: number.max_grid_charge_current
  52.       - delay:
  53.           hours: 0
  54.           minutes: 0
  55.           seconds: 1
  56.   - if:
  57.       - condition: template
  58.         value_template: >-
  59.           {{ states('number.max_discharge_current') !=
  60.           states('input_number.deye_desired_max_discharge_current') }}
  61.     then:
  62.       - action: number.set_value
  63.         metadata: {}
  64.         data:
  65.           value: "{{ states('input_number.deye_desired_max_discharge_current') }}"
  66.         target:
  67.           entity_id: number.max_discharge_current
  68.       - delay:
  69.           hours: 0
  70.           minutes: 0
  71.           seconds: 1
  72.   - if:
  73.       - condition: template
  74.         value_template: >-
  75.           {{ states('number.capacity_point_5')|int !=
  76.           states('input_number.deye_desired_capacity_point_5')|int }}
  77.     then:
  78.       - action: number.set_value
  79.         metadata: {}
  80.         data:
  81.           value: "{{ states('input_number.deye_desired_capacity_point_5') }}"
  82.         target:
  83.           entity_id: number.capacity_point_5
  84.       - delay:
  85.           hours: 0
  86.           minutes: 0
  87.           seconds: 1
  88.   - if:
  89.       - condition: template
  90.         value_template: >-
  91.           {{ states('switch.grid_charge_point_6') !=
  92.           states('input_boolean.deye_desired_grid_charge_point_6') }}
  93.     then:
  94.       - action: switch.toggle
  95.         metadata: {}
  96.         data: {}
  97.         target:
  98.           entity_id:
  99.            - switch.grid_charge_point_6
  100.       - delay:
  101.           hours: 0
  102.           minutes: 0
  103.           seconds: 1
  104.   - if:
  105.       - condition: template
  106.         value_template: >-
  107.           {{ states('number.capacity_point_6')|int !=
  108.           states('input_number.deye_desired_capacity_point_6')|int }}
  109.     then:
  110.       - action: number.set_value
  111.         metadata: {}
  112.         data:
  113.           value: "{{ states('input_number.deye_desired_capacity_point_6') }}"
  114.         target:
  115.           entity_id: number.capacity_point_6
  116.       - delay:
  117.           hours: 0
  118.           minutes: 0
  119.           seconds: 1
  120. mode: queued
  121. max: 10
  122.  
Advertisement
Add Comment
Please, Sign In to add comment