Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias: QW powerlimit correction
- description: ""
- triggers:
- - trigger: time_pattern
- minutes: /1
- conditions:
- - condition: or
- conditions:
- - condition: state
- entity_id: sensor.qw_mode
- state: buy
- for:
- hours: 0
- minutes: 1
- seconds: 0
- - condition: state
- entity_id: sensor.qw_mode
- state: sell
- for:
- hours: 0
- minutes: 1
- seconds: 0
- actions:
- - if:
- - condition: template
- value_template: >-
- {{ (states('sensor.qw_powerlimit')|int -
- states('sensor.battery_power')|int|abs)|abs > 50 }}
- then:
- - if:
- - condition: state
- entity_id: sensor.qw_mode
- state: buy
- then:
- - action: input_number.set_value
- metadata: {}
- data:
- value: |-
- {{ (
- [
- states('input_number.deye_desired_max_grid_charge_current')|int+
- (
- (
- (
- states('sensor.qw_powerlimit')|int -
- states('sensor.battery_power')|int|abs
- )/
- 50
- )|int
- )
- ,240
- ]
- |sort
- )[0]
- }}
- target:
- entity_id: input_number.deye_desired_max_grid_charge_current
- else:
- - action: input_number.set_value
- metadata: {}
- data:
- value: |-
- {{ (
- [
- states('input_number.deye_desired_max_discharge_current')|int+
- (
- (
- (
- states('sensor.qw_powerlimit')|int -
- states('sensor.battery_power')|int|abs
- )/
- 50
- )|int
- )
- ,240
- ]
- |sort
- )[0]
- }}
- target:
- entity_id: input_number.deye_desired_max_discharge_current
- mode: single
Advertisement
Add Comment
Please, Sign In to add comment