Closed svlsbrg closed 10 months ago
How do you call the service? I've changed the device selection at some point in the past, is this a automation script from an early version of the integration?
Hi Torben,
it doesn't matter if I call the service manually or by automation.
here the automation script, which I am using. It uses precalculated limits by templates:
alias: e3dc_service
description: ""
trigger:
- platform: time_pattern
minutes: /1
condition: []
action:
- if:
- condition: state
entity_id: input_boolean.e3dc_auto
state: "on"
then:
- service: e3dc_rscp.set_power_limits
data:
device_id: S10-.......
max_charge: "{{(states('sensor.ladeleistung_opt'))|int}}"
max_discharge: "{{(states('sensor.entladeleistung_opt'))|int}}"
else:
- service: e3dc_rscp.set_power_limits
data:
device_id: S10-.......
max_charge: 4000
max_discharge: 4500
mode: single
or direct:
service: e3dc_rscp.set_power_limits
data:
device_id: f50f248ad0df2249c0fef02aca790505
max_charge: 4000
max_discharge: 4000
BR
Rene
Can you please check what the dropdown of E3DC device ID shows if you open it?
Hi Torben,
The drop down shows the correct device:
Is it possible, that the device id cache selects a old e3dc device? I removed and re-added the device a few times in the past during updates.
BR Rene
Hi Rene, that looks like an old config entry to me. In the early prototype days, the device identified itself by the serial number. I changed this, as the integration is not capable of multi-point connections (you need one integration per E3DC for authorization purposes). At one point I decided not to support multiple E3DCs in one HA installation and simplified a bit of code. This lead to a new device ID, usually "E3DC" or something like that. My suspicion is, that your E3DC config was created by one of the original setups. Please do one thing. Drop your E3DC from HA and readd it. Just to be on the safe side (call it a hunch) I'd probably fully restart E3DC in between. That should give you an device ID like "S10E", depending on the model of the unit, which in turn should fix the problem. Cheers, Torben
Hi Torben,
the reboot after deleting the device was successful. Nevertheless the device id is a very long hash, which I could only identify by switching the service within the development tools to YAML-Mode after selecting the device: f50f248ad0df2249c0fef02aca790505
The automation is working as well, if I use the long hash as device id:
service: e3dc_rscp.set_power_limits
data:
device_id: f50f248ad0df2249c0fef02aca790505
max_charge: "{{(states('sensor.ladeleistung_opt'))|int}}"
max_discharge: "{{(states('sensor.entladeleistung_opt'))|int}}"
I assumed the device ID could be easier to discover e.g. "S10-722046003..."
Now it is working again. Thank you so much for your support.
BR
Rene
I also get this error earlier this day. But after reloading the integration and restarting HA the service can be executed without error with the same (hashed) device-id as before.
Forget any mail you got, I was mislead. Let me investigate further. Instead:
Hint so far, if you configure it on the frontend, the system should show you a nice dropdown without having you to wrestle around with hashes:
If you use this selector, you can switch to "YAML-Mode" afterwards and extract the ID in question. Another way to get the device ID is to open the device in the HA frontend, its ID is added into the URL like this:
http://localhost:8124/config/devices/device/64d3b74a1bcf319288844ff9e93e4010
^-----
This should work with 3.3, if you still experience problems, please reopen and add a current diagnostics dump (v3.3)
After installing 3.3 and restart HA i got again the error:
2023-09-19 19:35:10.983 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Error for call_service at pos 1: set_power_limits: Device 21eec5d873axxxc550698df151f4eb7a is no E3DC. 2023-09-19 19:35:10.985 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [546842906176] Error handling message: set_power_limits: Device 21eec5d873axxxc550698df151f4eb7a is no E3DC. (unknown_error) Administrator from 10.0.0.227 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.31)
Here is the dump:
{ "home_assistant": { "installation_type": "Home Assistant OS", "version": "2023.9.2", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.11.5", "docker": true, "arch": "aarch64", "timezone": "Europe/Berlin", "os_name": "Linux", "os_version": "6.1.21-v8", "supervisor": "2023.09.2", "host_os": "Home Assistant OS 10.5", "docker_version": "23.0.6", "chassis": "embedded", "run_as_root": true }, "custom_components": { "miele": { "version": "v2021.10.12", "requirements": [ "requests_oauthlib>=1.3.0" ] }, "ecoflow_cloud": { "version": "0.12.1", "requirements": [ "paho-mqtt==1.6.1", "reactivex==4.0.4", "protobuf>=4.23.0" ] }, "epex_spot": { "version": "1.4.0", "requirements": [ "bs4" ] }, "xiaomi_miio_fan": { "version": "2023.7.0.0", "requirements": [ "construct==2.10.56", "python-miio>=0.5.12" ] }, "ecoflow": { "version": "2.1", "requirements": [ "reactivex" ] }, "hacs": { "version": "1.32.1", "requirements": [ "aiogithubapi>=22.10.1" ] }, "tapo_control": { "version": "5.2.4", "requirements": [ "pytapo==3.2.14" ] }, "eufy_security": { "version": "7.0.4", "requirements": [ "websocket-client==1.4.2", "aiortsp==1.3.6" ] }, "apsystems_ecur": { "version": "v1.2.27", "requirements": [] }, "tibber_data": { "version": "0.7.1", "requirements": [ "pyTibber>=0.25.2" ] }, "e3dc_rscp": { "version": "v3.3.0", "requirements": [ "pye3dc==0.7.6" ] }, "entsoe": { "version": "0.0.1", "requirements": [ "entsoe-py==0.5.8" ] }, "tibber_custom": { "version": "0.5.1", "requirements": [ "matplotlib" ] }, "average": { "version": "2.3.0", "requirements": [] }, "meross_lan": { "version": "4.3.0", "requirements": [] }, "stiebel_eltron_isg": { "version": "2023.9.0", "requirements": [ "pymodbus>=3.5.1" ] }, "attributes": { "version": "1.2.1", "requirements": [] }, "dwd": { "version": "2023.8.2", "requirements": [] }, "daily": { "version": "0.4.0", "requirements": [] }, "skodaconnect": { "version": "v1.2.5", "requirements": [ "skodaconnect>=1.3.6", "homeassistant>=2023.3.0" ] }, "config_editor": { "version": "4.3", "requirements": [] }, "nodered": { "version": "2.2.0", "requirements": [] }, "dwd_weather": { "version": "1.2.28", "requirements": [ "simple_dwd_weatherforecast==1.1.5", "markdownify==0.6.5" ] }, "ble_monitor": { "version": "12.4.0", "requirements": [ "pycryptodomex>=3.14.1", "janus>=1.0.0", "aioblescan>=0.2.14", "btsocket>=0.2.0", "pyric>=0.1.6.3" ] } }, "integration_manifest": { "domain": "e3dc_rscp", "name": "E3DC Remote Storage Control Protocol (Git)", "codeowners": [ "@torbennehmer" ], "config_flow": true, "dependencies": [], "documentation": "https://github.com/torbennehmer/hacs-e3dc", "homekit": {}, "integration_type": "device", "iot_class": "cloud_polling", "issue_tracker": "https://github.com/torbennehmer/hacs-e3dc/issues", "requirements": [ "pye3dc==0.7.6" ], "ssdp": [], "version": "v3.3.0", "zeroconf": [], "is_built_in": false }, "data": { "current_data": { "system-derate-percent": 100, "system-derate-power": 4930.0, "system-additional-source-available": false, "system-battery-installed-capacity": 4600, "system-battery-installed-peak": 4930, "system-ac-maxpower": 4600, "system-battery-charge-max": 1500, "system-battery-discharge-max": 1500, "system-mac": "<redacted>", "model": "S10_Mini", "system-battery-discharge-minimum-default": 65, "e3dc_timezone": "Europe/Berlin", "additional-production": 0, "autarky": 99.67, "battery-charge": 0, "battery-discharge": 588, "battery-netchange": -588, "grid-consumption": 0, "grid-netchange": -1, "grid-production": 1, "house-consumption": 587, "selfconsumption": 99.54, "soc": 62, "solar-production": 0, "wallbox-consumption": 0, "pset-limit-charge": 1500, "pset-limit-discharge": 1500, "pset-limit-discharge-minimum": 65, "pset-limit-enabled": true, "pset-powersaving-enabled": true, "pset-weatherregulationenabled": false, "manual-charge-active": false, "manual-charge-energy": 0.5070376081597213, "db-day-autarky": 69.87977600097656, "db-day-battery-charge": 4166.0, "db-day-battery-discharge": 2155.5, "db-day-grid-consumption": 2806.0, "db-day-grid-production": 2045.0, "db-day-house-consumption": 9316.0, "db-day-selfconsumption": 76.0958480834961, "db-day-solar-production": 11528.0, "db-day-startts": 1695081600 }, "get_system_info": { "deratePercent": 100, "deratePower": 4930.0, "externalSourceAvailable": 0, "installedBatteryCapacity": 4600, "installedPeakPower": 4930, "maxAcPower": 4600, "macAddress": "<redacted>", "maxBatChargePower": 1500, "maxBatDischargePower": 1500, "model": "S10_Mini", "release": "S10_2023_024", "serial": "501<redacted>" }, "get_system_status": { "dcdcAlive": true, "powerMeterAlive": true, "batteryModuleAlive": true, "pvModuleAlive": true, "pvInverterInited": true, "serverConnectionAlive": true, "pvDerated": false, "emsAlive": true, "acModeBlocked": false, "sysConfChecked": false, "emergencyPowerStarted": false, "emergencyPowerOverride": false, "wallBoxAlive": false, "powerSaveEnabled": false, "chargeIdlePeriodActive": false, "dischargeIdlePeriodActive": false, "waitForWeatherBreakthrough": false, "rescueBatteryEnabled": false, "emergencyReserveReached": false, "socSyncRequested": false }, "poll": { "autarky": 99.54, "consumption": { "battery": -588, "house": 581, "wallbox": 0 }, "production": { "solar": 0, "add": 0, "grid": -7 }, "selfConsumption": 99.45, "stateOfCharge": 62, "time": "2023-09-19T17:41:59.000214+00:00" }, "switches": [], "get_pvis_data": [ { "acMaxApparentPower": 4600.0, "cosPhi": { "active": null, "value": null, "excited": null }, "deviceState": { "connected": true, "working": true, "inService": false }, "frequency": { "under": null, "over": null }, "index": 0, "lastError": "3 0x0", "maxPhaseCount": 3, "maxStringCount": 2, "onGrid": true, "phases": { "0": { "power": 519.0, "voltage": 236.5, "current": 2.16, "apparentPower": 513.0, "reactivePower": 0.0, "energyAll": 36418668.0, "energyGridConsumption": 86948.0 } }, "powerMode": 1, "serialNumber": "E3E<redacted>", "state": "0x103f271d", "strings": { "0": { "power": 0.0, "voltage": 116.0, "current": 0.03, "energyAll": 14318758.0 } }, "systemMode": 2, "temperature": { "max": 130.0, "min": -30.0, "values": [ 31.6, 40.2, 46.2, 38.4 ] }, "type": 4, "version": " MAIN HW0D 2.048", "voltageMonitoring": { "thresholdTop": null, "thresholdBottom": null, "slopeUp": null, "slopeDown": null } } ], "get_powermeters_data": [ { "activePhases": "111", "energy": { "L1": -12073209.62, "L2": 10974530.24, "L3": 4398115.54 }, "index": 6, "maxPhasePower": 24000.0, "mode": 4, "power": { "L1": -201.0, "L2": 188.0, "L3": 20.0 }, "type": 1, "voltage": { "L1": 235.0, "L2": 236.48, "L3": 237.57 } } ], "get_batteries_data": [ { "asoc": 85.0, "chargeCycles": 1864, "current": -12.43, "dcbCount": 2, "dcbs": { "0": { "current": -6.139999866485596, "currentAvg30s": -6.225914001464844, "cycleCount": 1861, "designCapacity": 47.279998779296875, "designVoltage": 52.0, "deviceName": "DCB102ZK", "endOfDischarge": 0.0, "error": 0, "fullChargeCapacity": 41.2239990234375, "fwVersion": 2, "manufactureDate": 7928, "manufactureName": "Panasonic", "maxChargeCurrent": 0.0, "maxChargeTemperature": 40.0, "maxChargeVoltage": 0.0, "maxDischargeCurrent": 0.0, "minChargeTemperature": 5.0, "parallelCellCount": 24, "sensorCount": 6, "seriesCellCount": 13, "pcbVersion": 1, "protocolVersion": 5, "remainingCapacity": 27.389999389648438, "serialCode": "not<redacted>", "serialNo": 6, "soc": 66.0, "soh": 87.0, "status": 0, "temperatures": [ 28.8, 29.7, 28.9, 29.7, 28.3, 29.0 ], "voltage": 47.56999969482422, "voltageAvg30s": 47.58140563964844, "voltages": [ 3.66, 3.65, 3.66, 3.65, 3.65, 3.65, 3.66, 3.65, 3.65, 3.65, 3.66, 3.64, 3.65 ], "warning": 0 }, "1": { "current": -6.289999961853027, "currentAvg30s": -6.255158424377441, "cycleCount": 1864, "designCapacity": 47.279998779296875, "designVoltage": 52.0, "deviceName": "DCB102ZK", "endOfDischarge": 0.0, "error": 0, "fullChargeCapacity": 39.470001220703125, "fwVersion": 2, "manufactureDate": 7928, "manufactureName": "Panasonic", "maxChargeCurrent": 0.0, "maxChargeTemperature": 40.0, "maxChargeVoltage": 0.0, "maxDischargeCurrent": 0.0, "minChargeTemperature": 5.0, "parallelCellCount": 24, "sensorCount": 6, "seriesCellCount": 13, "pcbVersion": 1, "protocolVersion": 5, "remainingCapacity": 25.597999572753906, "serialCode": "not<redacted>", "serialNo": 4, "soc": 64.5, "soh": 83.0, "status": 0, "temperatures": [ 29.1, 30.4, 29.5, 29.9, 28.8, 29.5 ], "voltage": 47.65999984741211, "voltageAvg30s": 47.65740203857422, "voltages": [ 3.65, 3.65, 3.65, 3.65, 3.65, 3.65, 3.65, 3.65, 3.65, 3.65, 3.65, 3.65, 3.65 ], "warning": 0 } }, "designCapacity": 94.56, "deviceConnected": true, "deviceInService": false, "deviceName": "LJ-EBPM01 MP", "deviceWorking": true, "eodVoltage": 39.0, "errorCode": 0, "fcc": 80.69000244140625, "index": 0, "maxBatVoltage": 52.0, "maxChargeCurrent": 40.0, "maxDischargeCurrent": 30.0, "maxDcbCellTemp": 30.4, "measuredResistance": -12.4621, "measuredResistanceRun": 47.4033, "minDcbCellTemp": 28.3, "moduleVoltage": 47.45, "rc": 52.99, "readyForShutdown": 1, "rsoc": 62.58, "rsocReal": 65.5, "statusCode": 192, "terminalVoltage": 0.0, "totalUseTime": 0, "totalDischargeTime": 0, "trainingMode": 0, "usuableCapacity": 74.4, "usuableRemainingCapacity": 46.7 } ], "get_idle_periods": { "idleCharge": [ { "day": 0, "start": [ 7, 0 ], "end": [ 11, 30 ], "active": false }, { "day": 1, "start": [ 7, 0 ], "end": [ 11, 30 ], "active": false }, { "day": 2, "start": [ 7, 0 ], "end": [ 11, 30 ], "active": false }, { "day": 3, "start": [ 7, 0 ], "end": [ 11, 30 ], "active": false }, { "day": 4, "start": [ 7, 0 ], "end": [ 11, 30 ], "active": false }, { "day": 5, "start": [ 7, 0 ], "end": [ 11, 30 ], "active": false }, { "day": 6, "start": [ 11, 15 ], "end": [ 12, 30 ], "active": false } ], "idleDischarge": [ { "day": 0, "start": [ 1, 30 ], "end": [ 23, 59 ], "active": false }, { "day": 1, "start": [ 1, 30 ], "end": [ 23, 59 ], "active": false }, { "day": 2, "start": [ 1, 30 ], "end": [ 23, 59 ], "active": false }, { "day": 3, "start": [ 0, 0 ], "end": [ 23, 59 ], "active": false }, { "day": 4, "start": [ 1, 30 ], "end": [ 23, 59 ], "active": false }, { "day": 5, "start": [ 1, 30 ], "end": [ 23, 59 ], "active": false }, { "day": 6, "start": [ 1, 30 ], "end": [ 23, 59 ], "active": false } ] }, "get_power_settings": { "dischargeStartPower": 65, "maxChargePower": 1500, "maxDischargePower": 1500, "powerLimitsUsed": true, "powerSaveEnabled": true, "weatherForecastMode": 0, "weatherRegulatedChargeEnabled": false }, "EMS_REQ_GET_MANUAL_CHARGE": [ [ "EMS_MANUAL_CHARGE_ACTIVE", "Bool", false ], [ "EMS_MANUAL_CHARGE_START_COUNTER", "Int64", 1695060767985 ], [ "EMS_MANUAL_CHARGE_ENERGY_COUNTER", "Double64", 0.1389144131944442 ], [ "EMS_MANUAL_CHARGE_LASTSTART", "Timestamp", 1695060767.0 ] ], "DB_REQ_HISTORY_DATA_DAY": [ "DB_HISTORY_DATA_DAY", "Container", [ [ "DB_SUM_CONTAINER", "Container", [ [ "DB_GRAPH_INDEX", "Float32", -1.0 ], [ "DB_BAT_POWER_IN", "Float32", 4166.0 ], [ "DB_BAT_POWER_OUT", "Float32", 2155.5 ], [ "DB_DC_POWER", "Float32", 11528.0 ], [ "DB_GRID_POWER_IN", "Float32", 2045.0 ], [ "DB_GRID_POWER_OUT", "Float32", 2806.0 ], [ "DB_CONSUMPTION", "Float32", 9316.0 ], [ "DB_PM_0_POWER", "Float32", 0.0 ], [ "DB_PM_1_POWER", "Float32", 0.0 ], [ "DB_BAT_CHARGE_LEVEL", "Float32", 68.65799713134766 ], [ "DB_BAT_CYCLE_COUNT", "Int32", 0 ], [ "DB_CONSUMED_PRODUCTION", "Float32", 76.0958480834961 ], [ "DB_AUTARKY", "Float32", 69.87977600097656 ] ] ], [ "DB_VALUE_CONTAINER", "Container", [ [ "DB_GRAPH_INDEX", "Float32", 0.8124998807907104 ], [ "DB_BAT_POWER_IN", "Float32", 213.64102172851562 ], [ "DB_BAT_POWER_OUT", "Float32", 110.53845977783203 ], [ "DB_DC_POWER", "Float32", 591.1795043945312 ], [ "DB_GRID_POWER_IN", "Float32", 104.87179565429688 ], [ "DB_GRID_POWER_OUT", "Float32", 143.89743041992188 ], [ "DB_CONSUMPTION", "Float32", 477.74359130859375 ], [ "DB_PM_0_POWER", "Float32", 0.0 ], [ "DB_PM_1_POWER", "Float32", 0.0 ], [ "DB_BAT_CHARGE_LEVEL", "Float32", 68.65799713134766 ], [ "DB_BAT_CYCLE_COUNT", "Int32", 0 ], [ "DB_CONSUMED_PRODUCTION", "Float32", 76.0958480834961 ], [ "DB_AUTARKY", "Float32", 69.87977600097656 ] ] ] ] ] } }
@emmvaueff Hm, that is strange. I'm really at a loss here what's going on.
To be sure: Did you restart HA after removing and before readding the integration so that HA's internal configuration state starts with a clean plate? If no, please try it that way.
If yes, please check the .storage folder for the E3DC config data. I'd be interested both in the device and the integration records, especially the various object id's etc. Redact all IPs, passwords etc. from the config and send it to me via Private Mail to torben
Hello @torbennehmer, i'm sorry for the late response. Your tipp "removing integration + HA-Restart + adding integration" seamed to help for a while. Today at 3:00 inside an automation it worked last and at 14:00 without any changes in HA it now errors allways.
Could you upload the debug log around that time, preferably with enough lead time to https://owncloud.nehmer.net/index.php/s/C2tpE6faXxsXXk2 ? Does restarting HA help? If it fails now, is it the same error as above? Final question: If not, please enable debug logging as well.
One other recommendation: When looking at the diagnostics dump, I can see that you're running with active power limits while setting them to the maximum allowed value. Out of my guts I'd recommend actually disabling them if you don't need them using the appropriate service, so that the "Power Limits" flag is actually false.
Hello @torbennehmer, i'm sorry for the late response.
Your tipp "removing integration + HA-Restart + adding integration" seamed to help for a while.
Today at 3:00 inside an automation it worked last and at 14:00 without any changes in HA it now errors allways.
Hello,
Same here. Could it be possible that the cache could be the problem?
The Device ID is correct.
BR Rene
Could you upload the debug log around that time, preferably with enough lead time to https://owncloud.nehmer.net/index.php/s/C2tpE6faXxsXXk2 ?
Does restarting HA help?
If it fails now, is it the same error as above?
Final question: If not, please enable debug logging as well.
Hi Torben,
Today I updated everything and restarted. But unfortunately without success.
Please let me know if I can support you by debugging.
BR Rene
I'll try to think about some way to validate the cache and to add the important stuff to the diagnostics system to get more info. I'm still at a loss, what happens here. In the meantime, could you please check off the other things:
Could you upload the debug log around that time, preferably with enough lead time to https://owncloud.nehmer.net/index.php/s/C2tpE6faXxsXXk2 ?
If not [enabled], please enable debug logging as well.
I'd be especially interested, as written, to the logging data around the time things broke.
If you feel saavy enough, you could try to patch _resolve_device_id
in services.py to circumvent all local caching, resolving device on every call to rule out caching.
I have found the issue, it is related to other integrations adding additional IDs to the device (in my case a fritz.box). I'm rewriting the device detection to take this into account. Sorry for that, I did not know HA good enough to be aware that this could happen.
fixed with 3.4.3
System Health details
System Information
Home Assistant Community Store
GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.32.1 Stage | running Available Repositories | 1280 Downloaded Repositories | 9Home Assistant Cloud
logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okHome Assistant Supervisor
host_os | Home Assistant OS 10.5 -- | -- update_channel | stable supervisor_version | supervisor-2023.08.3 agent_version | 1.5.1 docker_version | 23.0.6 disk_total | 116.5 GB disk_used | 16.0 GB healthy | true supported | true board | rpi4-64 supervisor_api | ok version_api | ok installed_addons | Mosquitto broker (6.3.1), Terminal & SSH (9.7.1), HassOS SSH port 22222 Configurator (0.9.1a), RaspberryMatic CCU (3.71.12.20230826), Samba share (10.0.2), Studio Code Server (5.10.1), File editor (5.6.0), Advanced SSH & Web Terminal (15.0.7), Let's Encrypt (4.12.9), NGINX Home Assistant SSL proxy (3.5.0), Samba Backup (5.2.0)Dashboards
dashboards | 3 -- | -- resources | 1 views | 12 mode | storageMiele
component_version | 0.1.15 -- | -- reach_miele_cloud | okRecorder
oldest_recorder_run | 7. September 2023 um 10:51 -- | -- current_recorder_run | 7. September 2023 um 12:59 estimated_db_size | 1547.18 MiB database_engine | sqlite database_version | 3.41.2Checklist
Describe the issue
I updated the integration after a few month and removed and re-added the device afterwards. Nevertheless the service for setting power limits is not working.
Reproduction steps
Execute the service to set limits
Debug logs
Diagnostics dump
No response