Oh2 cul

Hi folks,
I just started with OH2 and I’m little bit confused.
I have a full functional selfbuild nanoCUL and tried to integrate it in my fresh installed OH2 (on a debian box)).

As a start I would like to integrate a simple Intertechno Power Switch.

I connected 'minicom to my nanoCUL.
After Pressing ‘on’ on my intertechno remote control CUL responds with
i150015F4
pressing ‘off’ results in
i150014F4

Looks good for me.
I installed ‘Intertechno binding’.
If I’m right there is no graphical way to configure ‘Intertechno devices’. You have to create some config files.
After reading through the web I think I have to configure ‘services’, ‘items’, ‘sitemap’?
But how? That’s the question now.

I configured services/culintertechno.cfg
device=serial:/dev/ttyUSB0
baudrate=38400

After restarting I checked kara log:tail

09:36:30.820 [WARN ] [io.transport.cul.CULLifecycleManager] - CUL config is NULL, doing nothing
09:36:30.820 [INFO ] [ternal.serial.CULSerialConfigFactory] - Update config, baudrate = 38400
09:36:30.834 [WARN ] [io.transport.cul.CULLifecycleManager] - CUL config is NULL, doing nothing
09:36:35.223 [WARN ] [e.sshd.server.channel.ChannelSession] - Unknown pty opcode value: 42

It seems, that OH2 can speak with the device.
What does it mean ‘CUL Config is NULL’

Now it’s time to configure item/.
But how?

Maybe someone can bring in some light.

Thank you

High
I’m using a CUL to switch my (Elro or REV) power switches.
Since the Intertechno binding is not a 2.x binding, it doesn’t work with things.
Besides the .cfg you simply create switch items that send specific on and off commands.
Here are my examples:
Switch Elro_Weiss “Elro-Weiss” (EG_Wohnzimmer) {culintertechno=“type=raw;address=00000FFF0F;commandOn=FF;commandOff=F0”} /* Intertechno Code A15, Elro weiß */
Switch REV_A “REV_A” (EG_Flur) {culintertechno=“type=raw;address=000FFF0FFF;commandOn=FF;commandOff=F0”} /REV Dose A , old devices, will toggle on both comands!!!/

I just took your lines and saved it in a file named
test.item in directory items.

After restart nothing changed.
CUL config is NULL, doing nothing

Mmh, finally I expect my ‘Power Switch’ is visible in the ‘PaperUI’ and I can switch it ‘on’ and ‘off’.
I played around with ‘sidemaps’ without success.

I think I need a more complete example.

What is the content of your items file, please post.
Please post your sitemap file as well.

I don’t see any of my switches which are connected to the CUL in the PAPERUI, , I’ve posted the reason above!

Did you solve your problem? I have the same log message.

What are your problems?
What kind of devices are you trying to switch, what are the items definitions. What is the content of your config file?

It’s the first time I try to use a OpenHab1 Binding in OpenHab2. Actually I try to activate the DEBUG log for Maxcul. How does this work?

  1. I flashed my Busware CUL with the actual firmware.
  2. I installed the max!cul binding via PaperUI.
  3. I edited /services/maxcul.cfg
maxcul:device=serial:/dev/ttyACM0
maxcul:baudrate=38400
maxcul:parity=NONE
maxcul:timezone=Europe/London
  1. I edited /items/maxcul.items (MEQ1293208 is my thermostat)
Group All
  Group HeatingElements (All)

  Switch swPair "Pair"  (HeatingElements) { maxcul="PairMode" }
  Switch swListen "Listen"  (HeatingElements) { maxcul="ListenMode" }

  Number valveSetpoint "Valve Current Setpoint [%.1f °C]"  (HeatingElements) { maxcul="RadiatorThermostat:MEQ1293208" }
  Switch valveBattery "Valve Battery"  (HeatingElements) { maxcul="RadiatorThermostat:MEQ1293208:feature=battery" }
  Number valveTemp "Valve Current Temp [%.1f °C]"  (HeatingElements) { maxcul="RadiatorThermostat:MEQ1293208:feature=temperature" }
  Number valvePosition "Valve Position [%.1f %%]" (HeatingElements) { maxcul="RadiatorThermostat:MEQ1293208:feature=valvepos" }
  1. I edited /sitemaps/maxcul.sitemap
