Git Product home page Git Product logo

technische-alternative-cmi's People

Contributors

deermaximum avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

technische-alternative-cmi's Issues

change start of integration

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Due to long cycle times from CMI requests the startup of this integration surpress a sucessfull start of HA.
This causes my automations to not work until TA integration is fully started.
A full start takes about 10-15min actually.

Describe the solution you'd like
A clear and concise description of what you want to happen.

do not delay a full start of HA, may the first poll of sensors from CMI can be in "background"?

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

not sure how alternatives can look like

Additional context
Add any other context or screenshots about the feature request here.

HA also reports:

Setup timed out for stage 2 - moving forward
4. April 2023 um 21:23:56 – (WARNUNG) bootstrap.py

i guess the start of HA is meant with this Warning?

PS: i would like to donate you for your work, let me know how to.

Detect change of a fix value

I am trying to do an automation based on the change of a fix value (Fixwert in my German installation) in my UVR16x2.
Our heating engineer has implemented switching our heating on or off via the change of a fix value (see photo).

IMG_2968

When I change the fix value, I see that "Node: 1—Output 2" changes its value. This is a good hint that this is the correct setting, but can I be more certain?

Cheers,

Chris

Integration is using deprecated `DEVICE_CLASS_*` constants

Version of the custom_component

Any.

Describe the bug

This custom integration uses deprecated DEVICE_CLASS_* constants in its codebase.

The DEVICE_CLASS_* constants have been deprecated and replaced in Home Assistant Core 2021.12 (over a year ago). I would highly suggest updating/migrating this integration to the new enums.

For example, for the device classes supported by the sensor platform, there is now a SensorDeviceClass enum. So if a sensor previously used the DEVICE_CLASS_ENERGY constant, it should now use SensorDeviceClass.ENERGY. Other platforms (like binary_sensor, and number) provide similar enumerations for their supported device classes.

The migration thus only consists of replacing constants with an enumeration member and is, therefore, very low impact and should be fairly straightforward.

If I can help resolve any questions regarding this change or migration, feel free to ask or respond to this issue. I'm happy to help!

Kindest regards,

../Frenck

Debug log


n/a

Add more documentation for the installation process

First of all, thanks so much for providing this integration. Great work!

I had to remove and reinstall the integration three times because I was too clueless to understand the installation options:
First time, I ticked all boxes but then got lost in the presentation of channel numbers and labelled them wrongly.
Second time I only ticked the first box but then one device but no sensors where created.
I guess, ticking options 1 and 3 is the best to start with. Even if too many sensors are created and named generically, they can be re-labled later in HA, right?
An explanation could be added to the README.MD

Support values from CAN/MT connected to UVR1611

Is your feature request related to a problem? Please describe.
I can see my CAN/MT including the values in the CMI frontend as node 50. But I do net get info in HA of node50. Only node1.

Describe the solution you'd like
Also offer the values for can node 50 in HA

Describe alternatives you've considered
I was able to get the values thru a http-request with my older bl-net. Can these values thru CMI also be http-pulled instead of using json maybe?

Additional context
Screenshots about the feature request:
Bildschirmfoto 2023-04-25 um 19 41 57
Bildschirmfoto 2023-04-25 um 19 41 52

Add CAN-logging for x2 devices

Would be useful, to read also La, Ld parameters in the JSON-API.

So, not only inputs and outputs were readable, but every data configured in CAN-logging could be retrieved.
Example could be the actual power from sun collector, a computed temperature, like "VL Soll" and so on.
Only CAN logging in TAPPS needs to be configured.

Actually, using Node-RED could be used as workaround, to transfer the data to Home Assistant.

Here an example call:
http://192.168.0.13/INCLUDE/api.cgi?jsonnode=3&jsonparam=La,Ld
Here the output:
{ "Header":{ "Version":6, "Device":"91", "Timestamp":1667124402 }, "Data":{ "Logging Analog":[ { "Number":1, "AD":"A", "Value":{ "Value":49.0, "Unit":"1" } }, { "Number":2, "AD":"A", "Value":{ "Value":34.3, "Unit":"1" } }, { "Number":3, "AD":"A", "Value":{ "Value":35.3, "Unit":"1" } }, { "Number":4, "AD":"A", "Value":{ "Value":34.4, "Unit":"1" } }, { "Number":5, "AD":"A", "Value":{ "Value":21.1, "Unit":"1" } }, { "Number":6, "AD":"A", "Value":{ "Value":0, "Unit":"0" } }], "Logging Digital":[ { "Number":1, "AD":"D", "Value":{ "Value":0, "Unit":"43" } }, { "Number":2, "AD":"D", "Value":{ "Value":0, "Unit":"43" } }, { "Number":3, "AD":"D", "Value":{ "Value":0, "Unit":"43" } }, { "Number":4, "AD":"D", "Value":{ "Value":1, "Unit":"43" } }, { "Number":5, "AD":"D", "Value":{ "Value":1, "Unit":"43" } }, { "Number":6, "AD":"D", "Value":{ "Value":0, "Unit":"43" } }, { "Number":7, "AD":"D", "Value":{ "Value":0, "Unit":"43" } }, { "Number":8, "AD":"D", "Value":{ "Value":0, "Unit":"43" } }, { "Number":9, "AD":"D", "Value":{ "Value":0, "Unit":"43" } }, { "Number":10, "AD":"D", "Value":{ "Value":0, "Unit":"43" } }]}, "Status":"OK", "Status code":0 }

