mriceman11 / e3dc-homeassistant Goto Github PK
View Code? Open in Web Editor NEWADD e3dc Data to your HomeAssistant
ADD e3dc Data to your HomeAssistant
May you please add the SGReady Status?
It is behind the ID 40137
Lenght = 1
Datatype = UInt16
2 = Normal Operation
3 = Solar system is in the overproduction mode.
This is required to start actions based on that, like activate additional power consumers, like the dryer or just use it in combination with a heatpump, like opening all the valves in the house.
The value given by the sensor.e3dc_external_power is a negative number. To be able to use it in the energy panel, the sensor should be turned into an absolute value. Suggest adding this to sensors.yaml.
Hi,
first of all, many thanks for making this! This is awesome.
Not sure if my issue is actually related to this project or if it's a Modbus issue.
When adding the battery information it says entity not available.
However, I do have historic data on this entity:
So I'm not sure if this is really an issue with the integration or if Modbus for some reason can't get any data from this register any longer. (Battery is currently being charged, not discharging, so I could also imagine it's a conversion issue).
When upgrading HA today I got a warning: retry_on_empty
: is deprecated and will be removed in version 2024.4
Would the solution be just to remove the retry_on_empty
line from modbus.yaml? Or will this brake the configuration?
great work btw. I hope you are still active.
Hello there,
I am pretty happy about your integration, thank you very much. One little issue though: I'm constantly getting this Warning for the battery_discharge_power sensor (only for that one as far as I see):
Logger: homeassistant.components.sensor
Source: components/sensor/init.py:597
Integration: Sensor (documentation, issues)
First occurred: 10:35:00 (2 occurrences)
Last logged: 10:43:15Sensor sensor.e3dc_battery_discharge_power has device class power, state class None and unit W thus indicating it has a numeric value; however, it has the non-numeric value: (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+template%22
Sensor sensor.e3dc_battery_charge_power has device class power, state class None and unit W thus indicating it has a numeric value; however, it has the non-numeric value: (<class 'str'>); Please update your configuration if your entity is manually configured, otherwise create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+template%22
Interesting thing is, that the sensor does nevertheless send data:
Is this thus a warning to be ignored?
Sorry I wrote that in the issues, I don't know where else to put it best.
Best regards
Micky
Hallo
Thanks for your summary. I have also had my own take on it, based mostly on your one. Instead of creating a new one, I'll show you how I did it and what is different and maybe you want to use some of it.
Differences are:
E3DC Emergency Power State Text
template sensorpackages\e3dc
folder and in there two files modbus.yaml
and sensors.yaml
homeassistant:
packages: !include_dir_merge_named packages/
modbus.yaml
e3dc_modbus:
modbus:
- name: "e3dc"
type: tcp
host: !secret e3dc_ip
port: 502
retry_on_empty: true
sensors:
# Identification Block
- name: E3DC Modbus Firmware
unique_id: e3dc_modbus_firmware
address: 40001
data_type: uint16
scan_interval: 86400
- name: E3DC Manufacturer
unique_id: e3dc_manufacturer
address: 40003
data_type: string
count: 16
scan_interval: 86400
- name: E3DC Model
unique_id: e3dc_model
address: 40019
data_type: string
count: 16
scan_interval: 86400
- name: E3DC Serial Number
unique_id: e3dc_serial_number
address: 40035
data_type: string
count: 16
scan_interval: 86400
- name: E3DC Firmware Release
unique_id: e3dc_firmware_release
address: 40051
data_type: string
count: 16
scan_interval: 86400
# Power Data
- name: E3DC Solar Power
unique_id: e3dc_solar_power
unit_of_measurement: W
device_class: power
data_type: int32
address: 40067
scan_interval: 2
swap: word
- name: E3DC Battery Power
unique_id: e3dc_battery_power
unit_of_measurement: W
device_class: power
data_type: int32
address: 40069
scan_interval: 2
swap: word
- name: E3DC Power Consumption House
unique_id: e3dc_house_consumption_power
unit_of_measurement: W
device_class: power
data_type: int32
address: 40071
scan_interval: 2
swap: word
- name: E3DC Grid Power
unique_id: e3dc_grid_power
unit_of_measurement: W
device_class: power
data_type: int32
address: 40073
scan_interval: 2
swap: word
- name: E3DC Autarky and Consumption
unique_id: e3dc_autarky_and_consumption
data_type: int16
address: 40081
scan_interval: 60
- name: E3DC Battery State of Charge
unique_id: e3dc_battery_state_of_charge
unit_of_measurement: "%"
device_class: battery
data_type: int16
address: 40082
scan_interval: 30
- name: E3DC Emergency Power State
unique_id: e3dc_emergency_power_state
data_type: int16
address: 40083
scan_interval: 10
3. `sensors.yaml`
e3dc_sensors:
sensor:
# Templates
- platform: template
sensors:
e3dc_grid_export_power:
unique_id: e3dc_grid_export_power
friendly_name: "E3DC Grid Export Power"
unit_of_measurement: "W"
device_class: power
value_template: >
{% set power = states('sensor.e3dc_grid_power') | int(0) %}
{% if power > 0 %}
0
{% else -%}
{{ power | abs }}
{% endif %}
e3dc_grid_import_power:
unique_id: e3dc_grid_import_power
friendly_name: E3DC Grid Import Power
unit_of_measurement: W
device_class: power
value_template: >
{% set power = states('sensor.e3dc_grid_power') | int(0) %}
{% if power > 0 %}
{{ power }}
{% else -%}
0
{% endif %}
e3dc_battery_charge_power:
unique_id: e3dc_battery_charge_power
friendly_name: E3DC Battery Charging Power
unit_of_measurement: W
device_class: power
value_template: >
{% set power = states('sensor.e3dc_battery_power') | int(0) %}
{% if power | int >= 0 %}
{{ power }}
{% endif %}
e3dc_battery_discharge_power:
unique_id: e3dc_battery_discharge_power
friendly_name: E3DC Battery Discharging Power
unit_of_measurement: W
device_class: power
value_template: >
{% set power = states('sensor.e3dc_battery_power') | int(0) %}
{% if power <= 0 %}
{{ power | abs }}
{% endif %}
e3dc_autarky:
friendly_name: "E3DC Autarky"
unique_id: e3dc_autarky
unit_of_measurement: "%"
value_template: "{{ (states('sensor.e3dc_autarky_and_consumption')|int(0) / 256)|round(0,'floor') }}"
e3dc_own_consumption:
friendly_name: "E3DC Own Consumption Ratio"
unique_id: e3dc_own_consumption_ratio
unit_of_measurement: "%"
value_template: "{{ ((states('sensor.e3dc_autarky_and_consumption')|int(0) / 256 - states('sensor.e3dc_autarky')|int(0)) * 256)|round(0,'floor') }}"
e3dc_emergency_power_state_text:
friendly_name: E3DC Emergency Power State Text
unique_id: e3dc_emergency_power_state_text
value_template: >
{% set eps = states('sensor.e3dc_emergency_power_state') %}
{% if eps == '0' %}
nicht unterstützt
{% elif eps == '1' %}
aktiv
{% elif eps == '2' %}
inaktiv
{% elif eps == '3' %}
nicht verfügbar
{% elif eps == '4' %}
falsche Position
{% else %}
unbekannt
{% endif %}
# Integrations
- platform: integration
source: sensor.e3dc_grid_import_power
name: E3DC Grid Import Energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_grid_export_power
name: E3DC Grid Export Energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_solar_power
name: E3DC Solar Energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_battery_power
name: E3DC Builtin Battery Energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_battery_charge_power
name: E3DC Battery Charge Energy
unit_prefix: k
round: 2
- platform: integration
source: sensor.e3dc_battery_discharge_power
name: E3DC Battery Discharge Energy
unit_prefix: k
round: 2
I get this error when checking the configuration.yaml (sorry, I can't mark the text to copy it, therefore I uploaded a picture):
My approach:
homeassistant: packages: !include_dir_merge_named packages/
into configuration.yamlused "check configuration" in developer tools in Home Assistant
Thank you!
Hi,
I've followed the configuration, but "connection refused" appears, because the password is missing.
How do I configure the password set in the E3DC (S 10 X) within the modbus.yaml? Or do I have to remove the password on the E3DC (set to empty) - wouldn't be my preference?
Thanks,
Nils
Hi,
the configuration.yaml entries for the sensor-yaml files are:
sensors.yaml and binary_sensors.yaml
But the filenames in the package folder are currently:
sensor.yaml and binary_sensor.yaml
...i'd like to buy an "s" ;-)
I managed to setup the scripts in home assistant and configure the energy tab. Thank you for this amazing integration.
However, I can't find the IP of the modbus TCP anywhere.
I looked up all connected devices in my router, yet I can't seem to find any ethernet device (it's connected and online though).
Am I stupid?
Assuming yes, I'm thankful for any hints.
Cheers!
Thanks for the great work! Your configuration works great, but sometimes i get the following error in HA logs:
2023-12-28 08:19:05.687 WARNING (MainThread) [homeassistant.components.template.template_entity] Template loop detected while processing event: <Event state_changed[L]: entity_id=sensor.e3dc_battery_charge_power, old_state=<state sensor.e3dc_battery_charge_power=39.0; unit_of_measurement=W, device_class=power, friendly_name=E3DC Battery Charging Power @ 2023-12-28T08:19:05.598125+01:00>, new_state=<state sensor.e3dc_battery_charge_power=36.0; unit_of_measurement=W, device_class=power, friendly_name=E3DC Battery Charging Power @ 2023-12-28T08:19:05.608402+01:00>>, skipping template render for Template[{% set power = states('sensor.e3dc_battery_power') | float(0) %} {% if power >= 0 %}
{{ power }}
{% else %}
{% set charge_power = states('sensor.e3dc_battery_charge_power') | float(0) + power %}
{{ charge_power if charge_power > 0 else 0 }}
{% endif %}]
Any idea?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.