sitemap maxcul label="Home Heating" {
    Frame {
      Group item=HeatingElements label="Heating" icon="none"
      Setpoint item=valveSetpoint icon="temperature" minValue=5 maxValue=30 step=0.5
    }
}
  1. On startup my openhab2.log says
2018-06-29 22:35:12.917 [WARN ] [io.transport.cul.CULLifecycleManager] - CUL config is NULL, doing nothing
2018-06-29 22:35:12.924 [INFO ] [ternal.serial.CULSerialConfigFactory] - Update config, baudrate = 38400
2018-06-29 22:35:12.930 [INFO ] [ternal.serial.CULSerialConfigFactory] - Update config, parity = NONE (0)

When I try to pair or send any other command the log says

2018-06-29 22:57:37.071 [ERROR] [ing.maxcul.internal.MaxCulMsgHandler] - Not enough credit after waiting. This is bad. Queued command is discarded

My knowledge is on the usage of the Intertechno binding, so I can’t say much about the correct item definition of MAXCUL.
In OH2 each binding has its own cfg file, because of that the starting " maxcul:" in every line has to be deleted.
The setup the DEBUG log for MaxCUL you need the give those commands on the Karaf console:

log:set DEBUG org.openhab.binding.maxcul
log:set DRBUG org.openhab.io.transport.cul

Thanks @opus !!

Openhab.log sais

