Guest User

Untitled

a guest
Feb 16th, 2024
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. Custom sensor to go in your config.yaml, looks at PV power and takes off 4100, this allows for 3600 export and 500 to go to cover house baseload, the battery will charge at 500w as well as I only modify the charge rate register not active power:
  2.  
  3. sensor:
  4. - platform: template
  5. sensors:
  6. charge_rate:
  7. friendly_name: "Dynamic Charge Rate"
  8. unit_of_measurement: "W"
  9. value_template: >
  10. {% set original_value = states('sensor.givtcp_XXXXXXXX_pv_power')|float %}
  11. {% set adjusted_value = original_value - 4100 %}
  12. {{ adjusted_value if adjusted_value > 0 else 0 }}
  13.  
  14. Will need to create a custom helper called "prioritise export" and I keep it as a toggle switch on my dashboard so I can just tick it on.
  15.  
  16. Automation, runs every 60s and stops at 1544, times up to you:
  17.  
  18. alias: Prioritise Export
  19. description: ""
  20. trigger:
  21. - platform: time_pattern
  22. seconds: /60
  23. condition:
  24. - condition: time
  25. after: "06:00:00"
  26. before: "15:44:00"
  27. - condition: state
  28. entity_id: input_boolean.prioritise_export
  29. state: "on"
  30. action:
  31. - service: number.set_value
  32. data:
  33. value: "{{states('sensor.charge_rate')|float}}"
  34. target:
  35. entity_id: number.givtcp_XXXXXXXX_battery_charge_rate
  36. mode: single
  37.  
  38. Automation to set the charge rate back at 1545:
  39.  
  40. alias: Prioritise Export - Reset Charge Rate @ 1545
  41. description: ""
  42. trigger:
  43. - platform: time
  44. at: "15:45:00"
  45. condition: []
  46. action:
  47. - device_id: 5f75f57ebceacf500a639469e4eef245
  48. domain: number
  49. entity_id: 33e17bf2448db1cdb887317c4a517366
  50. type: set_value
  51. value: 2900
  52. mode: single
  53.  
  54.  
Advertisement
Add Comment
Please, Sign In to add comment