ramack / openhab-addons

Add-ons for openHAB 2.x
Eclipse Public License 1.0
1 stars 1 forks source link

Reading temperature sensors connected to a DL3 #16

Closed JonasMH closed 4 years ago

JonasMH commented 6 years ago

Hi, I have successfully got the binding working with a DL3, which in turn is connected to a SKSC3HE from which I can read all values as expected. I also have a couple of sensors connected directly to the DL3, but i can't find these in the Paper UI, i tried adding the DL3 as a device, but no luck there.

image

Not sure if the issue should be posted here or on the community thread, so let me know if it's the wrong place.

ramack commented 6 years ago

Hi,

sorry for not responding faster, but this is good place here to put it. Thanks for reporting success with the DL3, but to be honest, I have no glue how the DL3 works.

The questions that I have in mind would be:

@JonasMH or @danielwippermann can you explain that for me?

Then I can try to improve the binding to support that.

Thanks, Rapha

JonasMH commented 6 years ago

Thanks for getting back to me, no worries about response time, just wasn't sure if you used github for feature/bug-tracking.

If i look on the vbus.net website i get the following live data: image So the data is available over the lan-interface somehow and it looks like the DL3's own sensors is connected over VBUS as well, but on VBUS0.

Hope that helps. I'll try and get the resol-vbus-java library up and running and report back. Pretty new to the java environment, so it may take i while :)

danielwippermann commented 6 years ago

Hi all,

How are the 6 VBus interfaces be differentiated on the Ethernet side of the VBUS-LAN interface? Are there different TCP ports for the different physical busses? And how will they be detected by the resol-vbus-java library?

The six physical VBus channels can be accessed over the same TCP port (7053). That's what the channel property of the TcpConnection class is for: if you set it to something other than 0 it will send a CHANNEL <nr> command during the connection handshake to tell the DL3 which physical channel to use.

Sadly it does not work with the virtual channel 0...

What is the interface for accessing the 3/4 sensors directly attached to the DL3? Is there also a "virtual" VBUS-LAN-bridge for them? Or are they even "connected" to one of the 1 physical VBUS channels?

As far as I know you cannot access the sensor values of the DL3 and its associated special functions (like the heat quantity measurement on newer DL3s) by using the TCP connection to port 7053. That only works for the physical channels. The virtual channel 0 is only accessible in the recorded data files.

What is the special thing about channel 6 - which is somehow a "master/slave" port?

Yes, the channel is prepared to supply voltage to attached devices. That way you could connect an accessory like a Smart Display SD3 or similar to that channel and power it from the DL3 without having to use a controller. But that feature is currently unused.

Can you access the data of the sensors from your controller? Or are they only usable for data logging?

They are only usable in the logged data. There is currently no propagation of those values to the controllers attached to the physical channels.

Are the sensor values from the DL3-attached sensors available on the LAN somehow? (How?)

The only way I know of is by fetching the live data file from the DL3 using HTTP(S) and parsing it. That file contains the latest snapshot of data received from both virtual and physical VBus channels. Sadly there is no built-in support for the file format in the resol-vbus-java lib (currently). But since the file format is publicly documented it should be easy to implement that support if you consider to add that feature.

Best regards, Daniel

ramack commented 6 years ago

OMG, Daniel, you are so fast. Thanks for the answers. As the DL seems linux based it should be easy to make the DL3 could "easily" emulate an EM for example and with that provide the sensor values to a vbus- connected controller - and by that make the data implicitly available on the physical VBUS interface. -> Just as idea in case there is a student doing an internship at Resol some day :-)

@JonasMH the answers from Daniel actually don't look that it is very useful at all to connect sensors to the DL3, so I expect that - even though there is the option to read the values - your use case is quite special and I am not eager on implementing that in the binding right now, sorry.

In case there are other people interested in that it might change in future. Alternatively I'd be happy to include a PR from you, if you are interested in implement that.

About the channel in TcpConnection: is for the DL3 possible to open several TPC connections to the live data port - one for each channel? And is there a possibility to find out whether the detected device supports multiple channels? -> This would be a feature we should probably support in the binding.

JonasMH commented 6 years ago

Thank you @danielwippermann and @ramack for you prompt responses.

I'm thinking over what else i can do, maybe i can swap some sensors around. But if that's not the case I will properly try and implement what you suggested. Thank you

danielwippermann commented 6 years ago

Hi,

About the channel in TcpConnection: is for the DL3 possible to open several TPC connections to the live data port - one for each channel? And is there a possibility to find out whether the detected device supports multiple channels? -> This would be a feature we should probably support in the binding.

Yes, that is possible. You can fetch device-specific information from the URL that the DeviceDiscovery tool is using as well:

http://IP_of_DLx/cgi-bin/get_resol_device_information

That looks like this for a DL3:

vendor = "RESOL"
product = "DL3"
serial = "001E66xxxxxx"
version = "2.2.2"
build = "201712011237"
name = "DL3-001E66xxxxxx"
features = "vbus,dl2,dl3"

The features element is a comma-separated list of keywords and the dl3 feature keywords marks support for the CHANNELLIST and CHANNEL commands in the connection-handshake of the VBus-over-TCP protocol.

Best regards, Daniel

PS: Edit: fix typo...

ramack commented 6 years ago

adding multi-channel support for the DL3 is in #18, so this here stays about the sensors directly attached to the DL3 without VBUS, which needs a HTTP(S)-connection to get the current state (see documentation at https://danielwippermann.github.io/resol-vbus/dlx-data-download-api.html ).

JonasMH commented 6 years ago

That link helped a lot, found a quick n' dirty of way of getting the DL3 sensors into openHAB:

Number Resol_DL3_Temp1 (gResol) { http="<[http://<DL3>/dlx/download/live?sessionAuthUsername=user&sessionAuthPassword=pass:10000:JSONPATH($.headersets[0].packets[0].field_values[4].raw_value)]" }

While it is not the best solution, it will work until I have time to make a PR :)

ramack commented 4 years ago

I will not be able to close this before merging the binding into upstream, so I will close this issue. If @JonasMH is still planning to submit a PR to add this feature in the Resol binding, I propose you open a ticket there after merging and submit it directly in the upstream repository.