unl0ck / homeassistant-addon-viessmann-gridbox

Fetching Viessmann Data over Gridbox Send via MQTT
Apache License 2.0
7 stars 2 forks source link

DirectConsumptionRate & SelfConsumtpionRate Anzeige mit zuviel Nachkommastellen #36

Closed Lendelfinger closed 4 months ago

Lendelfinger commented 4 months ago

Describe the bug what do have

Guten Morgen, die beiden im Titel genannten Entitäten werden mit mehr als 10 Nachkommastellen angezeigt. Gewollt oder könnte man die auf 1-2 Stellen reduzieren? Unbenannt

Log details

-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
Log level is set to INFO
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service gridboxconnector: starting
s6-rc: info: service gridboxconnector successfully started
s6-rc: info: service legacy-services: starting
[08:35:45] INFO: Starting GridboxConnector...
s6-rc: info: service legacy-services successfully started
total 12K    
   4.0K drwxr-xr-x    2 root     root        4.0K Jul 10 08:35 .
   4.0K drwxr-xr-x    1 root     root        4.0K Jul 10 08:35 ..
   4.0K -rw-------    1 root     root         114 Jul 10 08:35 options.json
{
  "username": "XXX",
  "password": "XXX",
  "wait_time": 10,
  "log_level": "INFO"
}total 16K    
   4.0K drwxr-xr-x    1 root     root        4.0K Jul  9 14:16 .
   4.0K drwxr-xr-x    1 root     root        4.0K Jul 10 08:35 ..
   4.0K drwxr-xr-x    3 root     root        4.0K Jul  9 14:15 GridboxConnector
   4.0K -rw-r--r--    1 root     root         494 Jul  9 14:15 cloudSettings.json
