Possible error when config has default and is required

I’m troubleshooting an issue, and I think I have isolated it to when a config parameter is required and also has a default value.

The binding I’m working on is the Konnected biding, but I don’t think this is specific to this binding. This binding makes the user add channels. The thing-types.xml contains channels with configuration parameters that have a default, but are also required. Whenever I add a channel with the default value, the biding gets disposed and the UI displays the following message: “HANDLER_CONFIGURATION_PENDING {zone=The parameter is required.}”. Once that happens, nothing really works until I delete the zone with the default value.

I can create a channel with a non-default value, and then change it to the default value without any issues.

Sounds like the config description is wrong. If there is a default value, the parameter is not required.

Thanks. I assume you mean that it should not be configured as required if there is a default?

Removing the default makes it work, and I’ll probably do that.

I had the same problem,

When looking at the code tab in the thing configuration it was missing the zone number despite that being configured. No time to find out why but I just added it manually as below and all is fine now.

Not had this with any of my other konnected modules. Not sure if this is because I am up to 3 pro modules now.

    configuration:
      zone: "1"
      onvalue: "1"

Can you elaborate a bit? I’m assuming you are talking about the channel configuration under the thing?

The zone should be required for a channel. I may have had a default value in the past (I don’t have the git repo on this computer to check), but it does not make sense to me to have a default. The onvalue parameter should have a default (and not set as required).

I’m not aware of any issues with running multiple pro modules. I was testing with a pro and a wifi module. I’m about to add a 2nd pro module to my actual alarm setup, but I don’t have 3 to test with.

Did you recently update to the official v3 binding? I did a few changes that were not backward compatible to the konnected binding in v3 while adding support for the pro boards.

Hi,

I’ve played around with this and here are my findings

When you go in and add a new channel, Zone 1 is the default.

If you add the channel but don’t change the default zone (because you want zone 1), it adds it OK but without any zone number.

Here is the code from the Code tab:
You can see it is missing the zone: part

channels:
  - id: SolarPanels
    channelTypeUID: konnected:switch-pro
    label: Solar Panels
    description: ""
    configuration:
      onvalue: "1"

If you configure another channel and change the default zone with the GUI it works fine.

The same issue occurs if you don’t change the default On Value either

I am using the 3.4.2 binding.

When I say “default”, I mean a provided default in the binding. I think you may used it refer to the value selected when adding the channel in the UI.

There is no default provided for switch-pro:

I did notice that there are some channel types that are missing the required label, but switch-pro is not one of them.

This is weird. I don’t see any issues with the bindings channel definition related to this. This is a required field, but the the UI behaves like it has a default.

Did you use to run the binding from @volfan6415? It had a default zone of value 4.

It may be worth deleting the thing are recreating it.

FYI: While UI configuration is fully supported, I find it much easer to configure the konnected things in text files.

Out of curiosity, what are you using the konencted panel for related to solar panels?

Hi,

When adding a new zone, it gives the following:

If I don’t click the Zone Number because I want Zone 1 then when the channel is created it doesn’t have a zone number set. Same for On Value.
Easily fixed in the code tab but not obvious!

I don’t think I used the binding from volfan6415.
Curiously though, the biding doesn’t show in my list of installed bindings but I had problems when I installed this and manually installed the binding so that might be the reason.

Solar panels: this is just another zone for my home alarm system that I created in OH.
My panels are ground mounted so easily stolen so I have a loop of very thin wire through the frames of the panels, you’d have to break the wire to steal the panels and therefore set off the alarm.

I do have my inverter and smart meter in openhab with plans to write an algorithm to monitor power creation, power usage, battery state etc and do things like heat my water or charge my EV when I am generating an excess of power. I haven’t done anything with this yet as my batteries are on back order although I have confirmed I can collect the data I need via OH.