Scheduled Discharge Only Pause

16 comments started 2022-09-01 last 2022-09-03
Home AutomationHome Assistant
#1 TheDragon (GivEnergy)

@Britkat Is there way we can use automations to set charge and discharge values?

For example.
1600-2000 each day, set discharge register value to 0.
Effectively pausing discharge.
Then read back the adjusted register and compare read value to that set. If same, continue, else write again.

Or ideally attaching entities to the writable registers
Inc calibration.
Then a user can set switches, sliders or automations instead of the buggy GE portal.

#2 hoggy

This has been available since pretty much day 1 via REST functions & MQTT topics?
It's on the GivTCP docs table under "GivTCP Control"

I'd steer clear on Calibration. It would likely be viewed dimly by GE as they removed that from users for a reason.
People will also take the piss and use it as a way to maximise Agile Exports no doubt...

#3 TheDragon (GivEnergy)

hoggy Suppose you are right. Harming the batteries necessarily.

Will have another read of the docs at work if its quiet. Now I can play with my HA instance over SSL

#4 TheDragon (GivEnergy)

Had a quick look.
enableDischarge: false I guess would pause discharge.
How would this be written into switch for example?

#5 hoggy

Yes that one, handy for EV Chargers too so you don't dump battery
I sometimes use the Power Level ones if I want to blend / Divert PV power elsewhere to say HW (before my Solic diverter went bang anyway...)

In Powershell I just send it a cURL POST request with the payload column as the body to GivTCP-IP/enableDischarge or whatever...
I don't use MQTT but whatever you use for that can presumably do the same from HA to publish it out?
Sure HA has the ability to send POST commands as it's an integral part of how API's work but sadly i don't use HA so one for someone else to answer...

#6 TheDragon (GivEnergy)

hoggy ok.
Yeah I'm pretty good writing stuff to read and present.
Writing via MQTT is a this evening on a quiet shift job I think.

T
#7 Tim

TheDragon (GivEnergy) I'm just about to do some of this using MQTT to API and to Givtcp, but via Node-RED, but the principles will be the same.

#8 TheDragon (GivEnergy)

Tim OOh ok, interested in one example. Once I get the syntax, I rekon O could write the rest of the switches to do what i need

T
#9 Tim

TheDragon (GivEnergy) Just assembling the registers that need to be read/written (this is output from Get Settings List pulled from API using http request):

id	name	validation
24	Enable Eco Mode	Value must be either true or false
66	AC Charge Enable	Value must be either true or false
64	AC Charge 1 Start Time	Value format should be HH:mm. Use correct time range for hour and minutes
65	AC Charge 1 End Time	Value format should be HH:mm. Use correct time range for hour and minutes
28	AC Charge 2 Start Time	Value format should be HH:mm. Use correct time range for hour and minutes
29	AC Charge 2 End Time	Value format should be HH:mm. Use correct time range for hour and minutes
75	Battery Cutoff % Limit	Value must be between 4 and 100
77	AC Charge Upper % Limit	Value must be between 0 and 100
17	Enable AC Charge Upper % Limit	Value must be either true or false
72	Battery Charge Power	Value must be between 0 and 2600
73	Battery Discharge Power	Value must be between 0 and 2600
56	Enable DC Discharge	Value must be either true or false
71	Battery Reserve % Limit	Value must be between 4 and 100
53	DC Discharge 1 Start Time	Value format should be HH:mm. Use correct time range for hour and minutes
54	DC Discharge 1 End Time	Value format should be HH:mm. Use correct time range for hour and minutes
41	DC Discharge 2 Start Time	Value format should be HH:mm. Use correct time range for hour and minutes
42	DC Discharge 2 End Time	Value format should be HH:mm. Use correct time range for hour and minutes
47	Inverter Max Output Active Power Percent	Value must be between 0 and 100
83	Restart Inverter	Value can only be 100

I note that there are two ac Charge time period registers, but only one in the portal. Also, register 29 has a default value of 00:04. There's a bell ringing somewhere about this. I'm assuming that if you want to make use of AC Charge Upper % Limit (77), you also need to set Enable AC Charge Upper % Limit (TRUE).

B
#10 Britkat

If you use Home Assistant there are switches provided for you to toggle charge and discharge. Although to be honest I have found the most reliable method has been to set the discharge rate to 0%.
Check out entities:
number.givtcp_sa2047g098_battery_discharge_rate
number.givtcp_sa2047g098_battery_charge_rate
switch.givtcp_sa2047g098_enable_discharge

#11 TheDragon (GivEnergy)

Those are exactly what I was after.

Any other hidden ones useful?
Found the select.GivTCP one for Eco, timed mode wtc

M
#12 mpartington

I've worked out how to change the value of 'number.givtcp_sa2047g098_battery_discharge_rate' within a home assistant automation (for example based on time schedule), but is it possible to do so from Node Red? Looking at how I can tie in more complex things like car charging (on Solar) to stop battery drain and to be honest, being a beginner, I find it easier to structure the flows is NR. Probably missing something really obvious, but I just can't find a way to update the entity value from NR. Tried MQTT as well, (Topic: GivEnergy/CE2146G269/Control/setDischargeRate) but I think I must be missing something in the node set up. It's all a case of trial and error, so wondering if anyone has set this up?

T
#13 Tim

mpartington I'm away from home currently but have been using API calls from Node-RED HTTP requests to set inverter parameters successfully. When I've finished the flow, I plan to replicate using MQTT and Givtcp for local control in the event of an internet drop.

M
#14 mpartington

Tim Be really interested in seeing this when complete. I think I found my issue, I was missing adding this to the data section of the change state node {"value":50}. Gives me a way to change the GivTCP entity, so should be able to work around that with some basic flows.

B
#15 Britkat

If you want to use NR I’d suggest using the REST interface, all the same control is available there. Check the readme on my github for the info on the url and post bodies

B
#16 Britkat

As a side note I’m currently creating “boost”functions for charge, discharge and export. They will allow you to set a boost period to pause charge/discharge, force charge or force export. Then revert to previous settings.
This and a few more bits are coming in v2.0.0