Guest User

Untitled

a guest
Feb 22nd, 2025
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 3.34 KB | None | 0 0
  1. alias: QW default
  2. description: ""
  3. triggers:
  4.   - trigger: state
  5.     entity_id:
  6.      - sensor.qw_mode
  7.   - trigger: state
  8.     entity_id:
  9.      - sensor.qw_powerlimit
  10. conditions: []
  11. actions:
  12.   - choose:
  13.       - conditions:
  14.           - condition: state
  15.             entity_id: sensor.qw_mode
  16.             state: sell
  17.           - condition: numeric_state
  18.             entity_id: sensor.qw_powerlimit
  19.             above: 0
  20.           - condition: numeric_state
  21.             entity_id: sensor.battery_state_of_charge
  22.             above: sensor.qw_batterysoc
  23.         sequence:
  24.           - action: input_select.select_option
  25.             metadata: {}
  26.             data:
  27.               option: Selling first
  28.             target:
  29.               entity_id: input_select.deye_desired_work_mode
  30.           - action: input_number.set_value
  31.             metadata: {}
  32.             data:
  33.               value: |-
  34.                 {{ (
  35.                   [
  36.                     (states('sensor.qw_powerlimit')|float(0)|abs/
  37.                     states('sensor.battery_voltage')|float(1)
  38.                     )|round(0,'ceil')+10,states('sensor.qw_dischargecurrent')|int
  39.                   ]|sort
  40.                 )[0] }}
  41.             target:
  42.               entity_id: input_number.deye_desired_max_discharge_current
  43.           - action: input_number.set_value
  44.             metadata: {}
  45.             data:
  46.               value: 40
  47.             target:
  48.               entity_id:
  49.                - input_number.deye_desired_capacity_point_5
  50.                 - input_number.deye_desired_capacity_point_6
  51.           - action: input_boolean.turn_off
  52.             metadata: {}
  53.             data: {}
  54.             target:
  55.               entity_id:
  56.                - input_boolean.deye_desired_grid_charge_point_5
  57.                 - input_boolean.deye_desired_grid_charge_point_6
  58.       - conditions:
  59.           - condition: state
  60.             entity_id: sensor.qw_mode
  61.             state: buy
  62.           - condition: numeric_state
  63.             entity_id: sensor.qw_powerlimit
  64.             above: 0
  65.         sequence:
  66.           - action: input_select.select_option
  67.             metadata: {}
  68.             data:
  69.               option: Zero export to CT
  70.             target:
  71.               entity_id: input_select.deye_desired_work_mode
  72.           - action: input_boolean.turn_on
  73.             metadata: {}
  74.             data: {}
  75.             target:
  76.               entity_id:
  77.                - input_boolean.deye_desired_grid_charge_point_5
  78.                 - input_boolean.deye_desired_grid_charge_point_6
  79.           - action: input_number.set_value
  80.             metadata: {}
  81.             data:
  82.               value: 100
  83.             target:
  84.               entity_id:
  85.                - input_number.deye_desired_capacity_point_5
  86.                 - input_number.deye_desired_capacity_point_6
  87.           - action: input_number.set_value
  88.             metadata: {}
  89.             data:
  90.               value: |-
  91.                 {{ (
  92.                   [
  93.                     (states('sensor.qw_powerlimit')|float(0)|abs/
  94.                     states('sensor.battery_voltage')|float(1)
  95.                     )|round(0,'ceil'),states('sensor.qw_chargecurrent')|int
  96.                   ]|sort
  97.                 )[0] }}
  98.             target:
  99.               entity_id: input_number.deye_desired_max_grid_charge_current
  100.     default:
  101. mode: single
  102.  
Advertisement
Add Comment
Please, Sign In to add comment