DeerMaximum / Technische-Alternative-CoE

Custom Home Assistant integration to read data from a C.M.I. via CoE
MIT License
9 stars 1 forks source link

COE -> UVR 2byte border #50

Closed romeocontrol closed 5 months ago

romeocontrol commented 5 months ago

Hello, i really start loving this project. I transmit a lux/lum sensor reading to uvr. I had some failed transmissions. That was due to the transmitted value, which was to large.

TA told me now: the actual version of CoE supports 2 byte values. I.e. max -32,768 to 32,767 or 0 to 65,535. The decimal and sign depends on unit of the parameter, that is transmitted.

For Solarstrahlung in W/m² it is #.##. I.e. 1.56 in ha will be received as 156 W/m² in UVR. 200.00 will be sent as 20000, which is near to the border of 2bytes.

Conclusion: Test the calculation in UVR to prepare the correct sample for the transmission form ha.

ha COE CAN
DeerMaximum commented 5 months ago

Can you put the CoE server in debug mode and send me the logs where these values are received?

romeocontrol commented 5 months ago

home-assistant_ta_coe_2024-01-16T14-12-23.360Z.log

romeocontrol commented 5 months ago

This is with wrong transmissions. Not sure, which is more useful home-assistant_ta_coe_2024-01-15T18-31-34.196Z.log home-assistant_ta_coe_2024-01-15T16-48-48.126Z.log

DeerMaximum commented 5 months ago

I meant the logs from the Home Assistant addon. You can activate the debug mode there in the configuration

romeocontrol commented 5 months ago

home-assistant.log

romeocontrol commented 5 months ago

have to leave now, next answers later …

DeerMaximum commented 5 months ago

These are still the wrong logs. I need the logs from this addon:

Addon1

In the configuration page you can activate the debug mode

Addons2

Then you will find the logs here, where the individual packages are displayed. Please make sure that the packet contains your values in the logs.

Addon3

romeocontrol commented 5 months ago

CoE to HTTP server.log.txt

Thank you for your patience! Hope, it is correct now. It ist still running, can send more later, if necessary.

DeerMaximum commented 5 months ago

The error has been fixed with the latest server/addon version

romeocontrol commented 5 months ago

CoE to HTTP server Current version: 2.0.2 Technische Alternative CoE v1.3.4 Hallo, i am sorry, but it seems something ist wrong again with the CoE Transmissions. 178 is sent with unit=2 COE Log and UVR have just a singe 1 . See screenshots. Thank you in advance! RT

COE http log 18.01.24-16:11:36 DEBUG httpserver(143): Send analog data to CMI: values=[ValueTypeModel(value=178.0, unit=2), ValueTypeModel(value=0.0, unit=0), ValueTypeModel(value=0.0, unit=0), ValueTypeModel(value=0.0, unit=0)] page=1 18.01.24-16:11:36 DEBUG udpserver(40): Send message to 192.168.6.107:5441 : b'<\x01\x01\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00'

ha coe UVR-COE COE-Status
DeerMaximum commented 5 months ago

I have undone the change in the new server version. And tried to send 178 W/m2 to the C.M.I. myself, but I receive the value as expected. Can you use the new server version to send me the server logs again with the message where the data is transmitted?

romeocontrol commented 5 months ago

Works as expected, now. COE-http.log.txt

175 without decimals. On CoE-log, as shown on the CMI and on the UVR. Log from CoEHttp anbei.

Thank YoU! RT

CoE-Status
romeocontrol commented 5 months ago

I wrote my first computer program in 1974. We were grateful for tests and error messages back then. I hope it's still the same now :-)

Creating a new analog CAN sensor output in the UVR Create the appropriate CAN input and a CoE output in the CMI Integration blocked with 'Initialize' Reloading not possible homeassistant fast loading without effect Restart homeassistant Integration active again and new sensor accessible

coe integration homeassistant neu STARTEN CoE nach restart
romeocontrol commented 5 months ago

@DeerMaximum

'Denke daran, dass du Home Assistant neu starten musst, bevor Änderungen an Integrationen (custom_components) angewendet werden.'

So, what I mentioned above seems to be:

not a bug but a feature

.

DeerMaximum commented 5 months ago

I have personally experienced the behavior that the integration hangs in the 'Initialize' status a few times. It is planned to remove the feature that the integration automatically reloads when a new sensor is detected.

DeerMaximum commented 5 months ago

Since the actual error has been fixed, I am closing the issue again.