No dl bus support for UVR610 in beta 1.3.0.1?

Hi,

Great integration, thanks a lot - but I cannot make it to work w/i my HA. I just installed the latest beta-1.3.0.1 to log a newly installed CMI with UVR610 connected. (CAN Node 1). (Only) one DL client is connected to the UVR with three dl-inputs defined .The data can be accessed via an http request (.../INCLUDE/api.cgi?jsonnode="+can_node+"&jsonparam=D).
W/i the HA integration the CAN node shows up as 1 device:
Node 1: Type: UVR610, Inputs: 0, Outputs: 0, MBus: 0
I cannot access or see any sensors from the DL bus. Remember: other sensors are not connected.
log file (info level) gives 'setting up sensor.ta_cmi and binary_sensor.ta_cmi, not more.

When setting up the integration I played around with auto-detecting devices and with setting-up specific devices, which ended up in the attached core.config_entries.

BTW, it neither worked with the previous official release.

Maybe I am missing something fundamental?

Thanks for your help.

Mart

{
    "entry_id": "5429515fdde15blabla",
    "version": 1,
    "domain": "ta_cmi",
    "title": "C.M.I",
    "data": {
      "host": "http://cmi.internal",
      "username": "admin",
      "password": "xxx",
      "devices": [
        {
          "id": "1",
          "fetchmode": "defined",
          "type": "UVR610",
          "channels": []
        }
      ]
    },
    "options": {},
    "pref_disable_new_entities": false,
    "pref_disable_polling": false,
    "source": "user",
    "unique_id": null,
    "disabled_by": "user"
  },
  {
    "entry_id": "932026874100b2238blabla",
    "version": 1,
    "domain": "ta_cmi",
    "title": "C.M.I",
    "data": {
      "host": "http://cmi.internal",
      "username": "admin",
      "password": "xxx",
      "devices": [
        {
          "id": "1",
          "fetchmode": "all",
          "type": "UVR610",
          "channels": [
            {
              "type": "dl-bus",
              "id": 1,
              "name": "cmitest1",
              "device_class": ""
            },
            {
              "type": "dl-bus",
              "id": 2,
              "name": "cmitest2",
              "device_class": ""
            },
            {
              "type": "dl-bus",
              "id": 3,
              "name": "cmitest3",
              "device_class": ""
            },
            {
              "type": "dl-bus",
              "id": 4,
              "name": "cmitest4",
              "device_class": ""
            },
            {
              "type": "analog logging",
              "id": 1,
              "name": "cmilog1",
              "device_class": ""
            }
          ]
        }
      ]
    },
    "options": {},
    "pref_disable_new_entities": false,
    "pref_disable_polling": false,
    "source": "user",
    "unique_id": null,
    "disabled_by": null
  }
]

Just a question

Sorry to misuse the issue here, but i‘m not sure how to ask a question. Is this only to read values from the c.m.i. Or can I also change the values? I have no c.m.i. Yet, but will get one if the change of values (like the warm water temperature) is possible via home assistant.

Thanks for the help.
Christian

Data is stopping after a few minutes

Hi and thank you for this wonderful Project!!!

I was looking for something like that for a long time and started working with NodeRed on it, but prefer it this way :-) .

My problem is that after i installed my CMI and getting data from all notes, it stops after 10 minutes or so and i only get new data after a restart:
image

Any idea?

Thank you and best regards
Alex

Manipulable outputs

Currently all nodes are integrated as binary sensors. Which at least works very well with my UVR16x2. What is annoying, however, is that the displayed values of the outputs cannot be manipulated.

It would be nice if you could not only monitor, but also switch an output on or off if necessary.

Unfortunately, at the moment this is only possible with the CMI app and cannot be automated with HA due to other factors.

I have several devices that use up residual power. However, these can only be prioritized to a very limited extent. This particularly applies to the outputs of the UVR16x2. In summer this is not so relevant, but in winter I would rather have hot water than stored electricity.

Adjustable sensor readout period

It would be great to be able to set the sensor polling time on user level (starting from 1 min, considering CMI restrictions)
The current default value of 10 min is somewhat large for certain applications.

While connecting i get only "Invalid authentication"

Hello,

Thanks for addressing the CMI2HA subject. I am searching for some time till i found your project. Unfortunately i struggle to use it at the very first steps. While connecting i only get "Invalid authentication". I use the IP of CMI like "http://192.168.x.x", according to TA you have to use the Expert account to query the API, i tried guest, user and admin/Expert, nothing worked. The HA logfiles do not show any hint related to the CMI module. Do you have any clue what could be wrong here?

Thanks & BR,
R.

How can analog/digital network inputs be used with UVR1611?

Great job, thanks!

I would like to generate an analog/digital value in home assistant and offer it to the UVR1611 (to use it as an input variable to control heating circuit 2)
Could you point me to a how-to, some documentation or give me a hint, so I can set up the nodes? Thank you!

