New binding for 1Wire, FHT and Evo Home radio signals

New binding for OpenHAB 2.5

  • Onewire pure java.
  • FHT radio via CUL
  • Evo Home RF also via CUL

It uses spsw to access the seral port.
Git: https://github.com/aploese/esh-ibapl
Download esh-ibapl-kar-2.0.0-SNAPSHOT.kar or newer from : https://oss.sonatype.org/content/repositories/snapshots/de/ibapl/esh/esh-ibapl-kar/2.0.0-SNAPSHOT/.
The FHT protocol works a couple of years for me.
The Evo Home binding are quit new and under development to monitor and record the valve positions and temperatures.

Arne

2 Likes

Hello Arne,

I’ve just found by accident this post and I’m very interested in your modern FHT binding. I’m still using the old openHAB1 addons for CUL and FHT with openHAB 2.5 and bridge the items to openHAB 3.1. With your binding I would get rid of openHAB 2.5.

I’m struggling a bit to get the binding running with openHAB 3.1. I’ve copied oh-ibapl-kar-3.0.0-20210224.184448-5.kar and de.ibapl.openhab.fhz4j-3.0.0-20210224.184422-5.jar and to the addons and managed to get debug log output from the binding. It doesn’t look like the CUL is found. Also the binding is not show in the configuration page nor a config file is created in the services folder.

Is it possbile to run these builds with openHAB 3.1 at all? If so, how can I configure the binding to use the CUL and my housecode?

Thank you and best regards
Pit

Here is the updated link which works on my site with OpenHAB 3.1.0:

https://oss.sonatype.org/content/repositories/snapshots/de/ibapl/openhab/oh-ibapl-kar/3.0.0-SNAPSHOT/oh-ibapl-kar-3.0.0-20211116.180711-6.kar

Maybe the CUL is used by the old OW - network.
If so disable this first or test if you can open /dev/ttyACM0 with i.e. screen or minicom.
then the CUL should be found.

Arne

Thank you for your answer. I did now a clean install of openhabian image with openHAB 3.1.0 on a raspi:

  • CUL is acessible via /dev/ttyACM0. openhab user is member of dialout. It can be openend with screen and minicom.
  • I’ve installed your latest build. It takes some minutes until all bundles are listed in the console.
  • Set the log level for de.ibapl to TRACE.

When I compare the logs with and without the CUL attached, there is no difference.
In the web interface, no bindings are shown.

Pit

Hi Pit,

on the new Frontend log in as admin.
Go to Things press the + button on the lower right corner.
Choose the binding FHT4J which should be listed.
Add the CUL RS232 Bridge and configure the bridge.
then the FHT80 devices should show up. I added them with the “old” HAB Panel.

Arne

Hello Arne,

this helped a lot! After adding the CUL RS232 bridge, a scan button appeared once in the WebGUI. All the FHT80b and the HMS were found. From the HMS I could receive temperature and humidity updates. For the FHT80b I have to check, why no updates are received.

I’ve installed log.io to listen to 127.0.0.1:6689, but couldn’t get any messages. Is there a special configuration required?

Best regards
Pit

You don’t need log.io Maybe “log the IO” is a better phase. the logs are found here (*nix):
/var/lib/openhab/CUL_SpswBridgeHandler_‘TIMESTAMP_OF_OPENING’.log.txt
so I have a /var/lib/openhab/CUL_SpswBridgeHandler_2021-11-19T16:31:31.101275Z.log.txt
for which the port was opened at 2021-11-19T16:31:31.101275.

this is set to ASCII, because the CUL reds and writes in command line style.
For the commands see the refernence culfw reference.

Arne

Hello Arne,

meanwhile I’ve installed your bindings on my productive setup (Intel NUC with openHAB 3.1.0 in a docker container). It works just fine! It’s amazing to see the old FHT80b beeing supported natively without any legacy bundles and bridging or other workarounds.

The missing support for window contacts can easily be replaced by rules which detect the WindowopenTemperatur setting.

Great work, thank you!
Pit

What kind of support do you need for window contacts - I haven’t got any in use.
If its only parsing please send me some IO log snipplets - I will look into it.
If its sending give me the command…

Arne

I’m using two FHT80TF-2: FHT80TF-2 – FHEMWiki

I’ll try to get IO logs soon.

Best Regards
Pit

