openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
923 stars 424 forks source link

Unknown ``ConfigStatusInfoEvent`` #3114

Open spacemanspiff2007 opened 2 years ago

spacemanspiff2007 commented 2 years ago

A HABApp user receives ConfigStatusInfoEvent which gets logged by HABApp as an error. The docs show nothing about this event and even after looking at the code it's still a mystery to me. I tried reproducing the event by changing the thing config of an astro thing and a network thing but changing a parameter there only generates a ThingStatusInfoEvent.

When does this event get sent and what is its purpose? What are the allowed values for type and what do they indicate?

Event

{
  "topic": "openhab/things/zwave:device:gehirn:node29/config/status",
  "payload": {
    "configStatusMessages": [
      {
        "parameterName": "config_11_2",
        "type": "PENDING"
      }
    ]
  },
  "type": "ConfigStatusInfoEvent"
}
J-N-K commented 2 years ago

I don't think that unknown events should be logged as an error. If you look here you even find documentation about custom events, so it's expected that some components might create events that are not known to others.

wborn commented 2 years ago

The docs show nothing about this event and even after looking at the code it's still a mystery to me.

For the full list of events and their JavaDocs see:

https://www.openhab.org/javadoc/latest/org/openhab/core/events/event

Seems like you are missing quite a few in:

https://github.com/spacemanspiff2007/HABApp/blob/master/src/HABApp/openhab/map_events.py

spacemanspiff2007 commented 2 years ago

Thanks for your input. I am logging an error because HABApp is using class instances on the internal event bus. If the event type is unknown it means

I am aware that there are more events in openHAB than there are currently in HABApp supported. That's why a filter is used when subscribing to the events. The currently used default is:

openhab/items/*,openhab/channels/*,
openhab/things/*/added,openhab/things/*/removed,openhab/things/*/status,openhab/things/*/statuschanged

With that filter I should never see the custom events and never see the missing events from the JavaDocs. Or do I have a wrong understanding on how the filter works?


I looked at the JavaDocs and the Code and for me it's still unclear what this event does and why it gets emitted. Who could have more knowledge about it?

spacemanspiff2007 commented 2 years ago

Possible values for type are:

PENDING seems to be the case if it's a battery powered device and the parameter can not be written immediately. What the other values symbolize is unclear.

wborn commented 2 years ago

I have a few links for you, if you are interested in "the making of ConfigStatusInfoEvent":

If you want to see it in action, try any binding that uses a ConfigStatusThingHandler like zwave, enocean, smartthings or venstarthermostat.

spacemanspiff2007 commented 2 years ago

Thank you for the links. I've read through them and I think the intention behind is clear now. However some questions still remain.

  1. I've tried to change a configuration parameter on a battery powered z-wave device (wake up interval 24h). I get the ConfigStatusInfoEvent with type PENDING when I change the parameter as expected. However I do not get an event when the value has been actually written to the device. I would have expected e.g. a ConfigStatusInfoEvent with type INFORMATION

  2. For me it's still not clear when WARNING, INFORMATION and ERROR gets emitted

  3. I change the parameter and change it back to the original immediately. The parameter still shows Pending when in fact it matches with the value from the device. Since it was always asleep no change could have happened and the thing should not show PENDING.

  4. It's very confusing that I have to query /thing/{thingUID} and afterwards /thing/{thingUID}/config/status. Imho a much better solution would have to integrate this directly into the thing config, e.g.

    "configuration": [ {
    "name": "config_42",
    "value": 15,
    "newValue": 16,
    "newValueStatus": "PENDING",
    }]

    with newValue and newValueStatus being optional