Hi - I’m new to OH3 and automation in general. Got most of my devices up & working within OH.
I’m expecting to have a GivEnergy PV & battery system (UK) installed in a few months time and am looking at what data I’ll be able to get from the system to use within OH.
Before I go much further looking into how to use their API (and in fact any API as I’ve not done this before ), I was wondering if anyone is developing a GivEnergy binding?
GivEnergy have an API that I think you can access with HTTP, either the binding or in a rule.
I’m not sure how often that is updated so I use a local connection. The GivEnergy WiFi dongle accepts Modbus over TCP connections. Annoyingly, they don’t use the standard Modbus protocol so you can’t use the Modbus binding. There is a program called GivTCP that you can execute with the exec binding and parse the results with a rule or a JSON transformation. I use this method to poll the inverter every 10 seconds.
I did modify GivTCP to grab fewer parameters because it was filling up the log with long JSON strings.
If it helps, I’ve just helped integrate a GivEnergy battery system into openHAB (no solar PV though) via the cloud API. We used the HTTP Binding and JINJA Transformation Service, with the following text configs:
Things
Replace <YOUR-INVERTER-ID> with the ID of your inverter, and <YOUR-API-KEY> with your massive API key from your account security settings.
I’m sure this will help - many thanks.
I’m a complete beginner but I’m sure I’ll find this info invaluable.
I’m still waiting to have the system installed so can’t even experiment yet.
The key to this is a program called GivTCP, which is available on GitHub. I use the Exec binding to run the program every 5 seconds. It returns a JSON array of values representing the inverter status registers that is captured by the exec binding. I then use a rule to extract the values that I want because as far as I know, you can’t apply transformations to exec channels. I ended up modifying GivTCP to reduce the number of values returned because every instance of the array ends up in the OpenHAB log.
The external program would be unnecessary if the inverter used the standard Modbus protocol but annoyingly it has some sort of preamble that means the standard Modbus binding can’t get a response.
Since I did my installation, GivTCP can now publish to an MQTT broker, which might be a neater way of using it.
OK, great - I saw that yesterday, and it looks like they have a Docker image which redirects the data to an MQTT broker which would work perfectly for us (no rules required!)
EDIT: @barneyd FYI the previously linked repo is essentially dead. It provides a docker-compose.yaml pointing to britkat1980’s image, but the example isn’t compatible with that image. Best use britkat1980’s repo directly at GitHub - britkat1980/giv_tcp: TCP connection (from inverter) and MQTT implementation, which has commits from 3 days ago, rather than 7 months ago.
//GIVENERGY POWER DATA
Thing mqtt:topic:givenergy-power "GivEnergy Power" (mqtt:broker:mosquitto) {
Channels:
Type number : Grid_Voltage "Grid_Voltage" [
stateTopic="GivEnergy/CE2223G849/Power/Power/Grid_Voltage"
]
Type number : Grid_Current "Grid_Current" [
stateTopic="GivEnergy/CE2223G849/Power/Power/Grid_Current"
]
Type number : Grid_Power "Grid_Power" [
stateTopic="GivEnergy/CE2223G849/Power/Power/Grid_Power"
]
Type number : Import_Power "Import_Power" [
stateTopic="GivEnergy/CE2223G849/Power/Power/Import_Power"
]
Type number : Invertor_Power "Invertor_Power" [
stateTopic="GivEnergy/CE2223G849/Power/Power/Invertor_Power"
]
Type number : AC_Charge_Power "AC_Charge_Power" [
stateTopic="GivEnergy/CE2223G849/Power/Power/AC_Charge_Power"
]
Type number : Load_Power "Load_Power" [
stateTopic="GivEnergy/CE2223G849/Power/Power/Load_Power"
]
Type number : SOC "SOC" [
stateTopic="GivEnergy/CE2223G849/Power/Power/SOC"
]
Type number : Battery_Power "Battery_Power" [
stateTopic="GivEnergy/CE2223G849/Power/Power/Battery_Power"
]
Type number : Charge_Power "Charge_Power" [
stateTopic="GivEnergy/CE2223G849/Power/Power/Charge_Power"
]
Type number : Discharge_Power "Discharge_Power" [
stateTopic="GivEnergy/CE2223G849/Power/Power/Discharge_Power"
]
Type number : Grid_to_House "Grid_to_House" [
stateTopic="GivEnergy/CE2223G849/Power/Flows/Grid_to_House"
]
Type number : Battery_to_House "Battery_to_House" [
stateTopic="GivEnergy/CE2223G849/Power/Flows/Battery_to_House"
]
Type number : Grid_to_Battery "Grid_to_Battery" [
stateTopic="GivEnergy/CE2223G849/Power/Flows/Grid_to_Battery"
]
}
//GIVENERGY ENERGY DATA
Thing mqtt:topic:givenergy-energy "GivEnergy Energy" (mqtt:broker:mosquitto) {
Channels:
Type number : Import_Energy_Today_kWh "Import_Energy_Today_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/Import_Energy_Today_kWh"
]
Type number : AC_Charge_Energy_Today_kWh "AC_Charge_Energy_Today_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/AC_Charge_Energy_Today_kWh"
]
Type number : Invertor_Energy_Today_kWh "Invertor_Energy_Today_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/Invertor_Energy_Today_kWh"
]
Type number : Load_Energy_Today_kWh "Load_Energy_Today_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/Load_Energy_Today_kWh"
]
Type number : Battery_Charge_Energy_Today_kWh "Battery_Charge_Energy_Today_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/Battery_Charge_Energy_Today_kWh"
]
Type number : Battery_Discharge_Energy_Today_kWh "Battery_Discharge_Energy_Today_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/Battery_Discharge_Energy_Today_kWh"
]
Type number : Battery_Throughput_Today_kWh "Battery_Throughput_Today_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/Battery_Throughput_Today_kWh"
]
Type number : Import_Energy_Total_kWh "Import_Energy_Total_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/Import_Energy_Total_kWh"
]
Type number : AC_Charge_Energy_Total_kWh "AC_Charge_Energy_Total_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/AC_Charge_Energy_Total_kWh"
]
Type number : Invertor_Energy_Total_kWh "Invertor_Energy_Total_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/Invertor_Energy_Total_kWh"
]
Type number : Load_Energy_Total_kWh "Load_Energy_Total_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/Load_Energy_Total_kWh"
]
Type number : Battery_Charge_Energy_Total_kWh "Battery_Charge_Energy_Total_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/Battery_Charge_Energy_Total_kWh"
]
Type number : Battery_Discharge_Energy_Total_kWh "Battery_Discharge_Energy_Total_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/Battery_Discharge_Energy_Total_kWh"
]
Type number : Battery_Throughput_Total_kWh "Battery_Throughput_Total_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Today/Battery_Throughput_Total_kWh"
]
Type number : Night_Energy_kWh "Night_Energy_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Rates/Night_Energy_kWh"
]
Type number : Day_Energy_kWh "Day_Energy_kWh" [
stateTopic="GivEnergy/CE2223G849/Energy/Rates/Day_Energy_kWh"
]
}
//GIVENERGY TIMESLOT DATA
Thing mqtt:topic:givenergy-timeslot "GivEnergy Timeslot" (mqtt:broker:mosquitto) {
Channels:
Type string : Discharge_start_time_slot_1 "Discharge_start_time_slot_1" [
stateTopic="GivEnergy/CE2223G849/Timeslots/Discharge_start_time_slot_1"
]
Type string : Discharge_end_time_slot_1 "Discharge_end_time_slot_1" [
stateTopic="GivEnergy/CE2223G849/Timeslots/Discharge_end_time_slot_1"
]
Type string : Charge_start_time_slot_1 "Charge_start_time_slot_1" [
stateTopic="GivEnergy/CE2223G849/Timeslots/Charge_start_time_slot_1"
]
Type string : Charge_end_time_slot_1 "Charge_end_time_slot_1" [
stateTopic="GivEnergy/CE2223G849/Timeslots/Charge_end_time_slot_1"
]
Type string : Discharge_start_time_slot_2 "Discharge_start_time_slot_2" [
stateTopic="GivEnergy/CE2223G849/Timeslots/Discharge_start_time_slot_2"
]
Type string : Discharge_end_time_slot_2 "Discharge_end_time_slot_2" [
stateTopic="GivEnergy/CE2223G849/Timeslots/Discharge_end_time_slot_2"
]
Type string : Charge_start_time_slot_2 "Charge_start_time_slot_2" [
stateTopic="GivEnergy/CE2223G849/Timeslots/Charge_start_time_slot_2"
]
Type string : Charge_end_time_slot_2 "Charge_end_time_slot_2" [
stateTopic="GivEnergy/CE2223G849/Timeslots/Charge_end_time_slot_2"
]
}
//GIVENERGY SETTINGS DATA
Thing mqtt:topic:givenergy-settings "GivEnergy Settings" (mqtt:broker:mosquitto) {
Channels:
Type number : Battery_Power_Cutoff "Battery_Power_Cutoff" [
stateTopic="GivEnergy/CE2223G849/Control/Battery_Power_Cutoff"
]
Type number : Target_SOC "Target_SOC" [
stateTopic="GivEnergy/CE2223G849/Control/Target_SOC"
]
Type switch : Enable_Charge_Schedule "Enable_Charge_Schedule" [
stateTopic="GivEnergy/CE2223G849/Control/Enable_Charge_Schedule",
on="enable",
off="disable"
]
Type switch : Enable_Discharge_Schedule "Enable_Discharge_Schedule" [
stateTopic="GivEnergy/CE2223G849/Control/Enable_Discharge_Schedule",
on="enable",
off="disable"
]
Type switch : Enable_Discharge "Enable_Discharge" [
stateTopic="GivEnergy/CE2223G849/Control/Enable_Discharge",
on="enable",
off="disable"
]
Type number : Battery_Charge_Rate "Battery_Charge_Rate" [
stateTopic="GivEnergy/CE2223G849/Control/Battery_Charge_Rate"
]
Type number : Battery_Discharge_Rate "Battery_Discharge_Rate" [
stateTopic="GivEnergy/CE2223G849/Control/Battery_Discharge_Rate"
]
}
Items
/*
EQUIPMENT
*/
Group gGivEnergy "GivEnergy" (gIndoor) ["Equipment"]
Group gGivEnergySettings "GivEnergy Settings" (gGivEnergy) ["Equipment"]
Group gGivEnergyPowerData "GivEnergy Power Data" (gGivEnergy) ["Equipment"]
Group gGivEnergyEnergyData"GivEnergy Energy Data" (gGivEnergy) ["Equipment"]
/*
SETTINGS
*/
String strGivEnergy_Charge_Start "GivEnergy charge start" (gGivEnergySettings) ["Setpoint", "Timestamp"] {channel="mqtt:topic:givenergy-timeslot:Charge_start_time_slot_1"}
String strGivEnergy_Charge_End "GivEnergy charge end" (gGivEnergySettings) ["Setpoint", "Timestamp"] {channel="mqtt:topic:givenergy-timeslot:Charge_end_time_slot_1"}
Switch sGivEnergy_Charge_Enable "GivEnergy charge enable" (gGivEnergySettings) ["Setpoint", "Timestamp"] {channel="mqtt:topic:givenergy-settings:Enable_Charge_Schedule"}
Dimmer dGivEnergy_Charge_Upper_Percent_Limit "GivEnergy charge upper percent limit" (gGivEnergySettings) ["Setpoint"] {channel="mqtt:topic:givenergy-settings:Target_SOC"}
Number nGivEnergy_Battery_Charge_Power "GiveEnergy battery charge power" (gGivEnergySettings) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:Charge_Power"}
String strGivEnergy_Discharge_Start "GivEnergy discharge start" (gGivEnergySettings) ["Setpoint", "Timestamp"] {channel="mqtt:topic:givenergy-timeslot:Discharge_start_time_slot_1"}
String strGivEnergy_Discharge_End "GivEnergy discharge end" (gGivEnergySettings) ["Setpoint", "Timestamp"] {channel="mqtt:topic:givenergy-timeslot:Discharge_end_time_slot_1"}
Switch sGivEnergy_Discharge_Enable "GivEnergy discharge enable" (gGivEnergySettings) ["Switch", "Battery"] {channel="mqtt:topic:givenergy-settings:Enable_Discharge_Schedule"}
Dimmer dGivEnergy_Cutoff_Percent_Limit "GivEnergy cutoff percent limit" (gGivEnergySettings) ["Setpoint"] {channel="mqtt:topic:givenergy-settings:Battery_Power_Cutoff"}
Number nGivEnergy_Battery_Discharge_Power "GiveEnergy battery discharge power" (gGivEnergySettings) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:Discharge_Power"}
/*
POWER DATA
*/
//CURRENT TOTAL POWER USAGE BY THE HOUSE ITSELF (EXCLUDES INEFFICIENCIES)
Number nGivEnergy_Load_Power "GiveEnergy load power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:Load_Power"}
//CURRENT POWER FROM THE GRID, UNSIGNED
Number nGivEnergy_Import_Power "GiveEnergy import power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:Import_Power"}
//CURRENT POWER FROM GRID, SIGNED (IMPORT IS NEGATIVE)
Number nGivEnergy_Grid_Voltage "GiveEnergy grid voltage" (gGivEnergyPowerData) ["Measurement", "Voltage"] {channel="mqtt:topic:givenergy-power:Grid_Voltage"}
Number nGivEnergy_Grid_Current "GiveEnergy grid current" (gGivEnergyPowerData) ["Measurement", "Current"] {channel="mqtt:topic:givenergy-power:Grid_Current"}
Number nGivEnergy_Grid_Power "GiveEnergy grid power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:Grid_Power"}
//CURRENT POWER TO (-) OR FROM (+) BATTERY
Number nGivEnergy_Battery_Power "GiveEnergy battery power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:Battery_Power"}
//CURRENT BATTERY SOC IN %
Dimmer nGivEnergy_Battery_Percent "GiveEnergy battery percent" (gGivEnergyPowerData) ["Measurement", "Charge"] {channel="mqtt:topic:givenergy-power:Battery_SOC"}
//CURRENT CHARGE AND DISCHARGE POWERS
//POWER TO INVERTOR FROM GRID WHEN CHARGING
Number nGivEnergy_AC_Charge_Power "GiveEnergy AC charge power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:AC_Charge_Power"}
//POWER TO BATTERY WHEN CHARGING ONLY (ZERO WHEN DISCHARGING). THIS IS POWER AFTER INVERSION - SOME nGivEnergy_AC_Charge_Power IS LOST IN THE INVERTOR
Number nGivEnergy_Charge_Power "GiveEnergy charge power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:Charge_Power"}
//POWER FROM BATTERY WHEN DISCHARGING ONLY (ZERO WHEN CHARGING)
Number nGivEnergy_Discharge_Power "GiveEnergy discharge power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:Discharge_Power"}
//CURRENT POWER OUTPUT OF INVERTOR
Number nGivEnergy_Inverter_Power "GiveEnergy inverter power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:Invertor_Power"}
//FLOWS
//EXPECT THE SAME AS nGivEnergy_Grid_Power
Number nGivEnergy_Flow_Grid_to_House "GiveEnergy power flow grid to house" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:Grid_to_House"}
//EXPECT THE SAME AS nGivEnergy_Battery_Power and nGivEnergy_Discharge_Power
Number nGivEnergy_Flow_Battery_to_House "GiveEnergy power flow battery to house" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:Battery_to_House"}
//EXPECT THE SAME AS nGivEnergy_Charge_Power
Number nGivEnergy_Flow_Grid_to_Battery "GiveEnergy power flow grid to battery" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="mqtt:topic:givenergy-power:Grid_to_Battery"}
/*
ENERGY DATA
*/
//TODAY
//TOTAL ENERGY IMPORTED FROM GRID
Number nGivEnergy_Today_Grid_Import "GiveEnergy today grid import" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:Import_Energy_Today_kWh"}
//AMOUNT DIVERTED TO CHARGING BATTERY
Number nGivEnergy_Today_AC_Charge "GiveEnergy today AC charge" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:AC_Charge_Energy_Today_kWh"}
//AMOUNT THAT THE BATTERY ACTUALLY CHARGED
Number nGivEnergy_Today_Battery_Charge "GiveEnergy today battery charge" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:Battery_Charge_Energy_Today_kWh"}
//AMOUNT THAT THE BATTERY ACTUALLY DISCHARGED
Number nGivEnergy_Today_Battery_Discharge "GiveEnergy today battery discharge" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:Battery_Discharge_Energy_Today_kWh"}
//ENERGY THAT THE INVERTOR SUPPLIED TO THE HOUSE, FROM THE BATTERY
Number nGivEnergy_Today_Invertor "GiveEnergy today invertor" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:Invertor_Energy_Today_kWh"}
//TOTAL ENERGY CONSUMED BY HOUSE
Number nGivEnergy_Today_Consumption "GiveEnergy today home actual consumption" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:Load_Energy_Today_kWh"}
//TOTAL
//TOTAL ENERGY IMPORTED FROM GRID
Number nGivEnergy_Total_Grid_Import "GiveEnergy total grid import" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:Import_Energy_Total_kWh"}
//ENERGY IMPORTED DURING NIGHT
Number nGivEnergy_Night_Energy "GiveEnergy night energy" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:Night_Energy_kWh"}
//ENERGY IMPORTED DURING DAY
Number nGivEnergy_Day_Energy "GiveEnergy day energy" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:Day_Energy_kWh"}
//AMOUNT DIVERTED TO CHARGING BATTERY
Number nGivEnergy_Total_AC_Charge "GiveEnergy total AC charge" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:AC_Charge_Energy_Total_kWh"}
//AMOUNT THAT THE BATTERY ACTUALLY CHARGED
Number nGivEnergy_Total_Battery_Charge "GiveEnergy total battery charge" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:Battery_Charge_Energy_Total_kWh"}
//AMOUNT THAT THE BATTERY ACTUALLY DISCHARGED
Number nGivEnergy_Total_Battery_Discharge "GiveEnergy total battery discharge" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:Battery_Discharge_Energy_Total_kWh"}
//ENERGY THAT THE INVERTOR SUPPLIED TO THE HOUSE, FROM THE BATTERY
Number nGivEnergy_Total_Invertor "GiveEnergy total invertor" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:Invertor_Energy_Total_kWh"}
//TOTAL ENERGY CONSUMED BY HOUSE
Number nGivEnergy_Total_Consumption "GiveEnergy total home actual consumption" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="mqtt:topic:givenergy-energy:Load_Energy_Total_kWh"}
Thing http:url:givenergy "GivEnergy" [
baseURL = "http://192.168.1.215:6345/readData",
refresh = "30",
delay = "100",
ignoreSSLErrors = "true",
stateMethod = "GET"
]
{
Channels:
Type number : Grid_Voltage "Grid_Voltage" [
stateTransformation="JSONPATH:$.Power/Power/Grid_Voltage"
]
Type number : Grid_Current "Grid_Current" [
stateTransformation="JSONPATH:$.Power/Power/Grid_Current"
]
Type number : Grid_Power "Grid_Power" [
stateTransformation="JSONPATH:$.Power.Power.Grid_Power"
]
Type number : Import_Power "Import_Power" [
stateTransformation="JSONPATH:$.Power.Power.Import_Power"
]
Type number : Invertor_Power "Invertor_Power" [
stateTransformation="JSONPATH:$.Power.Power.Invertor_Power"
]
Type number : AC_Charge_Power "AC_Charge_Power" [
stateTransformation="JSONPATH:$.Power.Power.AC_Charge_Power"
]
Type number : Load_Power "Load_Power" [
stateTransformation="JSONPATH:$.Power.Power.Load_Power"
]
Type number : Battery_SOC "SOC" [
stateTransformation="JSONPATH:$.Power.Power.SOC"
]
Type number : Battery_Power "Battery_Power" [
stateTransformation="JSONPATH:$.Power.Power.Battery_Power"
]
Type number : Charge_Power "Charge_Power" [
stateTransformation="JSONPATH:$.Power.Power.Charge_Power"
]
Type number : Discharge_Power "Discharge_Power" [
stateTransformation="JSONPATH:$.Power.Power.Discharge_Power"
]
Type number : Grid_to_House "Grid_to_House" [
stateTransformation="JSONPATH:$.Power.Flows.Grid_to_House"
]
Type number : Battery_to_House "Battery_to_House" [
stateTransformation="JSONPATH:$.Power.Flows.Battery_to_House"
]
Type number : Grid_to_Battery "Grid_to_Battery" [
stateTransformation="JSONPATH:$.Power.Flows.Grid_to_Battery"
]
//GIVENERGY ENERGY DATA
Type number : Import_Energy_Today_kWh "Import_Energy_Today_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.Import_Energy_Today_kWh"
]
Type number : AC_Charge_Energy_Today_kWh "AC_Charge_Energy_Today_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.AC_Charge_Energy_Today_kWh"
]
Type number : Invertor_Energy_Today_kWh "Invertor_Energy_Today_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.Invertor_Energy_Today_kWh"
]
Type number : Load_Energy_Today_kWh "Load_Energy_Today_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.Load_Energy_Today_kWh"
]
Type number : Battery_Charge_Energy_Today_kWh "Battery_Charge_Energy_Today_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.Battery_Charge_Energy_Today_kWh"
]
Type number : Battery_Discharge_Energy_Today_kWh "Battery_Discharge_Energy_Today_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.Battery_Discharge_Energy_Today_kWh"
]
Type number : Battery_Throughput_Today_kWh "Battery_Throughput_Today_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.Battery_Throughput_Today_kWh"
]
Type number : Import_Energy_Total_kWh "Import_Energy_Total_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.Import_Energy_Total_kWh"
]
Type number : AC_Charge_Energy_Total_kWh "AC_Charge_Energy_Total_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.AC_Charge_Energy_Total_kWh"
]
Type number : Invertor_Energy_Total_kWh "Invertor_Energy_Total_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.Invertor_Energy_Total_kWh"
]
Type number : Load_Energy_Total_kWh "Load_Energy_Total_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.Load_Energy_Total_kWh"
]
Type number : Battery_Charge_Energy_Total_kWh "Battery_Charge_Energy_Total_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.Battery_Charge_Energy_Total_kWh"
]
Type number : Battery_Discharge_Energy_Total_kWh "Battery_Discharge_Energy_Total_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.Battery_Discharge_Energy_Total_kWh"
]
Type number : Battery_Throughput_Total_kWh "Battery_Throughput_Total_kWh" [
stateTransformation="JSONPATH:$.Energy.Today.Battery_Throughput_Total_kWh"
]
Type number : Night_Energy_kWh "Night_Energy_kWh" [
stateTransformation="JSONPATH:$.Energy.Rates.Night_Energy_kWh"
]
Type number : Day_Energy_kWh "Day_Energy_kWh" [
stateTransformation="JSONPATH:$.Energy.Rates.Day_Energy_kWh"
]
//GIVENERGY TIMESLOT DATA
Type string : Discharge_start_time_slot_1 "Discharge_start_time_slot_1" [
stateTransformation="JSONPATH:$.Timeslots.Discharge_start_time_slot_1"
]
Type string : Discharge_end_time_slot_1 "Discharge_end_time_slot_1" [
stateTransformation="JSONPATH:$.Timeslots.Discharge_end_time_slot_1"
]
Type string : Charge_start_time_slot_1 "Charge_start_time_slot_1" [
stateTransformation="JSONPATH:$.Timeslots.Charge_start_time_slot_1"
]
Type string : Charge_end_time_slot_1 "Charge_end_time_slot_1" [
stateTransformation="JSONPATH:$.Timeslots.Charge_end_time_slot_1"
]
Type string : Discharge_start_time_slot_2 "Discharge_start_time_slot_2" [
stateTransformation="JSONPATH:$.Timeslots.Discharge_start_time_slot_2"
]
Type string : Discharge_end_time_slot_2 "Discharge_end_time_slot_2" [
stateTransformation="JSONPATH:$.Timeslots.Discharge_end_time_slot_2"
]
Type string : Charge_start_time_slot_2 "Charge_start_time_slot_2" [
stateTransformation="JSONPATH:$.Timeslots.Charge_start_time_slot_2"
]
Type string : Charge_end_time_slot_2 "Charge_end_time_slot_2" [
stateTransformation="JSONPATH:$.Timeslots.Charge_end_time_slot_2"
]
//GIVENERGY SETTINGS DATA
Type number : Battery_Power_Cutoff "Battery_Power_Cutoff" [
stateTransformation="JSONPATH:$.Control.Battery_Power_Cutoff"
]
Type number : Target_SOC "Target_SOC" [
stateTransformation="JSONPATH:$.Control.Target_SOC"
]
Type switch : Enable_Charge_Schedule "Enable_Charge_Schedule" [
stateTransformation="JSONPATH:$.Control.Enable_Charge_Schedule",
on="enable",
off="disable"
]
Type switch : Enable_Discharge_Schedule "Enable_Discharge_Schedule" [
stateTransformation="JSONPATH:$.Control.Enable_Discharge_Schedule",
on="enable",
off="disable"
]
Type switch : Enable_Discharge "Enable_Discharge" [
stateTransformation="JSONPATH:$.Control.Enable_Discharge",
on="enable",
off="disable"
]
Type number : Battery_Charge_Rate "Battery_Charge_Rate" [
stateTransformation="JSONPATH:$.Control.Battery_Charge_Rate"
]
Type number : Battery_Discharge_Rate "Battery_Discharge_Rate" [
stateTransformation="JSONPATH:$.Control.Battery_Discharge_Rate"
]
}
Items
/*
EQUIPMENT
*/
Group gGivEnergy "GivEnergy" (gIndoor) ["Equipment"]
Group gGivEnergySettings "GivEnergy Settings" (gGivEnergy) ["Equipment"]
Group gGivEnergyPowerData "GivEnergy Power Data" (gGivEnergy) ["Equipment"]
Group gGivEnergyEnergyData"GivEnergy Energy Data" (gGivEnergy) ["Equipment"]
Group gGivEnergyBatteryData"GivEnergy Battery Data" (gGivEnergy) ["Equipment"]
Group gGivEnergyGridData"GivEnergy Grid Data" (gGivEnergy) ["Equipment"]
/*
SETTINGS
*/
String strGivEnergy_Charge_Start "GivEnergy charge start" (gGivEnergySettings) ["Setpoint", "Timestamp"] {channel="http:url:givenergy:Charge_start_time_slot_1"}
String strGivEnergy_Charge_End "GivEnergy charge end" (gGivEnergySettings) ["Setpoint", "Timestamp"] {channel="http:url:givenergy:Charge_end_time_slot_1"}
Switch sGivEnergy_Charge_Enable "GivEnergy charge enable" (gGivEnergySettings) ["Setpoint", "Timestamp"] {channel="http:url:givenergy:Enable_Charge_Schedule"}
Dimmer dGivEnergy_Charge_Upper_Percent_Limit "GivEnergy charge upper percent limit" (gGivEnergySettings) ["Setpoint"] {channel="http:url:givenergy:Target_SOC"}
Number nGivEnergy_Battery_Charge_Power "GiveEnergy battery charge power" (gGivEnergySettings) ["Measurement", "Power"] {channel="http:url:givenergy:Charge_Power"}
String strGivEnergy_Discharge_Start "GivEnergy discharge start" (gGivEnergySettings) ["Setpoint", "Timestamp"] {channel="http:url:givenergy:Discharge_start_time_slot_1"}
String strGivEnergy_Discharge_End "GivEnergy discharge end" (gGivEnergySettings) ["Setpoint", "Timestamp"] {channel="http:url:givenergy:Discharge_end_time_slot_1"}
Switch sGivEnergy_Discharge_Enable "GivEnergy discharge enable" (gGivEnergySettings) ["Switch", "Battery"] {channel="http:url:givenergy:Enable_Discharge_Schedule"}
Number dGivEnergy_Cutoff_Percent_Limit "GivEnergy cutoff percent limit" (gGivEnergySettings) ["Setpoint"] {channel="http:url:givenergy:Battery_Power_Cutoff"}
Number nGivEnergy_Battery_Discharge_Power "GiveEnergy battery discharge power" (gGivEnergySettings) ["Measurement", "Power"] {channel="http:url:givenergy:Discharge_Power"}
/*
POWER DATA
*/
//CURRENT TOTAL POWER USAGE BY THE HOUSE ITSELF (EXCLUDES INEFFICIENCIES)
Number nGivEnergy_Load_Power "GiveEnergy load power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="http:url:givenergy:Load_Power"}
//CURRENT POWER FROM THE GRID, UNSIGNED
Number nGivEnergy_Import_Power "GiveEnergy import power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="http:url:givenergy:Import_Power"}
//CURRENT POWER FROM GRID, SIGNED (IMPORT IS NEGATIVE)
Number nGivEnergy_Grid_Voltage "GiveEnergy grid voltage" (gGivEnergyPowerData) ["Measurement", "Voltage"] {channel="http:url:givenergy:Grid_Voltage"}
Number nGivEnergy_Grid_Current "GiveEnergy grid current" (gGivEnergyPowerData) ["Measurement", "Current"] {channel="http:url:givenergy:Grid_Current"}
Number nGivEnergy_Grid_Power "GiveEnergy grid power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="http:url:givenergy:Grid_Power"}
//CURRENT POWER TO (-) OR FROM (+) BATTERY
Number nGivEnergy_Battery_Power "GiveEnergy battery power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="http:url:givenergy:Battery_Power"}
//CURRENT BATTERY SOC IN %
Number nGivEnergy_Battery_Percent "GiveEnergy battery percent" (gGivEnergyPowerData) ["Measurement", "Charge"] {channel="http:url:givenergy:Battery_SOC"}
//CURRENT CHARGE AND DISCHARGE POWERS
//POWER TO INVERTOR FROM GRID WHEN CHARGING
Number nGivEnergy_AC_Charge_Power "GiveEnergy AC charge power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="http:url:givenergy:AC_Charge_Power"}
//POWER TO BATTERY WHEN CHARGING ONLY (ZERO WHEN DISCHARGING). THIS IS POWER AFTER INVERSION - SOME nGivEnergy_AC_Charge_Power IS LOST IN THE INVERTOR
Number nGivEnergy_Charge_Power "GiveEnergy charge power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="http:url:givenergy:Charge_Power"}
//POWER FROM BATTERY WHEN DISCHARGING ONLY (ZERO WHEN CHARGING)
Number nGivEnergy_Discharge_Power "GiveEnergy discharge power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="http:url:givenergy:Discharge_Power"}
//CURRENT POWER OUTPUT OF INVERTOR
Number nGivEnergy_Inverter_Power "GiveEnergy inverter power" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="http:url:givenergy:Invertor_Power"}
//FLOWS
//EXPECT THE SAME AS nGivEnergy_Grid_Power
Number nGivEnergy_Flow_Grid_to_House "GiveEnergy power flow grid to house" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="http:url:givenergy:Grid_to_House"}
//EXPECT THE SAME AS nGivEnergy_Battery_Power and nGivEnergy_Discharge_Power
Number nGivEnergy_Flow_Battery_to_House "GiveEnergy power flow battery to house" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="http:url:givenergy:Battery_to_House"}
//EXPECT THE SAME AS nGivEnergy_Charge_Power
Number nGivEnergy_Flow_Grid_to_Battery "GiveEnergy power flow grid to battery" (gGivEnergyPowerData) ["Measurement", "Power"] {channel="http:url:givenergy:Grid_to_Battery"}
/*
ENERGY DATA
*/
//TODAY
//TOTAL ENERGY IMPORTED FROM GRID
Number nGivEnergy_Today_Grid_Import "GiveEnergy today grid import" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:Import_Energy_Today_kWh"}
//ENERGY IMPORTED DURING NIGHT
Number nGivEnergy_Night_Energy "GiveEnergy night energy" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:Night_Energy_kWh"}
//ENERGY IMPORTED DURING DAY
Number nGivEnergy_Day_Energy "GiveEnergy day energy" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:Day_Energy_kWh"}
//AMOUNT DIVERTED TO CHARGING BATTERY
Number nGivEnergy_Today_AC_Charge "GiveEnergy today AC charge" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:AC_Charge_Energy_Today_kWh"}
//AMOUNT THAT THE BATTERY ACTUALLY CHARGED
Number nGivEnergy_Today_Battery_Charge "GiveEnergy today battery charge" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:Battery_Charge_Energy_Today_kWh"}
//AMOUNT THAT THE BATTERY ACTUALLY DISCHARGED
Number nGivEnergy_Today_Battery_Discharge "GiveEnergy today battery discharge" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:Battery_Discharge_Energy_Today_kWh"}
//ENERGY THAT THE INVERTOR SUPPLIED TO THE HOUSE, FROM THE BATTERY
Number nGivEnergy_Today_Invertor "GiveEnergy today invertor" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:Invertor_Energy_Today_kWh"}
//TOTAL ENERGY CONSUMED BY HOUSE
Number nGivEnergy_Today_Consumption "GiveEnergy today home actual consumption" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:Load_Energy_Today_kWh"}
//TOTAL
//TOTAL ENERGY IMPORTED FROM GRID
Number nGivEnergy_Total_Grid_Import "GiveEnergy total grid import" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:Import_Energy_Total_kWh"}
//AMOUNT DIVERTED TO CHARGING BATTERY
Number nGivEnergy_Total_AC_Charge "GiveEnergy total AC charge" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:AC_Charge_Energy_Total_kWh"}
//AMOUNT THAT THE BATTERY ACTUALLY CHARGED
Number nGivEnergy_Total_Battery_Charge "GiveEnergy total battery charge" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:Battery_Charge_Energy_Total_kWh"}
//AMOUNT THAT THE BATTERY ACTUALLY DISCHARGED
Number nGivEnergy_Total_Battery_Discharge "GiveEnergy total battery discharge" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:Battery_Discharge_Energy_Total_kWh"}
//ENERGY THAT THE INVERTOR SUPPLIED TO THE HOUSE, FROM THE BATTERY
Number nGivEnergy_Total_Invertor "GiveEnergy total invertor" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:Invertor_Energy_Total_kWh"}
//TOTAL ENERGY CONSUMED BY HOUSE
Number nGivEnergy_Total_Consumption "GiveEnergy total home actual consumption" (gGivEnergyEnergyData) ["Measurement", "Energy"] {channel="http:url:givenergy:Load_Energy_Total_kWh"}
Still no commands yet. TBD.
@barneyd this may be interesting for you, as it doesn’t require extra rules, nor an extra service (MQTT, if you don’t already use it…).
Thanks for sharing. I guess it comes down to running a service that interacts with the inverter and makes the parameters available to http or MQTT or running a program to interrogate the inverter directly.
Shame they couldn’t just use standard Modbus!
I’m having trouble with commands. GivTCP theoretically provides the means to control the inverter but I haven’t managed to get it working.
I’m looking at using MQTT (rather than API) and so I’ve added the things and items files to OH (as @hafniumzinc details above) -
adjusting the data for my inverter serial number and the MQTT ID in place of ‘mosquitto’
like this:
Thing mqtt:topic:52ca13ce9e:givenergy-power “Generic MQTT Thing - GivEnergy Power” (mqtt:broker:52ca13ce9e)
and everything appears within the UI.
I have MQTT broker working in OH and assumed that I’d need to create generic MQTT brokers for Power, Energy, Timeslot & Settings.
I’ve done this and all show as online.
Britkat states: ‘For Invertor autodiscovery to function your container must run on the “Host” network within docker (not Bridge)’.
Does this mean that using a generic MQTT broker is incorrect?
Referring back to Britkats github instructions, it recommends installing using Docker. So I’ve installed Docker, changed the various parameters in docker-compose.yml and put the .yml file in the getting-started directory (I assume this is correct as there was already a ‘blank’ file there).
I use the command: ‘docker compose up -d’ and get various build messages etc ending with container started. Looks good so far.
How can I tell if it’s working? Running MQTT Explorer doesn’t show me any GivEnergy data, only the MQTT stuff I already have running.
Nothing in OH UI is showing any data, only NULL.
No, you only need one MQTT Broker/Bridge Thing total within openHAB, which will communicate with your external MQTT broker. Generic openHAB MQTT Things (as shown in my post) will then talk to your external MQTT broker via the openHAB Broker/Bridge Thing.
Do you have an external MQTT broker setup?
Well, this needs fixing first before doing anything with openHAB. For some reason, your external MQTT broker is not receiving any communications from your Docker container.
Re the broker - I have a broker installed in OH (it has the IP address set the same as my Pi - is this what you mean by external?). Then I’ve got generic brokers talking to the broker for stuff like my tuya lights and switches etc. This is running fine.
I presumed that I’d need to create generic MQTT things via the broker/bridge Thing for the GivEnergy stuff, just like I do for other MQTT Things (like tuya lights etc). I could be wrong.
So sounds like it’s ‘your external MQTT broker is not receiving any communications from your Docker container’ that could be the problem.
I’m now slightly (!) confused - having done this:
docker pull britkat/giv_tcp-ma
Britkat suggests creating a container for the various ENV stuff. I’m not sure I’ve done that. The only container I can see is ‘openhab’. How do I create a container or access the Britkat container? - I tried to create one called GivEnergy but get this message:
Unable to find image ‘givenergy:latest’ locally
Error response from daemon: pull access denied for givenergy, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied
As you can probably tell I’ve got no experience with docker.
I’m not sure what any of this means. I have one compose file, and just do docker compose up within the folder that contains the compose file - this enables me to see the logs to check if everything is working.
version: "3.9"
services:
GivTCP:
image: britkat/giv_tcp-ma:2.1.3
ports:
- "1883:1883" # MQTT
- "6345:6345" # REST (add increments for each invertor)
- "3000:3000" # This should match the WEB_DASH_PORT ENV below
- "6379:6379" # Redis for job queueing
- "9181:9181" # RQ Dashboard to view job scheduling
environment:
## Critical to update
- NUMINVERTORS=1 # Set this to the number of Invertors in your setup, then replicate the next two lines for each invertor (changing the last number of the ENV)
- INVERTOR_IP_1=192.168.1.95 # Set this to the IP address of your Invertor on you rlocal network
- NUMBATTERIES_1=1 # Number of battery modules installed and connected to the above invertor
- MQTT_OUTPUT=False # "True" if you wantto publish your data to MQTT, "False" otherwise
- MQTT_ADDRESS=192.168.1.212 # IP address of an existing MQTT broker, or leave as "127.0.0.1" to use the internal broker
- MQTT_USERNAME= # Username of your existing broker, if needed. Not required for internal broker
- MQTT_PASSWORD= # Password of your existing broker, if needed. Not required for internal broker
- HOSTIP=192.168.1.215 # External IP addressof the docker host (needed for web dashboard)
- CACHELOCATION=/config/GivTCP # Location of cache data, this folder can be mapped to a persistence storage outside the container
- TZ=Europe/London # Set to your Timezone
## Optional
- MQTT_TOPIC= # Root topic to publish data to for Invertor 1. If left blank it will default to GivEnergy/<invertor_serial_number>
- MQTT_TOPIC_2= # Root topic to publish data to for Invertor 2. If left blank it will default to GivEnergy/<invertor_serial_number>
- MQTT_TOPIC_3= # Root topic to publish data to for Invertor 3. If left blank it will default to GivEnergy/<invertor_serial_number>
- MQTT_PORT=1883 # Port of your existing broker, leave as "1883" for internal broker
- LOG_LEVEL=Info # Level of logs to be reported: "Error", "Info" or "Debug"
- PRINT_RAW=False # If True this will publish all inverotr data unprocessed as well as standard data
- SELF_RUN=True # If True the container will self-run and connect and publish data. If "False" the you will need to trigger externally via REST
- SELF_RUN_LOOP_TIMER=10 # Wait time between every read command to the invertor
- INFLUX_OUTPUT=False # "True" if you want to publish your data to InfluxDB, "False" otherwise
- INFLUX_URL= # URL of an external Influx instance
- INFLUX_TOKEN= # Access Token for your Influx instance
- INFLUX_BUCKET= # Data Bucket of yourInflux instance you want data sent to
- INFLUX_ORG= # Influx instance Organisation
- HA_AUTO_D=False # If True (and if MQTT_OUTPUT is True) this will publish Home Assistant Auto Discovery messages to the broker
- HADEVICEPREFIX=GivTCP # Defines the preficfor all entities in Home Assistant
- PYTHONPATH=/app
- DYNAMICTARIFF=False # When set to true DAYRATESTART and NIGHTRATESTART times are ignored and tariff rates are changed by a dedicated entity/function
- DAYRATE=0.4718 # Price in £/$ for your daytime electricity per kWh
- NIGHTRATE=0.1368 # Price in £/$ for your night time electricity per kWh
- EXPORTRATE=0.00 # Price in £/$ for your export electricity per kWh
- DAYRATESTART=08:41 # Time in HH:MM when your day time\expensive tariff kicks in
- NIGHTRATESTART=01:35 # Time in HH:MM when your night time\cheap tariff kicks in
- WEB_DASH=True # Enable the web dashboard
- WEB_DASH_PORT=3000 # Port to serve the web dashboard on
- SMARTTARGET=False # Enables the PALM capability, requires the three ENV below to be set
- GEAPI= # API Key for the GivEnergy Cloud
- SOLCASTAPI= # API key for Solcast
- SOLCASTSITEID= # SiteID for Solcast site (first array)
- SOLCASTSITEID2= # SiteID for Solcast site (second array)
- DATASMOOTHER=medium # Set the data smoothing to most agressive setting (High, medium, low, none)
restart: always
privileged: true
For me, my MQTT Broker is running on a device at 192.168.1.212, whilst my giv_tcp container is running at 192.168.1.215. Sounds like in your setup these two addresses will be the same - your Pi.
So as I understand it, the docker compose up starts the container (I happened to have put the compose file in docker-giv directory.
When I run that, I get this:
Container docker-giv-GivTCP-1 Recreated
Attaching to docker-giv-GivTCP-1
Error response from daemon: driver failed programming external connectivity on endpoint docker-giv-GivTCP-1 (f331d4421c740571fc9087369249fc7e499b12c84f2c719a6e8c6f07fd0c272a): Error starting userland proxy: listen tcp4 0.0.0.0:1883: bind: address already in use
So from what I gather, I’m still not seeing any broker.
Here is my compose file.
version: "3.9"
services:
GivTCP:
image: britkat/giv_tcp-ma:2.1.7
ports:
- "1883:1883" # MQTT
- "6345:6345" # REST (add increments for each invertor)
- "3000:3000" # This should match the WEB_DASH_PORT ENV below
- "6379:6379" # Redis for job queueing
- "9181:9181" # RQ Dashboard to view job scheduling
environment:
## Critical to update
- NUMINVERTORS=1 # Set this to the number of Invertors in your setup, then replicate the next two lines for each invertor (changing the last number of the ENV)
- INVERTOR_IP_1=192.168.61.48 # Set this to the IP address of your Invertor on your local network
- NUMBATTERIES_1=1 # Number of battery modules installed and connected to the above invertor
- MQTT_OUTPUT=True # "True" if you want to publish your data to MQTT, "False" otherwise
- MQTT_ADDRESS=192.168.61.250 # IP address of an existing MQTT broker, or leave as "127.0.0.1" to use the internal broker
- MQTT_USERNAME= # Username of your existing broker, if needed. Not required for internal broker
- MQTT_PASSWORD= # Password of your existing broker, if needed. Not required for internal broker
- HOSTIP=192.168.61.250 # External IP address of the docker host (needed for web dashboard)
- CACHELOCATION=/config/GivTCP # Location of cache data, this folder can be mapped to a persistence storage outside the container
- TZ=Europe/London # Set to your Timezone
## Optional
- MQTT_TOPIC=GivEnergy/EA2302G289 # Root topic to publish data to for Invertor 1. If left blank it will default to GivEnergy/<invertor_serial_number>
- MQTT_TOPIC_2= # Root topic to publish data to for Invertor 2. If left blank it will default to GivEnergy/<invertor_serial_number>
- MQTT_TOPIC_3= # Root topic to publish data to for Invertor 3. If left blank it will default to GivEnergy/<invertor_serial_number>
- MQTT_PORT=1883 # Port of your existing broker, leave as "1883" for internal broker
- LOG_LEVEL=Info # Level of logs to be reported: "Error", "Info" or "Debug"
- PRINT_RAW=True # If True this will publish all invertor data unprocessed as well as standard data
- SELF_RUN=True # If True the container will self-run and connect and publish data. If "False" the you will need to trigger externally via REST
- SELF_RUN_LOOP_TIMER=5 # Wait time between every read command to the invertor
- INFLUX_OUTPUT=False # "True" if you want to publish your data to InfluxDB, "False" otherwise
- INFLUX_URL= # URL of an external Influx instance
- INFLUX_TOKEN= # Access Token for your Influx instance
- INFLUX_BUCKET= # Data Bucket of your Influx instance you want data sent to
- INFLUX_ORG= # Influx instance Organisation
- PYTHONPATH=/app
- DYNAMICTARIFF=False # When set to true DAYRATESTART and NIGHTRATESTART times are ignored and tariff rates are changed by a dedicated entity/function
- DAYRATE=0.395 # Price in £/$ for your daytime electricity per kWh
- NIGHTRATE=0.155 # Price in £/$ for your night time electricity per kWh
- EXPORTRATE=0.04 # Price in £/$ for your export electricity per kWh
- DAYRATESTART=05:30 # Time in HH:MM when your day time\expensive tariff kicks in
- NIGHTRATESTART=23:30 # Time in HH:MM when your night time\cheap tariff kicks in
- WEB_DASH=False # Enable the web dashboard
- WEB_DASH_PORT=3000 # Port to serve the web dashboard on
- SMARTTARGET=False # Enables the PALM capability, requires the three ENV below to be set
- GEAPI= # API Key for the GivEnergy Cloud
- SOLCASTAPI= # API key for Solcast
- SOLCASTSITEID= # SiteID for Solcast site (first array)
- SOLCASTSITEID2= # SiteID for Solcast site (second array)
- DATASMOOTHER=medium # Set the data smoothing to most agressive setting (High, medium, low, none)
- PALM_WINTER=01,02,03,10,11,12 # Comma delimited list of the winter months (01=January, etc)
- PALM_SHOULDER=04,05,09 # Comma delimited list of months in which consumption can vary so SOC calculation should be more cautious
- PALM_MIN_SOC_TARGET=25 # Lower limit for state of charge (summertime)
- PALM_MAX_SOC_TARGET=45 # Lower limit for SoC limit in shoulder months
- PALM_BATT_RESERVE=4 # Battery reserve for power cuts (minmum of 4%)
- PALM_BATT_UTILISATION=0.85 # Usable proportion of battery (100% less reserve and any charge limit) on a scale of 0-1
- PALM_CHARGE_RATE=2.5 # Inverter charge/discharge rate in kW
- PALM_BATT_CAPACITY=10.4 # Nominal battery capacity in kWh
restart: always
privileged: true
I’ve tried both True & False for MQTT_OUTPUT with the same results.
A bit of a noob question - you mentioned looking at the logs - which log do I need to check?
Yes I installed Mosquitto. MQTT Explorer screenshot shown here:
As you can see I have numbers of Things connected via the broker. These are via generic MQTT brokers/bridge etc. and all show real time data.
I susepct that the problem is around the docker install etc. In the error message I showed earlier, it says ‘bind: address already in use’. Any idea what that means?
Also do I have this correct within the Things file?
It looks like it’s trying to start up its own MQTT broker. I think there are some container images which had that option, but didn’t think the latest ones did…