These are the window contacts:

  • “housecode=3EBA;address=5A;datapoint=WINDOW”
  • “housecode=0DB5;address=26;datapoint=WINDOW”

And this is the log, both sensors are switched to open and back to closed:

@2021-12-03T12:04:35.484263Z	SP	call opend:	"/dev/ttyACM0" (speed=_38400_BPS, dataBits=DB_8, stopBits=SB_1, partity=NONE, flowControl=[])
@2021-12-03T12:04:35.497093Z	@2021-12-03T12:04:35.496941Z	CH	callCH	call write:	" read
"
@2021-12-03T12:05:19.186990Z	CH	call read
@2021-12-03T12:05:22.022910Z	CH	return read:	"T0DB5260223\r\n"	duration: PT2.83592S
@2021-12-03T12:05:22.023960Z	ExR	"FHT Message: {protocol : FHT, housecode : 1225, command : FRI_FROM_2, description : 0x02, fromFht_8b : false, dataRegister : false, value: 0x23}, signal strength: -77.000000"
@2021-12-03T12:05:22.024785Z	CH	call read
@2021-12-03T12:05:22.518246Z	CH	return read:	"T0DB5268224\r\n"	duration: PT0.493461S
@2021-12-03T12:05:22.519223Z	ExR	"FHT Message: {protocol : FHT, housecode : 1225, command : FRI_FROM_2, description : 0x82, fromFht_8b : false, dataRegister : false, value: 0x24}, signal strength: -77.000000"
@2021-12-03T12:05:22.519860Z	CH	call read
@2021-12-03T12:05:34.636480Z	CH	return read:	"T3EBA5A0222\r\n"	duration: PT12.11662S
@2021-12-03T12:05:34.637981Z	ExR	java.lang.RuntimeException: State: COLLECT_COMMAND command: null last byte 0x5a
	at de.ibapl.fhz4j.parser.fht.FhtParser.parse(FhtParser.java:340)
	at de.ibapl.fhz4j.parser.cul.CulParser.parse(CulParser.java:305)
	at de.ibapl.fhz4j.cul.CulAdapter$StreamListener.run(CulAdapter.java:66)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.UnsupportedOperationException: Unknown command: 0x5a
	at de.ibapl.fhz4j.parser.fht.FhtParser.getCommand(FhtParser.java:215)
	at de.ibapl.fhz4j.parser.fht.FhtParser.parse(FhtParser.java:322)
	... 3 more
@2021-12-03T12:05:34.640186Z	CH	call read
@2021-12-03T12:05:35.132880Z	CH	return read:	"T3EBA5A8224\r\n"	duration: PT0.492694S
@2021-12-03T12:05:35.134131Z	ExR	java.lang.RuntimeException: State: COLLECT_COMMAND command: null last byte 0x5a
	at de.ibapl.fhz4j.parser.fht.FhtParser.parse(FhtParser.java:340)
	at de.ibapl.fhz4j.parser.cul.CulParser.parse(CulParser.java:305)
	at de.ibapl.fhz4j.cul.CulAdapter$StreamListener.run(CulAdapter.java:66)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.UnsupportedOperationException: Unknown command: 0x5a
	at de.ibapl.fhz4j.parser.fht.FhtParser.getCommand(FhtParser.java:215)
	at de.ibapl.fhz4j.parser.fht.FhtParser.parse(FhtParser.java:322)
	... 3 more

@2021-12-03T12:06:21.680682Z	CH	call read
@2021-12-03T12:06:23.025093Z	CH	return read:	"T0DB5260220\r\n"	duration: PT1.344411S
@2021-12-03T12:06:23.026040Z	ExR	"FHT Message: {protocol : FHT, housecode : 1225, command : FRI_FROM_2, description : 0x02, fromFht_8b : false, dataRegister : false, value: 0x20}, signal strength: -77.000000"
@2021-12-03T12:06:23.026951Z	CH	call read
@2021-12-03T12:06:23.520214Z	CH	return read:	"T0DB5268221\r\n"	duration: PT0.493263S
@2021-12-03T12:06:23.521036Z	ExR	"FHT Message: {protocol : FHT, housecode : 1225, command : FRI_FROM_2, description : 0x82, fromFht_8b : false, dataRegister : false, value: 0x21}, signal strength: -77.000000"
@2021-12-03T12:06:23.521769Z	CH	call read
@2021-12-03T12:06:37.639482Z	CH	return read:	"T3EBA5A021B\r\n"	duration: PT14.117713S
@2021-12-03T12:06:37.640547Z	ExR	java.lang.RuntimeException: State: COLLECT_COMMAND command: null last byte 0x5a
	at de.ibapl.fhz4j.parser.fht.FhtParser.parse(FhtParser.java:340)
	at de.ibapl.fhz4j.parser.cul.CulParser.parse(CulParser.java:305)
	at de.ibapl.fhz4j.cul.CulAdapter$StreamListener.run(CulAdapter.java:66)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.UnsupportedOperationException: Unknown command: 0x5a
	at de.ibapl.fhz4j.parser.fht.FhtParser.getCommand(FhtParser.java:215)
	at de.ibapl.fhz4j.parser.fht.FhtParser.parse(FhtParser.java:322)
	... 3 more
