Update on GivTCP latest version

@britkat I did a new thread because as a new user I’m not allowed another reply in the primary >_<

The latest version worked as I expected with the intermittent failures but I am now starting to get a working dashboard up and can soon put some logic in as well. Thank you for this - wish GivEnergy just provided it out of the box but it is working thanks to you!

On the errors I am gradually applying the code snippet posted by @MagicMagicD which ignores the failing calls. I am not a good coder so it’s been trial and error till it works but I’m going in the right direction.

My final struggle is to derive a value for the current demand from the house. I think it can be done (as GivEnergy do it in their dashboard) from PV, discharge, import and export numbers but wow, the syntax required is giving me a migraine - I can get by in bash and php but this is plain ugly :slight_smile:

Again - thanks to both of you - much appreciated

Mike, the value you are trying to derive is Load Power. It is provided through GivTCP. Let me know if you can’t find it

I’ve setup a ‘mock’ dashboard that looks like part of the GivEnergy one:

This is using two Glance card’s for the top two rows and an ApexChart card for the main graph, all wrapped inside a custom grid-based layout to enable it to scale better.

I’d hoped to be able to get it to show previous days too but the ApexChart card doesn’t support it right now – I’ve dropped a feature request to the author to see if it can be added that way, otherwise I may end up forking it and doing it myself – it’ll just take longer as I have very little free time.

1 Like

Thank you! - I had looked through them but missed it. That saves me a ton of paracetamol… However, I should probably try to figure out how to use calculated sensor values as it will likely come in useful at some point, but later :slight_smile:

Even with the intermittent “misses” this is so much better than the stock dashboards because I found the latency totally annoying - boil the kettle for a minute and see 3.5kw demand on the board for another 5 - drove me mad…

That looks awesome! I can probably manage the top rows or similar but the graph is way beyond me :slight_smile:

Thanks for the code to use last values - I would never have figured that out.

@MagicMagicD A “final” favour - I’ve updated all the straight forward sensors to be persistent but I’m struggling with the control-mode, energy class sensors and things like the slot start end values.

I’ve tried to use the similar construct to the power sensors and changed what seemed to make sense but clearly I have no sense :slight_smile:

Any chance you could give an example, or share your working givtcp.yaml?

Thanks

Mike

Hi Mike,

I would share the whole file, but it’s quite large to paste in to here and it doesn’t look like there are any obvious file sharing features, or I’m not privilaged enough to use them, so here’s a sample:

      - name: "GivTCP Charge Slot 1 Start"
        device_class: timestamp
        state: >
          {% if state_attr('sensor.givtcp','Timeslots') is not none %}
            {{ strptime(state_attr('sensor.givtcp','Timeslots')['Charge start time slot 1'],'%H:%M:%S').replace(year=now().year,month=now().month,day=now().day).timestamp()|timestamp_local() }}
          {% else %}
            {{ states('sensor.givtcp_charge_slot_1_start') }}
          {% endif %}
        icon: "mdi:calendar-clock"

      - name: "GivTCP Control Mode"
        state: >
          {% if state_attr('sensor.givtcp','Control') is not none %}
            {{ state_attr('sensor.givtcp','Control')['Mode'] }}
          {% else %}
            {{ states('sensor.givtcp_control_mode') }}
          {% endif %}

Thank you - working my way through and changing them.

One interesting thing I noticed is that the value displayed to me for Control Mode always seems to be 1 whereas in my system it’s currently set (and working) in mode 3. Either the value given is wrong or my transfer of your code is messed up and I’m just presenting 1 as a constant somehow.

Hi Guys, I’ve been plugging away at trying to get MQTT auto discovery working, and its pretty much there. The latest dev image will push discovery messages to HA, which then creates all the sensors, switches, selects and number to allow control and reading. All without needing any yaml… You just need to make sure your mqtt_address is set to point to a broker that HA uses (or add the GivTCP mqtt broker into HA via integrations)

Docker Hub (use “dev” tag)

This might help, and I want some help in testing it. The only thing I haven’t cracked is timeslots, as they aren’t supported by mqtt discovery, so they are read only for now.

(I’ve fixed mode select stuff too, which was broken)

Hey Mark - does this mean the existing stand-alone givtcp will be deprecated or is the MQTT option in addition? I’m trying to avoid adding MQTT at least for now to try and give my already fried brain a rest :slight_smile:

MQTT has always been an option and this is an extension of it. It still requires the docker container, so it won’t be depreciated for the foreseeable

That’s great, thanks for the answer and all the work put into this - it’s making a huge difference to my understanding and usage of the PV setup.

Thanks Mark. This is looking really good now.

On the discovery side, I have 2 inverters and 2 instances of GivTCP running in docker containers outputting to the mqtt broker on HA. If I subscribe to the HA broker using eg MQTT explorer I only see one inverter’s details under:

homeassistant/sensors/GivEnergy.
The items have all the right paths for the sensor config. (I chose GivEnergy/inverter serial no/item when I set up the docker environment.)

Am I doing something wrong or is this a discovery limitation and I should add the other inverter sensors manually?

Ah good point. The auto discovery messages will probably overwrite each other… I’ve not set it to be safe for multiple invertors. Let me have a look at this next week. For now you might need to manually add the important information.

1 Like

Does anyone know the difference between the battery SOC and the SOC? They report different values but both deplete from 100% as the battery discharges from 100%. The battery SOC seems to stop at 9% and the SOC drops to 4% (my reserve is set at 4%).

Maybe this is a difference between usable capacity and actual capacity?

sensor.givtcp_battery_soc
sensor.givtcp_soc

image