thx very much da-anda, indeed, it was the formatting. i did a quick test and everything looks fine so far.
Danke!
Wohoo!
Nice!
Config valid, i get the e3dc states et all, but no data:
2021-05-18 17:51:27 ERROR (SyncWorker_9) [homeassistant.components.modbus.modbus] Pymodbus: Modbus Error: [Connection] ModbusTcpClient(10.2.1.10:502): Connection unexpectedly closed 0.000040 seconds into read of 8 bytes without response from unit before it closed connection
Port is open, tho:
nmap 10.2.1.10 -p 502
Starting Nmap 7.80 ( https://nmap.org ) at 2021-05-18 17:52 CEST
Nmap scan report for 10.2.1.10
Host is up (0.00037s latency).
PORT STATE SERVICE
502/tcp open mbap
Any advice, please?
do you get no data at all or just some? Please make sure that the Modbus mode in your E3DC is NOT(!) set to “sunspec mode”, as that one will only provide a fraction of the data. No idea otherwise though.
Good push in the right direction:
Turns out the querying server must be in the same subnet as the e3dc, else RST is sent.
NAT’ed the query; bam works
Hey,
is it somehow possible to enable the new Energy Grid thing with this?
Sure, you need to create some specific sensors and integration sensors, but it does work. See this topic for some hints. At the time of this topic there was no support yet for the batteries. These require further sensors to be created.
But do not expect a perfect accuracy compared to the E3DC Webinterface. For it to be accurate, we’d need direct access to the energy values (kWh) instead of the power read outs. I opened a ticket with E3DC and requested an update to the Modbus interface. Maybe if enough people request this feature, they will be willing to adapt.
WOW, just WOW
exactly what i was looking for. Thank you da-anda!
What is important to know is that E3DC Modbus ONLY accepts traffice from the same subnet.
- Set up NAT/masquerade
- Move to the same subnet
Now it is working fine.
thank you for your efforts!
much appreciated.
Legi,
would you mind to share the YAML Code for your lovely chart of the Fotovoltank?
Locks like the one i can see from e3dc.
Would love to have this as well.
thanks
armin
Glad you could sort out the networking issues, wouldn’t have had any idea what to tell.
As for the lovelace card - check HACS for the power-distribution-card
or install it manually from here GitHub - JonahKr/power-distribution-card: A Lovelace Card for visualizing power distributions.
Thanks da-anda
well, had to move the server at the end and get rid of my dmz. NAT should have worked but didn’t.
Took a few paket traces and had loads of retransmissions. So it was easier for me to move the server.
I will take a look at the link. But have to say that i am a “copy & paste” programmer lets see how far my skills can go.
Another thing is that i do run my system in docker so no supervisior is there.
But hey actually i am proud. A week ago i did not even knew what home automation could give me.
Ordered some ikea lamps… very curious about it…
cheers A.
Same here… I just checked and found
So something has to be added and you can use status attributes on the developer tools tab.
Some also put it into the customization.yamls. Looks like wildcards working as well.
cheers A
@ArminF well, easiest way to install custom components is via HACS, so follow it’s install instructions (will also run in your setup) and installing community components is as simple as one click. https://hacs.xyz/
Aloha da-anda
Thanks! I could install HACS and guess what… even i could do it
works like a charm. I am very happy.
No i need check how i get this energy stuff up and running.
Evening,
all up and running. maybe some fine tuning here and there. But for now i am very pround
DId anyone of you activated the Energy Management?
I did and figured most of it out.
There seems to be a battery check every morning on the E3DC as i get some charge/discharge values even when there is no solar power and battery is not in discharge.
Do you get the same? I do not think my settings are wrong actually. Checked them several times.
For the entities i used a template sensor and integration for the conversion from watt to kwh.
Sensors i had to split into only positive values by using ABS.
thanks A
@ArminF sorry didn’t read your question until today.
Do you mean this:
type: custom:power-distribution-card
title: Photovoltaik Anlage
animation: slide
entities:
- solar:
entity: sensor.e3dc_solar_hausdach
icon: mdi:weather-sunny
name: Hausdach
unit_of_display: adaptive
entity: sensor.e3dc_solar_hausdach
name: Hausdach
decimals: '3'
unit_of_display: kW
icon_color:
bigger: ''
equal: ''
smaller: ''
preset: solar
icon: mdi:home-roof
invert_value: false
- decimals: '3'
display_abs: true
name: Garage
unit_of_display: kW
icon: mdi:garage
producer: true
entity: sensor.e3dc_solar_extern_garage
preset: producer
icon_color:
bigger: ''
equal: ''
smaller: ''
invert_value: true
- grid:
entity: sensor.e3dc_netzbezug
name: Netz
unit_of_display: adaptive
invert_value: false
entity: sensor.e3dc_netzbezug
name: Netzbezug
decimals: '3'
unit_of_display: kW
icon_color:
bigger: ''
equal: ''
smaller: ''
preset: grid
icon: mdi:transmission-tower
- battery:
entity: sensor.e3dc_batterie
icon: mdi:battery-50
name: Batterie
unit_of_display: adaptive
invert_value: true
entity: sensor.e3dc_hausbezug
name: Hausbezug
decimals: '3'
unit_of_display: kW
icon_color:
bigger: ''
equal: ''
smaller: ''
preset: consumer
icon: mdi:home-assistant
invert_value: true
- home:
entity: sensor.e3dc_hausbezug
name: Haus
unit_of_display: adaptive
invert_value: true
entity: sensor.e3dc_batterie
name: Batterie
decimals: '3'
unit_of_display: kW
icon_color:
bigger: ''
equal: ''
smaller: ''
preset: battery
icon: ''
invert_value: true
- decimals: '3'
display_abs: true
name: car
unit_of_display: kW
consumer: true
icon: mdi:car-electric
entity: sensor.e3dc_wallbox
preset: car_charger
icon_color:
bigger: ''
equal: ''
smaller: ''
invert_value: true
center:
type: bars
content:
- name: Batterie
preset: ratio
bar_color: green
bar_bg_color: red
entity: sensor.e3dc_batterie_ladung
invert_value: false
Hi Peter,
no worries. I could figure it out and got the nice card up and running.
It seems to be a battery/system check from our E3DC system which shows up daily.
Was my last post. So i accepted it as normal.
Rest is working proper and i am very happy with the details/statistics i get out of it.
cheers and merry christmas!
Armin
Hi Armin,
its very nice, can you post your entities please :-).
in order to use the Energy component of HA, you need a couple additional template sensors to convert the +/- values coming from e3dc to separate sensors for in and out.
These are all my e3dc related sensors (copied from a split out yaml, you if you have your config all in the main file, you have to adjust indention etc)
- platform: template
sensors:
e3dc_autarky:
friendly_name: 'E3DC Autarky'
unit_of_measurement: '%'
value_template: "{{ (states('sensor.e3dc_autarky_and_consumption')|int / 256)|round(0,'floor') }}"
e3dc_own_consumption:
friendly_name: 'E3DC Own Consumption ratio'
unit_of_measurement: '%'
value_template: "{{ ((states('sensor.e3dc_autarky_and_consumption')|int / 256 - states('sensor.e3dc_autarky')|int) * 256)|round(0,'floor') }}"
# Grid out
e3dc_grid_power_out:
unit_of_measurement: 'W'
device_class: power
value_template: >
{% if states('sensor.e3dc_grid_power') | int > 0 %}
0
{% else -%}
{{ (states('sensor.e3dc_grid_power') | int) | abs }}
{% endif %}
# Grid in
e3dc_grid_power_in:
unit_of_measurement: 'W'
device_class: power
value_template: >
{% if states('sensor.e3dc_grid_power') | int > 0 %}
{{ states('sensor.e3dc_grid_power') | int }}
{% else -%}
0
{% endif %}
# Battery out
e3dc_battery_power_out:
unit_of_measurement: 'W'
device_class: power
value_template: >
{% if states('sensor.e3dc_battery_power') | int > 0 %}
0
{% else -%}
{{ (states('sensor.e3dc_battery_power') | int) | abs }}
{% endif %}
# Battery in
e3dc_battery_power_in:
unit_of_measurement: 'W'
device_class: power
value_template: >
{% if states('sensor.e3dc_battery_power') | int > 0 %}
{{ states('sensor.e3dc_battery_power') | int }}
{% else -%}
0
{% endif %}
- platform: integration
source: sensor.e3dc_battery_power_out
name: energy_battery_discharge
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_battery_power_in
name: energy_battery_charge
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_solar_power
name: energy_solar_production
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_power_consumption
name: energy_consumption
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_grid_power_in
name: energy_grid_usage
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_grid_power_out
name: energy_grid_feed_in
unit_prefix: k
round: 2
With the absolut value it worked like a charm for me as well.
Rest i splitted in to folders and extra yaml files.
Hi Armin,
your card look very nice. I have a E3DC Pro.
Could you perhaps post your configuration for the card (post 47/51)??
Grettings Matthias