@2021-12-03T12:06:37.641814Z	CH	call read
@2021-12-03T12:06:38.135585Z	CH	return read:	"T3EBA5A821C\r\n"	duration: PT0.493771S
@2021-12-03T12:06:38.136606Z	ExR	java.lang.RuntimeException: State: COLLECT_COMMAND command: null last byte 0x5a
	at de.ibapl.fhz4j.parser.fht.FhtParser.parse(FhtParser.java:340)
	at de.ibapl.fhz4j.parser.cul.CulParser.parse(CulParser.java:305)
	at de.ibapl.fhz4j.cul.CulAdapter$StreamListener.run(CulAdapter.java:66)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.UnsupportedOperationException: Unknown command: 0x5a
	at de.ibapl.fhz4j.parser.fht.FhtParser.getCommand(FhtParser.java:215)
	at de.ibapl.fhz4j.parser.fht.FhtParser.parse(FhtParser.java:322)
	... 3 more
@2021-12-03T12:06:38.138006Z	CH	call read
@2021-12-03T12:06:51.140460Z	CH	return read: buff.position=15, buff.remaining=49	java.nio.channels.ClosedByInterruptException"	duration: PT13.002454S
java.nio.channels.ClosedByInterruptException
	at java.base/java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:199)
	at de.ibapl.spsw.jnhwprovider.PosixSerialPortSocket.read(PosixSerialPortSocket.java:1049)
	at de.ibapl.spsw.logging.LoggingSerialPortSocket.read(LoggingSerialPortSocket.java:155)
	at de.ibapl.fhz4j.cul.CulAdapter$StreamListener.run(CulAdapter.java:62)
	at java.base/java.lang.Thread.run(Thread.java:829)

Best Regards
Pit

You can give the 3.2.0 snapshot a try.

On sonartype.https://oss.sonatype.org/content/repositories/snapshots/de/ibapl/openhab/oh-ibapl-kar/3.2.0-SNAPSHOT/oh-ibapl-kar-3.2.0-20220120.135418-1.kar

It should parse the TF signal and has a thing + channels for the values.

Arne

Thank you, I’ve update the binding. Some bundles remain on the old version, is this expected?

303 │ Active │  80 │ 2.1.0.202109161204    │ FHZ4J :: Adapter CUL
304 │ Active │  80 │ 1.1.0.202109161201    │ OneWire4J :: API/SPI
307 │ Active │  80 │ 1.0.0.201802012106    │ org.osgi:org.osgi.service.jaxrs
308 │ Active │  80 │ 3.2.0.202201201353    │ OH IbAPl :: FHZ4J Binding
309 │ Active │  80 │ 3.2.0.202201201354    │ OH IbAPl :: OneWire4J Binding

I’ve scanned with the CUL bridge for new things, but the TF are not discovered - I’ve triggered the sensors multiple times.
Next I’ve created the TF manually with the 6 digit hex number from the log, but the channels are not updated.
Here is another snippet from the CUL log. Maybe it doesn’t work due to the runtime exception?

@2022-01-22T14:37:18.411019Z	CH	call read
@2022-01-22T14:37:27.989083Z	CH	return read:	"T3EBA5A0220\r\n"	duration: PT9.578064S
@2022-01-22T14:37:27.990348Z	ExR	java.lang.RuntimeException: State: COLLECT_COMMAND command: null last byte 0x5a
	at de.ibapl.fhz4j.parser.fht.FhtParser.parse(FhtParser.java:340)
	at de.ibapl.fhz4j.parser.cul.CulParser.parse(CulParser.java:305)
	at de.ibapl.fhz4j.cul.CulAdapter$StreamListener.run(CulAdapter.java:66)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.UnsupportedOperationException: Unknown command: 0x5a
	at de.ibapl.fhz4j.parser.fht.FhtParser.getCommand(FhtParser.java:215)
	at de.ibapl.fhz4j.parser.fht.FhtParser.parse(FhtParser.java:322)
	... 3 more
