@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
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.
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
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…
@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
Any chance you could give an example, or share your working givtcp.yaml?
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)
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
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.
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?