/build
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/build/GridboxConnector/__main__.py", line 31, in <module>
    options_json = json.load(options_file)
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/json/__init__.py", line 293, in load
    return loads(fp.read(),
                 ^^^^^^^
AttributeError: 'str' object has no attribute 'read'
[08:35:49] INFO: Service gridboxconnector exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service gridboxconnector: stopping
s6-rc: info: service gridboxconnector successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-linux-init-shutdown: fatal: unable to talk to shutdownd: Operation not permitted
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service base-addon-banner: starting
-----------------------------------------------------------

 Add-on: Viessmann Gridbox Connector (edge)
 Viessmann Gridbox Connector (edge)
-----------------------------------------------------------
 Add-on version: 2.7.3
 You are running the latest version of this add-on.
 System: Home Assistant OS 12.4  (aarch64 / yellow)
 Home Assistant Core: 2024.7.1
 Home Assistant Supervisor: 2024.06.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
Log level is set to INFO
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service gridboxconnector: starting
s6-rc: info: service gridboxconnector successfully started
s6-rc: info: service legacy-services: starting
[08:36:31] INFO: Starting GridboxConnector...
s6-rc: info: service legacy-services successfully started
total 12K    
   4.0K drwxr-xr-x    2 root     root        4.0K Jul 10 08:36 .
   4.0K drwxr-xr-x    1 root     root        4.0K Jul 10 08:36 ..
   4.0K -rw-------    1 root     root         114 Jul 10 08:36 options.json
{
  "username": "XXX",
  "password": "XXX",
  "wait_time": 10,
  "log_level": "INFO"
}total 16K    
   4.0K drwxr-xr-x    1 root     root        4.0K Jul 10 06:56 .
   4.0K drwxr-xr-x    1 root     root        4.0K Jul 10 08:36 ..
   4.0K drwxr-xr-x    3 root     root        4.0K Jul 10 06:56 GridboxConnector
   4.0K -rw-r--r--    1 root     root         494 Jul 10 06:56 cloudSettings.json
/build
2024-07-10 08:36:35,824 __main__.py:61 INFO - {'batteries': [{'applianceID': 'a1731af4-0399-495b-92c2-523fd61ab681', 'capacity': 10000, 'nominalCapacity': 10000, 'power': -1626, 'remainingCharge': 4200, 'stateOfCharge': 0.42}], 'battery': {'capacity': 10000, 'nominalCapacity': 10000, 'power': -1626, 'remainingCharge': 4200, 'stateOfCharge': 0.42}, 'consumption': 628, 'directConsumption': 628, 'directConsumptionEV': 0, 'directConsumptionHeatPump': 0, 'directConsumptionHeater': 0, 'directConsumptionHousehold': 628, 'directConsumptionRate': 0.2747156605424322, 'grid': -32, 'gridMeterReadingNegative': 5508720000, 'gridMeterReadingPositive': 5338440000, 'heaters': [{'applianceID': '12bdd8ec-9b1e-465e-8f26-feae00e5af0f', 'power': 0, 'temperature': 51.5}], 'heating': 0, 'measuredAt': '2024-07-10T06:36:35Z', 'photovoltaic': 2286, 'production': 2286, 'selfConsumption': 2254, 'selfConsumptionRate': 0.9860017497812773, 'selfSufficiencyRate': 1, 'selfSupply': 628, 'totalConsumption': 628}

Version

No response

unl0ck commented 4 months ago

ne habs nur auch immer wieder vergessen das endlich mal gerade zu machen, danke für den hinweis.

unl0ck commented 4 months ago

2.7.4 auf edge

Lendelfinger commented 4 months ago

Jetzt bricht er nach dem Start wieder ab. ` "wait_time": 10, "log_level": "INFO" }total 16K
4.0K drwxr-xr-x 1 root root 4.0K Jul 10 10:27 . 4.0K drwxr-xr-x 1 root root 4.0K Jul 10 10:42 .. 4.0K drwxr-xr-x 3 root root 4.0K Jul 10 10:26 GridboxConnector 4.0K -rw-r--r-- 1 root root 494 Jul 10 10:26 cloudSettings.json /build Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/build/GridboxConnector/main.py", line 59, in viessmann_gridbox_connector.update_sensors(result) File "/build/GridboxConnector/ha_viessmann_gridbox_connector.py", line 124, in update_sensors self.direct_consumption_rate_sensor.set_state(round(float(measurement.get("directConsumptionRate", "0"))*100),2) TypeError: Sensor.set_state() takes 2 positional arguments but 3 were given [10:42:16] INFO: Service gridboxconnector exited with code 1 (by signal 0) s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service gridboxconnector: stopping s6-rc: info: service gridboxconnector successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service base-addon-log-level: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service base-addon-log-level successfully stopped s6-rc: info: service base-addon-banner: stopping s6-rc: info: service base-addon-banner successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service base-addon-banner: starting


Add-on: Viessmann Gridbox Connector (edge) Viessmann Gridbox Connector (edge)

Add-on version: 2.7.4 You are running the latest version of this add-on. System: Home Assistant OS 12.4 (aarch64 / yellow) Home Assistant Core: 2024.7.1 Home Assistant Supervisor: 2024.06.2

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started Log level is set to INFO s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service gridboxconnector: starting s6-rc: info: service gridboxconnector successfully started s6-rc: info: service legacy-services: starting [10:43:23] INFO: Starting GridboxConnector... s6-rc: info: service legacy-services successfully started total 12K
4.0K drwxr-xr-x 2 root root 4.0K Jul 10 10:43 . 4.0K drwxr-xr-x 1 root root 4.0K Jul 10 10:43 .. 4.0K -rw------- 1 root root 114 Jul 10 10:43 options.json {

"wait_time": 10, "log_level": "INFO" }total 16K
4.0K drwxr-xr-x 1 root root 4.0K Jul 10 10:27 . 4.0K drwxr-xr-x 1 root root 4.0K Jul 10 10:43 .. 4.0K drwxr-xr-x 3 root root 4.0K Jul 10 10:26 GridboxConnector 4.0K -rw-r--r-- 1 root root 494 Jul 10 10:26 cloudSettings.json /build Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/build/GridboxConnector/main.py", line 59, in viessmann_gridbox_connector.update_sensors(result) File "/build/GridboxConnector/ha_viessmann_gridbox_connector.py", line 124, in update_sensors self.direct_consumption_rate_sensor.set_state(round(float(measurement.get("directConsumptionRate", "0"))*100),2) TypeError: Sensor.set_state() takes 2 positional arguments but 3 were given [10:43:27] INFO: Service gridboxconnector exited with code 1 (by signal 0) s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service gridboxconnector: stopping s6-rc: info: service gridboxconnector successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service base-addon-log-level: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service base-addon-log-level successfully stopped s6-rc: info: service base-addon-banner: stopping s6-rc: info: service base-addon-banner successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped`

unl0ck commented 4 months ago

ach mist, ich glaub ich muss echt mal 2 tage investieren in unit tests. sorry,

Lendelfinger commented 4 months ago

Es läuft. Unbenannt

unl0ck commented 4 months ago

2.7.5 Commit 0191245