@2022-01-22T14:37:27.992792Z	CH	call read
@2022-01-22T14:37:28.485494Z	CH	return read:	"T3EBA5A8221\r\n"	duration: PT0.492702S
@2022-01-22T14:37:28.486650Z	ExR	java.lang.RuntimeException: State: COLLECT_COMMAND command: null last byte 0x5a
	at de.ibapl.fhz4j.parser.fht.FhtParser.parse(FhtParser.java:340)
	at de.ibapl.fhz4j.parser.cul.CulParser.parse(CulParser.java:305)
	at de.ibapl.fhz4j.cul.CulAdapter$StreamListener.run(CulAdapter.java:66)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.UnsupportedOperationException: Unknown command: 0x5a
	at de.ibapl.fhz4j.parser.fht.FhtParser.getCommand(FhtParser.java:215)
	at de.ibapl.fhz4j.parser.fht.FhtParser.parse(FhtParser.java:322)
	... 3 more

Best Regards
Pit

Hi Pit,

no they must be updatetd.
from the OpenHAB CLI run feature:refresh and so on. Or if it does not
help restart OpenHAB.

Arne

Hi Arne,

I did a lot of more tries with the feature command. The version numbers remain the same. Also the dependencies seem to be the ones that are visible in the bundle list:

308 │ Active │  80 │ 3.1.0                 │ SPSW :: API
309 │ Active │  80 │ 3.1.0                 │ SPSW :: JNHW Provider
310 │ Active │  80 │ 2.1.0.202109161204    │ FHZ4J :: Adapter CUL
311 │ Active │  80 │ 3.2.0.202201201353    │ OH IbAPl :: FHZ4J Binding
312 │ Active │  80 │ 1.1.0.202109161201    │ OneWire4J :: API/SPI
313 │ Active │  80 │ 3.2.0.202201201354    │ OH IbAPl :: OneWire4J Binding
Feature openhab-fhz4j-binding 3.2.0.SNAPSHOT
Description:
  Fhz4J OH Binding
Feature has no configuration
Feature has no configuration files
Feature depends on:
  openhab-runtime-base 0.0.0
Feature contains followed bundles:
  mvn:de.ibapl.spsw/de.ibapl.spsw.api/3.1.0
  mvn:de.ibapl.fhz4j/de.ibapl.fhz4j.parser.cul/2.1.0-SNAPSHOT
  mvn:de.ibapl.openhab/de.ibapl.openhab.fhz4j/3.2.0-SNAPSHOT
Feature has no conditionals.

Best Regards
Pit

Sorry,

I updated the version of the kar archive, did you delete the 3.0.0 kar
in addons?
If not OpenHAB/karaf will see both and decided not to use the newer one
for all bundles?

Arne

Hi Arne,

I’ve tried it once more:

  • delete the kar in addons
  • check with bundle:list and feature:list, that is it gone
  • stop openHAB
  • delete the cache
  • delete the kar from userdata\tmp
  • start openHAB
  • copy the kar (and features.xml and .pom) to addons

Now CUL is updated:

290 │ Active │  80 │ 2.1.0.202201200707    │ FHZ4J :: Adapter CUL
291 │ Active │  80 │ 3.2.0.202201201353    │ OH IbAPl :: FHZ4J Binding
292 │ Active │  80 │ 1.1.0.202109161201    │ OneWire4J :: API/SPI
293 │ Active │  80 │ 3.2.0.202201201354    │ OH IbAPl :: OneWire4J Binding
294 │ Active │  80 │ 3.2.0.features        │ oh-ibapl-kar

And now the good news: The manually created things started to update the linked items! To complete the test, I deleted one thing and successfully added it via CUL scan. The log gets populated with lots of messages like:

update FHT80 TF {protocol : FHT_TF, address : 0x0db526, value : WINDOW_INTERNAL_CLOSED, lowBattery : false} channel: {fhz4j:fht80-tf:829c126606:dca2bea8e4}

Does it make sense to copy the .pom file and features.xml to addons?

Thank you very much for your support!

Best Regards
Pit