Help with an automation?

Hi, I’m new to AH and trying to make an automation to match my givenergy battery SOCs (GivTCP changes one only based on solar prediction and I want to change the second to match). I have tried this but keep getting a message in traces saying

Error: Value 0.0 for number.lhs_inverter_ce2230g309_target_soc is outside valid range 4.0 - 100.0

Heres what I have tried:

alias: TBC
description: “”
triggers:

  • entity_id:
    • number.rhs_inverter_ce2223g194_target_soc
      trigger: state
      conditions:
  • condition: time
    after: “23:10:00”
    before: “23:58:00”
    weekday:
    • mon
    • tue
    • wed
    • thu
    • fri
    • sat
    • sun
      enabled: true
      actions:
  • action: number.set_value
    metadata: {}
    data:
    value: “{{ states(‘rhs_inverter_ce2223g194_target_soc’)|float(0) }}”
    target:
    entity_id: number.lhs_inverter_ce2230g309_target_soc
    mode: single

This is not a valid entity id. It is missing the ‘number.’ prefix. You should always try templates in developer tools to see if they work before putting them in an automtion or sensor.

Please when you post yaml, properly format by using the </> code format block. The forum distroys relevant information to see possible errors and makes it almost impossible to read the automation properly.

1 Like
alias: TBC
description: ""
triggers:
  - entity_id:
      - number.rhs_inverter_ce2223g194_target_soc
    trigger: state
conditions:
  - condition: time
    after: "23:10:00"
    before: "23:58:00"
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
      - sun
    enabled: false
actions:
  - action: number.set_value
    metadata: {}
    data:
      value: "{{ states('rhs_inverter_ce2223g194_target_soc')|float(0) }}"
    target:
      entity_id: number.lhs_inverter_ce2230g309_target_soc
mode: single

Thanks - heres the code - I think its fixed now by adding number. in front of rhs - thanks for your help!

1 Like