2018-10-20 14:15:57.050 [DEBUG] [inding.maxcul.internal.MaxCulBinding] - Activating MaxCul binding
2018-10-20 14:15:57.053 [WARN ] [io.transport.cul.CULLifecycleManager] - CUL config is NULL, doing nothing
2018-10-20 14:15:57.057 [DEBUG] [org.openhab.binding.maxcul          ] - ServiceEvent REGISTERED - {org.osgi.service.event.EventHandler, org.osgi.service.cm.ManagedService}={service.id=329, service.bundleid=252, service.scope=bundle, ev$
2018-10-20 14:15:57.061 [DEBUG] [inding.maxcul.internal.MaxCulBinding] - MaxCUL Reading config
2018-10-20 14:15:57.067 [INFO ] [ternal.serial.CULSerialConfigFactory] - Update config, baudrate = 38400
2018-10-20 14:15:57.069 [INFO ] [ternal.serial.CULSerialConfigFactory] - Update config, parity = NONE (0)
2018-10-20 14:15:57.072 [DEBUG] [io.transport.cul.internal.CULManager] - Trying to open device serial:/dev/ttyACM0 in mode MAX
2018-10-20 14:15:57.074 [DEBUG] [io.transport.cul.internal.CULManager] - Searching class for device type serial
2018-10-20 14:15:57.100 [DEBUG] [internal.serial.CULSerialHandlerImpl] - Opening serial CUL connection for /dev/ttyACM0
2018-10-20 14:15:57.157 [DEBUG] [internal.serial.CULSerialHandlerImpl] - Adding serial port event listener
2018-10-20 14:15:57.180 [DEBUG] [ing.maxcul.internal.MaxCulMsgHandler] - Associated MaxCulBindingMessageProcessor
2018-10-20 14:16:02.552 [DEBUG] [nternal.MaxCulGenericBindingProvider] - Processing item swPair
2018-10-20 14:16:02.563 [DEBUG] [l.internal.MaxCulBindingConfigParser] - Pair Mode switch found
2018-10-20 14:16:02.567 [DEBUG] [nternal.MaxCulGenericBindingProvider] - Processing item swListen
2018-10-20 14:16:02.569 [DEBUG] [l.internal.MaxCulBindingConfigParser] - Listen Mode switch found
2018-10-20 14:16:02.573 [DEBUG] [nternal.MaxCulGenericBindingProvider] - Processing item valveSetpoint
2018-10-20 14:16:02.575 [DEBUG] [l.internal.MaxCulBindingConfigParser] - Found real device
2018-10-20 14:16:02.577 [DEBUG] [l.internal.MaxCulBindingConfigParser] - Part 0/1 -> RadiatorThermostat
2018-10-20 14:16:02.579 [DEBUG] [l.internal.MaxCulBindingConfigParser] - Part 1/1 -> MEQ1293208
2018-10-20 14:16:02.583 [DEBUG] [.maxcul.internal.MaxCulBindingConfig] - Successfully loaded pairing info for MEQ1293208

Then I tried to set the temperature. There is the error again: Not enough credit after waiting. This is bad. Queued command is discarded.

2018-10-20 14:39:17.882 [DEBUG] [inding.maxcul.internal.MaxCulBinding] - Received command 18 for item valveSetpoint
2018-10-20 14:39:17.890 [DEBUG] [inding.maxcul.internal.MaxCulBinding] - Found config for valveSetpoint
2018-10-20 14:39:27.899 [DEBUG] [ing.maxcul.internal.MaxCulMsgHandler] - Fast Send? false, preambleCredit = 100, requiredCredit = 10, availableCredit = 0, enoughCredit? false
2018-10-20 14:39:27.901 [DEBUG] [ing.maxcul.internal.messages.BaseMsg] - Reconfiguring message to SLOW
2018-10-20 14:39:27.904 [DEBUG] [ing.maxcul.internal.MaxCulMsgHandler] - Added message to queue to be TX'd at Sat Oct 20 14:21:33 CEST 2018
2018-10-20 14:39:27.907 [DEBUG] [ing.maxcul.internal.MaxCulMsgHandler] - Checking credit
2018-10-20 14:39:27.919 [DEBUG] [ing.maxcul.internal.MaxCulMsgHandler] - Fast Send? false, preambleCredit = 100, requiredCredit = 10, availableCredit = 0, enoughCredit? false
2018-10-20 14:39:27.921 [ERROR] [ing.maxcul.internal.MaxCulMsgHandler] - Not enough credit after waiting. This is bad. Queued command is discarded

What is wrong?

Can’t say for sure, because I do not use MaxCUL.
But from the error messages it sounds like the CUL is requested to send to much messages in a period ( the CUL firmware respects the limitation for such devices) and therefor messages are discarded. But that is MY GUESS!

I’ve created pull request which possibly could help #5686

Hey there,

I’m using homegear with homematic-binding instead of MAXCUL, so I’m not aware of issues with that.

You can read the reasons for changing the behavior of requesting the credit report here.
I think, it’s no good idea to request a credit report after every arbitrary command.

Back then I thought about a request, called from MAXUL, to explicitly get the credit report or just send a command and handle “credit errors”.

Unfortunately (or luckily), due to a new job, I haven’t had enough time to look into this back then.

Cheers
Mik

Hi opus,

thanks for the details. I’m currently struggeling as well with the intertechno binding and getting the status updated in Openhab from an intertechno motion sensor.

I get the status from homegear 01=on 00=off. Unfortunately I’m not able to forward this status to Openhab so that I can use it as a trigger. Could you give some advise of what to do in Openhab with intertechno binding to forward the status change to openhab?

12/31/18 17:03:54.167 Intertechno packet received from 01574D6A (RSSI: -73 dBm): 01

In the openhab logs I have also the warning that CUL config is NULL:

2019-01-01 17:23:08.797 [WARN ] [echno.internal.CULIntertechnoBinding] - The address parameter is deprecated! Please use just commandOn and commandOff.
2019-01-01 17:23:08.801 [WARN ] [echno.internal.CULIntertechnoBinding] - type=raw;commandOn=00000FFF0F1;commandOff=00000FFF0F0
2019-01-01 17:23:08.886 [WARN ] [io.transport.cul.CULLifecycleManager] - CUL config is NULL, doing nothing
2019-01-01 17:23:08.894 [INFO ] [ternal.serial.CULSerialConfigFactory] - Update config, baudrate = 38400

Thanks and best regards.

IMHO this is NO PROBLEM!

On the problem with homegear, I can’t help (don’t have such ). Sorry!

1 Like

The PR #5329 breaks all maxcul installations (see [#5753]) because the credit10ms state is not updated anymore on start. It also changes the requestCreditReport method to prevent any race coditions. From my point of few it’s save to merge #5686 to get the old behaviour back without any race conditions. Everybody agrees?

After all issues are fixed we can start a new discussion about it’s better to explicitly get the credit report or just send a command and handle “credit errors”, but for the moment we should recover the old interface.

1 Like