Can't connect to the CMI system

First off thank you for your great work!

In my browser I can access the CMI using the URL http://192.168.178.169:8088/#home.cgi
If I only enter http://192.168.178.169:8088 then I am automatically forwarded to the address above.
The CMI then asks me to enter the user and password and I can log in.

However, I can't find a way to get this integration connected to my CMI.
I have installed the integration (most recent version 1.41 and also tried the latest beta version) using HACS as described here. After restarting HA I went to Settings->Integrations->Add integration->Technische Alternative C.M.I. Then the configuration dialog popped up as expected. From here I am unable to find a configuration that works. For the following tests I have always used the correct (admin) user and password. I also tried everything with the credentials of a normal (non-admin) user.

If I use the URL http://192.168.178.169:8088 then I get an error message immediately saying "Error while communicating with a device. See logs for details".
The log entry says:
Logger: custom_components.ta_cmi
Source: custom_components/ta_cmi/config_flow.py:127
Integration: ta_cmi (documentation, issues)
First occurred: 10:08:01 (2 occurrences)
Last logged: 10:38:03
Error while communicating with a device (1): Invalid response from CMI: 404

Using the complete URL http://192.168.178.169:8088/#home.cgi causes the dialog to show the wait symbol for a minute or so and then show the message "unknown error occurred". The log says:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
result = await method(view, request, data, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure
result = await self._async_handle_step(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/config/custom_components/ta_cmi/config_flow.py", line 127, in async_step_user
return await self.async_step_devices()
File "/config/custom_components/ta_cmi/config_flow.py", line 188, in async_step_devices
await fetch_device(dev)
File "/config/custom_components/ta_cmi/config_flow.py", line 69, in fetch_device
await device.fetch_type()
File "/usr/local/lib/python3.10/site-packages/ta_cmi/device.py", line 96, in fetch_type
self._extract_device_info(await self._make_request_to_device())
File "/usr/local/lib/python3.10/site-packages/ta_cmi/device.py", line 88, in _make_request_to_device
return await self._make_request(url)
File "/usr/local/lib/python3.10/site-packages/ta_cmi/baseApi.py", line 24, in _make_request
data = json.loads(raw_response)
File "/usr/local/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I also tried the URL without the port (http://192.168.178.169).
After a minute wait time or so I get the following error message in the dialog:
[%key:common::config_flow::error::cannot_connect%]
There is no new log entry in this case.

Any ideas how to make this work?

Unkown error occured

Hi there,

thanks for this integration, but I can't get it working. Maybe this is similar to issue #49 but I don't want to hijack the thread.

Version of the custom_component

1.8.2

Describe the bug

I start the setup dialog, enter all needed information, after 2 minutes the setup stops with the error "Unknown error occured"
I have a UVR16x2.

Debug log

2023-07-26 20:47:09.287 DEBUG (MainThread) [ta_cmi] Receive list of nodes from C.M.I
2023-07-26 20:47:09.298 DEBUG (MainThread) [ta_cmi] Received list of nodes from C.M.I: 2;
2023-07-26 20:47:09.299 DEBUG (MainThread) [custom_components.ta_cmi] Try to fetch device type: 2
2023-07-26 20:47:09.299 DEBUG (MainThread) [ta_cmi] Make request to device 2 with parameters: I,O
2023-07-26 20:47:09.932 DEBUG (MainThread) [custom_components.ta_cmi] Sleep mode for 75 seconds to prevent rate limiting
2023-07-26 20:48:24.933 DEBUG (MainThread) [custom_components.ta_cmi] Try to fetch available device channels: 2
2023-07-26 20:48:24.934 DEBUG (MainThread) [ta_cmi] Update device: 2
2023-07-26 20:48:24.934 DEBUG (MainThread) [ta_cmi] Make request to device 2 with parameters: I,O,D,Sg,Sd,St,Ss

Setup not working

Hi there DeerMaximum,

first of all thanks for putting effort into this project. I was looking for long time for CMI to HA integration.
I have 9 CAN devices running on Node40 is the EZ3. With Version 1.4.1 of your integration i get following error during setup:

Error while communicating with a device (40): Failure during the CAN-request/parameter not available for this device

Setup never finish, i kept it running for 20min as you wrote per device it will take +1min.

Any idea? Do you need debug logs?

Thank you for your help.
br mole

CoE

Hi,
Have you thought about integrating CoE as a secondary channel?
The advantages are realtime values and sending states to the CAN Network.
Disadvantage is that the values are not autodiscoverable ...

COP-Value

Hey, nice Project, it works fine.

I run a heat pump. I measure the electrical and thermal energy via M-Bus with the UVR610. This means I can calculate the COP and the annual performance factor directly in the UVR. I would like to transfer these two values to Home Assistant. Sure, I could calculate both in Home Assistant, but that would still be nice.
In order to have the values directly with Winsol, I activated/integrated them in the CAN bus logging. Is there a way to transfer these values to Home Assistant?

Many greetings, Julian

Error during setup

Description of the Bug

Hello, I am using V1.42.2 - B1.08 - H4.00 and I keep having the problem that the connection to the CMI cannot be established. From time to time it works but most of the time it does not. I have attached what I found in the log. I hope you can help me here.

Debug log


2024-01-31 16:49:10.269 WARNING (MainThread) [homeassistant.bootstrap] Waiting on integrations to complete setup: ta_cmi
2024-01-31 16:49:16.026 DEBUG (MainThread) [custom_components.ta_cmi] Finished fetching ta_cmi data in 296.387 seconds (success: True)
2024-01-31 16:49:16.026 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry C.M.I for ta_cmi
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ta_cmi/__init__.py", line 58, in async_setup_entry
await coordinator.async_config_entry_first_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in async_config_entry_first_refresh
await self._async_refresh(
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ta_cmi/__init__.py", line 136, in _async_update_data
await asyncio.sleep(DEVICE_DELAY)
File "/usr/local/lib/python3.11/asyncio/tasks.py", line 649, in sleep
return await future
^^^^^^^^^^^^


Chance to get analog logs from SD card?

Hi,
thanks first of all for the integration. It works great so far. Question I have is, if it is possible to read the logs written so far on SD-Card in CMI?
Thank you and BR, Christian

Adding data from DL-Bus

Hi, I really like this project!

I am using a RSM610 and can use the CAN data form it perfectly! But I have a question, there is a sensor connected to the DL-Bus of the RSM610 and this data is not available in Home Assistant? Did I configure something wrong or is this a feature what is not available (yet)?

Thanks in advance!
Twanny

wie macht man eine Graphen bzw. Doku auf Deutsch

Hallo bin neu hier, und reiner Anwender, und shreibe zum ersten Mal,
Super Integration - tolle Arbeit,
Wird die Schnittstelle direkt vom Hersteller Technische Alternative gefördert?
Gibt es evt eine Doku auf deutsch?
Gibt es auch einen Graph- Diagramm bzw eine Statistik
Hab die Integration in Betrieb funktioniert sehr gut,
Einzige Frage: muss man wenn man einen kanal ergänzt oder ändert jedes Mal von vorne beginnen oder kann man Sensoren hinzufügen bzw ntfernen?

Error while communicating with a device (1): Invalid response from ... 404

Hi!

I have CMI (V1.22 .1 - B1.05 - H2.00) + UVR1611. Homeassistant and the plugin are on the latest state writing this issue. During the setup of the Plugin I get following error:
image

When I click "absenden" nothing happens (also not after one minute) In the log I see following messages.

2023-12-31 17:19:28.298 DEBUG (MainThread) [ta_cmi] Receive list of nodes from C.M.I
2023-12-31 17:19:28.311 DEBUG (MainThread) [ta_cmi] Received list of nodes from C.M.I: 1;
2023-12-31 17:19:28.312 DEBUG (MainThread) [custom_components.ta_cmi] Try to fetch device type: 1
2023-12-31 17:19:28.312 DEBUG (MainThread) [ta_cmi] Make request to device 1 with parameters: I,O
2023-12-31 17:19:28.329 WARNING (MainThread) [custom_components.ta_cmi] Error while communicating with a device (1): Invalid response from 192.168.178.34: 404
2023-12-31 17:19:44.939 DEBUG (MainThread) [ta_cmi] Receive list of nodes from C.M.I
2023-12-31 17:19:44.952 DEBUG (MainThread) [ta_cmi] Received list of nodes from C.M.I: 1;
2023-12-31 17:19:44.953 DEBUG (MainThread) [custom_components.ta_cmi] Try to fetch device type: 1
2023-12-31 17:19:44.953 DEBUG (MainThread) [ta_cmi] Make request to device 1 with parameters: I,O
2023-12-31 17:19:44.966 WARNING (MainThread) [custom_components.ta_cmi] Error while communicating with a device (1): Invalid response from 192.168.178.34: 404
Issues not containing the minimum requirements will be closed:

Best regards,
KaHei

Failure during the CAN-request/parameter not available

Hello, thanks for this great project.

I have an issue adding more than one Device.
I can add node 1 and data is coming in, but I would also need data from Node 32.

Screenshot_20221107-193552_Home Assistant

Log Message:
Screenshot_20221107-193605_Home Assistant

My Can Bus configuration:
Screenshot_20221107-193625_Chrome

Best Regards,
Christoph

Unit for update interval / numeric input field

Because CMI is a bit "sensitive" in regards of the update interval, the new configuration parameter is very useful. Is it possible to add a unit (minutes / seconds / ...) to the UI? I have no idea what value is actually used (10?) - seem to be longer than a minute, but less than 10 minutes - but only guessing.
thanks for your great work

UVR16x2 - added DL devices - Sensordata of DL not in HA

The UVR16x2 was added and all of its sensordata was available in HA.

Weeks later I added 2 DL devices.
Reloading the integration or deactivating and activating the uvr16x2 did not help. No data from the DL devices was available.

The expectation is that the sensordata from the DL devices is retrieved and visible in HA too.

testet with 1.7.0

The DL Sensordata can be retrieved using the url

http://10.1.0.46/INCLUDE/api.cgi?jsonnode=1&jsonparam=D

{ "Header":{ "Version":6, "Device":"87", "Timestamp":1684786742 }, "Data":{ "DL-Bus":[ { "Number":1, "AD":"A", "Value":{ "Value":21.5, "Unit":"1" } }, { "Number":2, "AD":"A", "Value":{ "Value":21.9, "Unit":"1" } }, { "Number":3, "AD":"A", "Value":{ "Value":21.9, "Unit":"1" } }, { "Number":4, "AD":"A", "Value":{ "Value":21.9, "Unit":"1" } }, { "Number":5, "AD":"A", "Value":{ "Value":22.2, "Unit":"1" } }, { "Number":6, "AD":"A", "Value":{ "Value":22.3, "Unit":"1" } }, { "Number":7, "AD":"A", "Value":{ "Value":22.3, "Unit":"1" } }, { "Number":8, "AD":"A", "Value":{ "Value":21.3, "Unit":"1" } }, { "Number":9, "AD":"A", "Value":{ "Value":30.9, "Unit":"1" } }, { "Number":10, "AD":"A", "Value":{ "Value":22.2, "Unit":"1" } }]}, "Status":"OK", "Status code":0 }

The log tells…

2023-05-22 20:39:15.363 DEBUG (MainThread) [ta_cmi] Update device: 1
2023-05-22 20:39:15.364 DEBUG (MainThread) [ta_cmi] Make request to device 1 with parameters: I,O,D,Sg,Sd,St,Ss
2023-05-22 20:40:18.687 DEBUG (MainThread) [ta_cmi] Make request to device 1 with parameters: La,Ld
2023-05-22 20:40:40.448 INFO (MainThread) [homeassistant.components.websocket_api.http.connection] [140593536172096] Connection closed by client
2023-05-22 20:40:40.455 INFO (MainThread) [homeassistant.components.websocket_api.http.connection] [140593536009504] Connection closed by client
2023-05-22 20:41:21.391 DEBUG (MainThread) [ta_cmi] Update device: 50
2023-05-22 20:41:21.391 DEBUG (MainThread) [ta_cmi] Make request to device 50 with parameters: I,O

The uvr16x2 is device 1
device 50 is a CAN-MTx2

Thanks for your work!

Setup failed - Unsupported Device

Version of the custom_component

1.8.5

Describe the bug

Hey there...
During the setup of the integration the connect to CMI failed with an unsupported device error. The log message is pretty clear what's the problem but the reported device 31 is an CoE Endpoint configured on the CMI. Is it not possible to use the CMI and CoE Integration at the same time?

Greetings
rick

Debug log

Logger: custom_components.ta_cmi
Source: custom_components/ta_cmi/config_flow.py:125 
Integration: Technische Alternative C.M.I. (documentation, issues) 
First occurred: 15:59:19 (1 occurrences) 
Last logged: 15:59:19

Error while communicating with a device (31): Device not supported

2023-08-15 16:27:42.461 DEBUG (MainThread) [custom_components.ta_cmi] Sleep mode for 75 seconds to prevent rate limiting
2023-08-15 16:28:57.463 DEBUG (MainThread) [custom_components.ta_cmi] Try to fetch device type: 10
2023-08-15 16:28:57.875 DEBUG (MainThread) [custom_components.ta_cmi] Sleep mode for 75 seconds to prevent rate limiting
2023-08-15 16:30:12.877 DEBUG (MainThread) [custom_components.ta_cmi] Try to fetch available device channels: 10
2023-08-15 16:30:13.919 DEBUG (MainThread) [custom_components.ta_cmi] Sleep mode for 75 seconds to prevent rate limiting
2023-08-15 16:31:28.921 DEBUG (MainThread) [custom_components.ta_cmi] Try to fetch device type: 31
2023-08-15 16:31:28.932 WARNING (MainThread) [custom_components.ta_cmi] Error while communicating with a device (31): Device not supported
2023-08-15 16:31:28.943 DEBUG (MainThread) [custom_components.ta_cmi] Sleep mode for 75 seconds to prevent rate limiting
2023-08-15 16:32:43.945 DEBUG (MainThread) [custom_components.ta_cmi] Try to fetch device type: 50
2023-08-15 16:32:44.190 DEBUG (MainThread) [custom_components.ta_cmi] Sleep mode for 75 seconds to prevent rate limiting
2023-08-15 16:33:59.191 DEBUG (MainThread) [custom_components.ta_cmi] Try to fetch available device channels: 50
2023-08-15 16:34:14.393 ERROR (MainThread) [frontend.js.latest.202308020] :0:0 Script error.

no more log_entities (analog/digital) after todays update 1.3.0

Input/Output Entities still fine
all entities (for example Mischer % - Value) from a function logged to Analog_Out_XY is gone from the HA-Entities.

Debug log

no log entry for anything from hacs-ta

maybe there is a chance to switch back to the version before?
hope i have provided enough Info?
Thanks for any suggestion!

Adjusting entity

Hi there,

thanks for the great integration ! I am trying to figure out how I can adjust one of the entity setting so it is displayed in the energy dashboard.

On sensor.node_1_analog_logging_22 of my UVR16x2 I have the total kWh output of my solar warm water production. So basically I can retrieve the data just fine. To be able to integrate the data I need to change the state_class from measurement to total_increasing. By doing this in the developer tools it stops updating the data and from time to time the settings are reset. Not sure why. Do you have an idea how to approach this?

Thanks for your help :)

A way to read all internal Variables

Hello Maximilian,

I have written a logic (also in python, but not in HA), that is able to read any internal Variable from UVR.
I have documented it here:
https://knx-user-forum.de/forum/supportforen/smarthome-py/1451781-technische-alternative-uvr1611-16x2-mit-cmi-werte-in-sh-py-einlesen
(it is in German; let me know if you need a translation, but your name suggests that you might know German).

Would you have Interest to include this in HA?

Best regards,
Hendrik

Change Fixvalues

At the moment I Change the Fixvalues with a REST command directly send from Home assistant. I only Change "WW Sollwert".

Would be nice to do this with your custom component.

Read all changeable values and generate a Switch for ON/OFF entitys, Input_Select for multiple Status Like ON/OFF/Auto and a Climate entity for Tempratures and so on...

Do you think this is possible?

CMI Shutdown while starting up Integration

Version of the custom_component

v1.8.9
Running HassOs on an Intel x86 PC, newest version.

Describe the bug

While trying to set up the integration my CMI ist restarting itself (I have an email alert set up for this) and afterwards I only get one of the devices on my CAN-Bus (CAN I/O 45) as new device in HA, my UVR16x2 and all its sensors is not shown. Any Advice on how to fix this would be highly appreciated! Thanks!

Debug log

Logger: custom_components.ta_cmi
Source: custom_components/ta_cmi/config_flow.py:189
Integration: Technische Alternative C.M.I. (documentation, issues)
First occurred: 18:33:53 (1 occurrences)
Last logged: 18:33:53

Error while communicating with a device (1): Could not connect to X.X.X.X

MQTT support

I was using a python script to read CMI and push values to MQTT - very basic UVR1611 integration. Would it make sense to add this as an option to your integration?

Reasons:

  1. CMI data can be used in other applications
  2. mqtt can offer values even if the connection HA -> CMI is not working (persistent, last will, ...)

My sample here -sorry for the bad code, but I'm everything than a talented coder ...:

cmi2mqtt.py

#!/usr/bin/python3

import syslog
import json
import requests
import configparser
import sys
import paho.mqtt.client as mqtt
import time
import os

def touch_python(f_name, times=None):
    with open(f_name, 'a'):
        os.utime(f_name, times)

configfilename=sys.argv[1]
config = configparser.ConfigParser()
config.read(configfilename)

pid = os.getpid()

if not os.path.exists('/tmp/cmi2mqtt.busy'):

	touch_python('/tmp/cmi2mqtt.busy')

	ip=config.get('cmi','ip')
	can_node=config.get('cmi','can_node')
	username=config.get('cmi','username')
	password=config.get('cmi','password')
	mqttip = config.get('mqtt','mqttip')
	mqttuser = config.get('mqtt','mqttuser')
	mqttpassword = config.get('mqtt','mqttpassword')
	mqtttopicprefix = config.get('mqtt','mqtttopicprefix')

	mqttclient =mqtt.Client("cmi2mqtt")
	mqttclient.username_pw_set(mqttuser, mqttpassword)
	mqttclient.connect(mqttip)

	url = "http://"+ip+"/INCLUDE/api.cgi?jsonnode="+can_node+"&jsonparam=I,O,Na,Nd";

	result = requests.get(url, auth=(username, password)).text
	data = json.loads(result)

	mqttclient.publish(mqtttopicprefix+"/Status", str(data["Status"]), qos=0, retain=True)
	time.sleep(0.1)
	mqttclient.publish(mqtttopicprefix+"/Timestamp", str(data['Header']['Timestamp']))
	time.sleep(0.1)

	if data['Status'] == 'OK':

		mqttclient.publish(mqtttopicprefix+"/Live", str("ONLINE"), qos=0, retain=True)

		input_data = data["Data"]["Inputs"]
		output_data = data["Data"]["Outputs"]
		networkanalog_data = data["Data"]["Network Analog"]
		networkdigital_data = data["Data"]["Network Digital"]

		inputs={}
		for key in input_data:
			time.sleep(0.1)
			mqttclient.publish(mqtttopicprefix+"/Inputs/"+str(key["Number"]),str(key["Value"]["Value"]), qos=0, retain=True)
			inputs[key["Number"]]=key["Value"]["Value"]

		networkanalog={}
		for key in networkanalog_data:
			time.sleep(0.1)
			mqttclient.publish(mqtttopicprefix+"/NWa/"+str(key["Number"]),str(key["Value"]["Value"]), qos=0, retain=True)
			networkanalog[key["Number"]]=key["Value"]["Value"]

		networkdigital={}
		for key in networkdigital_data:
			time.sleep(0.1)
			mqttclient.publish(mqtttopicprefix+"/NWd/"+str(key["Number"]),str(key["Value"]["Value"]), qos=0, retain=True)
			networkanalog[key["Number"]]=key["Value"]["Value"]

		outputs={}
		for key in output_data:
			time.sleep(0.1)
			mqttclient.publish(mqtttopicprefix+"/Outputs/"+str(key["Number"]),str(key["Value"]["Value"]), qos=0, retain=True)
			outputs[key["Number"]]=key["Value"]["Value"]

		syslog.syslog(syslog.LOG_INFO, 'CMI -> MQTT update successful (' + str(pid) + ')')
		os.remove('/tmp/cmi2mqtt.busy')

	elif data['Status'] == 'TOO MANY REQUESTS':

		syslog.syslog(syslog.LOG_ERR, 'CMI -> MQTT failed, return code: ' + str(data["Status"]) +' (' + str(pid) + ')')


	else:

		mqttclient.publish(mqtttopicprefix+"/Live", str("OFFLINE"), qos=0, retain=True)
		syslog.syslog(syslog.LOG_ERR, 'CMI -> MQTT failed, reurn code: ' + str(data["Status"]) +' (' + str(pid) + ')')

else:

	syslog.syslog(syslog.LOG_ERR, 'CMI -> MQTT BUSY (' + str(pid) + ')')
	os.remove('/tmp/cmi2mqtt.busy')

and the config file

[cmi]
ip = <CMI IP>
username = <CMI USER>
password = <PASSWORD>
can_node = <NODE ID>

[mqtt]
mqttip = <MQTT SERVER IP>
mqttuser = <MQTT USER>
mqttpassword = <PASSWORD>
mqtttopicprefix = UVR1611

was scheduled via crontab once a minute - but has some issues with system startup

Just as an idea ...

Error when setup with multiple nodes

Version of the custom_component

1.0

Describe the bug

Installation as described not possible, unknown error occurs.

image

Connection to the CMI works. If e.g. giving wrong credentials, an authentication error occurs. With correct credentials, after about one minute the above posted screen appears.

And calling the API with a browser with e.g. http://192.168.0.13/INCLUDE/api.cgi?jsonnode=1&jsonparam=I,O, parameters are given well:

{ "Header":{ "Version":6, "Device":"8C", "Timestamp":1666686007 }, "Data":{ "Inputs":[ { "Number":1, "AD":"A", "Value":{ "Value":26.0, "Unit":"1" } }, { "Number":2, "AD":"A", "Value":{ "Value":75.0, "Unit":"8" } }, { "Number":3, "AD":"A", "Value":{ "Value":21.1, "Unit":"1" } }, { "Number":4, "AD":"A", "Value":{ "Value":0.0, "Unit":"65" } }, { "Number":5, "AD":"A", "Value":{ "Value":0, "Unit":"67" } }, { "Number":6, "AD":"A", "Value":{ "Value":18.2, "Unit":"52" } }]}, "Status":"OK", "Status code":0 }

Any ideas, how to catch the error? If futher informations are needed, please let me know.

Thank You for support and for the integration!
Günter

Debug log

`Logger: aiohttp.server
Source: custom_components/ta_cmi/config_flow.py:137
Integration: Technische Alternative C.M.I. (documentation, issues)
First occurred: 07:57:45 (3 occurrences)
Last logged: 08:10:57

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 82, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 73, in wrapper
result = await method(view, request, data, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 280, in async_configure
result = await self._async_handle_step(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/config/custom_components/ta_cmi/config_flow.py", line 94, in async_step_user
return await self.async_step_devices()
File "/config/custom_components/ta_cmi/config_flow.py", line 137, in async_step_devices
await dev.update()
File "/usr/local/lib/python3.10/site-packages/ta_cmi/device.py", line 48, in update
self.outputs: Dict[int, Channel] = self._extractChannels(ChannelMode.OUTPUT, res["Data"]["Outputs"])
KeyError: 'Outputs'`

Support for Modbus Input Output in CAN-BC2

The query Option for the Json-Api is "AM".

Here is a Sample json Output.

{ "Header":{ "Version":6, "Device":"8D", "Timestamp":1672830232 }, "Data":{ "Modbus":[ { "Number":1, "AD":"A", "Value":{ "Value":6.7, "Unit":"58" } }, { "Number":2, "AD":"A", "Value":{ "Value":18.1, "Unit":"58" } }, { "Number":3, "AD":"A", "Value":{ "Value":56.5, "Unit":"1" } }, { "Number":4, "AD":"A", "Value":{ "Value":8.3, "Unit":"58" } }, { "Number":5, "AD":"A", "Value":{ "Value":7.4, "Unit":"58" } }, { "Number":6, "AD":"A", "Value":{ "Value":5.0, "Unit":"58" } }, { "Number":7, "AD":"A", "Value":{ "Value":30.6, "Unit":"1" } }, { "Number":8, "AD":"A", "Value":{ "Value":-1.2, "Unit":"1" } }, { "Number":9, "AD":"A", "Value":{ "Value":19, "Unit":"0" } }, { "Number":10, "AD":"A", "Value":{ "Value":31, "Unit":"0" } }, { "Number":11, "AD":"A", "Value":{ "Value":201, "Unit":"0" } }, { "Number":12, "AD":"A", "Value":{ "Value":9.5, "Unit":"58" } }, { "Number":13, "AD":"A", "Value":{ "Value":56.4, "Unit":"1" } }, { "Number":14, "AD":"A", "Value":{ "Value":50, "Unit":"0" } }, { "Number":15, "AD":"A", "Value":{ "Value":42.6, "Unit":"1" } }, { "Number":16, "AD":"A", "Value":{ "Value":42.6, "Unit":"1" } }, { "Number":17, "AD":"A", "Value":{ "Value":0, "Unit":"0" } }, { "Number":18, "AD":"A", "Value":{ "Value":40.6, "Unit":"1" } }, { "Number":19, "AD":"A", "Value":{ "Value":0.0, "Unit":"8" } }, { "Number":20, "AD":"A", "Value":{ "Value":0, "Unit":"0" } }, { "Number":21, "AD":"A", "Value":{ "Value":0, "Unit":"0" } }, { "Number":22, "AD":"A", "Value":{ "Value":1, "Unit":"0" } }, { "Number":23, "AD":"D", "Value":{ "Value":1, "Unit":"43" } }, { "Number":24, "AD":"A", "Value":{ "Value":93.5, "Unit":"8" } }, { "Number":25, "AD":"A", "Value":{ "Value":28.2, "Unit":"1" } }, { "Number":26, "AD":"A", "Value":{ "Value":25.9, "Unit":"1" } }, { "Number":27, "AD":"A", "Value":{ "Value":28.4, "Unit":"1" } }, { "Number":28, "AD":"A", "Value":{ "Value":3.7, "Unit":"1" } }, { "Number":29, "AD":"A", "Value":{ "Value":2, "Unit":"0" } }, { "Number":30, "AD":"A", "Value":{ "Value":2, "Unit":"0" } }, { "Number":31, "AD":"A", "Value":{ "Value":43.0, "Unit":"1" } }, { "Number":32, "AD":"A", "Value":{ "Value":-3276.7, "Unit":"1" } }, { "Number":33, "AD":"A", "Value":{ "Value":-3276.7, "Unit":"1" } }, { "Number":34, "AD":"D", "Value":{ "Value":1, "Unit":"43" } }, { "Number":35, "AD":"A", "Value":{ "Value":0.45, "Unit":"10" } }, { "Number":36, "AD":"A", "Value":{ "Value":0, "Unit":"0" } }, { "Number":37, "AD":"A", "Value":{ "Value":46.0, "Unit":"58" } }, { "Number":38, "AD":"A", "Value":{ "Value":43.0, "Unit":"58" } }, { "Number":39, "AD":"A", "Value":{ "Value":1, "Unit":"0" } }, { "Number":40, "AD":"A", "Value":{ "Value":120, "Unit":"0" } }, { "Number":41, "AD":"A", "Value":{ "Value":240, "Unit":"0" } }, { "Number":42, "AD":"A", "Value":{ "Value":1, "Unit":"0" } }, { "Number":43, "AD":"D", "Value":{ "Value":0, "Unit":"43" } }, { "Number":44, "AD":"A", "Value":{ "Value":0.0, "Unit":"8" } }, { "Number":45, "AD":"A", "Value":{ "Value":6.6, "Unit":"58" } }, { "Number":46, "AD":"A", "Value":{ "Value":3, "Unit":"0" } }, { "Number":47, "AD":"A", "Value":{ "Value":1, "Unit":"0" } }, { "Number":48, "AD":"A", "Value":{ "Value":-1, "Unit":"0" } }, { "Number":49, "AD":"A", "Value":{ "Value":2, "Unit":"0" } }, { "Number":50, "AD":"A", "Value":{ "Value":0, "Unit":"0" } }, { "Number":51, "AD":"A", "Value":{ "Value":0, "Unit":"0" } }, { "Number":52, "AD":"A", "Value":{ "Value":0, "Unit":"0" } }, { "Number":53, "AD":"A", "Value":{ "Value":3, "Unit":"0" } }, { "Number":54, "AD":"A", "Value":{ "Value":0, "Unit":"0" } }, { "Number":55, "AD":"A", "Value":{ "Value":10100000, "Unit":"0" } }, { "Number":56, "AD":"A", "Value":{ "Value":3115, "Unit":"0" } }, { "Number":57, "AD":"A", "Value":{ "Value":5.1, "Unit":"58" } }, { "Number":58, "AD":"A", "Value":{ "Value":20.0, "Unit":"1" } }, { "Number":59, "AD":"A", "Value":{ "Value":7536, "Unit":"0" } }, { "Number":60, "AD":"A", "Value":{ "Value":867, "Unit":"0" } }, { "Number":61, "AD":"D", "Value":{ "Value":0, "Unit":"43" } }, { "Number":62, "AD":"A", "Value":{ "Value":202, "Unit":"0" } }, { "Number":63, "AD":"A", "Value":{ "Value":0.86, "Unit":"10" } }, { "Number":64, "AD":"A", "Value":{ "Value":12604, "Unit":"0" } }]}, "Status":"OK", "Status code":0 }

Thanks for your great Work :)

Read out switch position room sensor

Hi DeerMaximum,

is it may be possible to read out the switch position from the room sensor? At the moment this seems not to be included in a node. For me important is the "standby mode".

  • Automatic mode
  • Normal mode
  • Lowering mode
  • Standby mode

Also interesting is the target temperature from the room sensors.

Thank you and kind regards,
alele

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.