Need help to debug a stupid problem (events in json)

I have defined several events (in eventList2) in particular these 2 ones:

{ "id": 3, "label": { "lang_tag": "panic_state", "text": "Panic state" }, "serviceId": "urn:upnp-org:serviceId:SecurityRemote1", "argumentList": [ { "id": 1, "dataType": "boolean", "defaultValue": "0", "allowedValueList": [ { "End panic": "0", "HumanFriendlyText": { "lang_tag": "is_end_panic", "text": "End of panic state for _DEVICE_NAME_" } }, { "Panic": "1", "HumanFriendlyText": { "lang_tag": "is_panic", "text": "Panic state for _DEVICE_NAME_" } } ], "name": "PanicStatus", "comparisson": "=", "prefix": { "lang_tag": "which_panic_state", "text": "Which panic state" }, "suffix": {} } ] }, { "id": 5, "label": { "lang_tag": "a_device_is_turned_on_off", "text": "A device is turned on or off" }, "serviceId": "urn:upnp-org:serviceId:SwitchPower1", "argumentList": [ { "id": 1, "dataType": "boolean", "defaultValue": "1", "allowedValueList": [ { "Off": "0", "HumanFriendlyText": { "lang_tag": "hft_device_turned_off", "text": "_DEVICE_NAME_ is turned off" } }, { "On": "1", "HumanFriendlyText": { "lang_tag": "hft_device_turned_on", "text": "_DEVICE_NAME_ is turned on" } } ], "name": "Status", "comparisson": "=", "prefix": { "lang_tag": "which_mode", "text": "Which mode" }, "suffix": {} } ] }

The second one is just a copy of an event from the binary light device. The first one is a copy of the second one I have adjusted for my own need.

The problem: when I create a new scene and add a new trigger, all the events are correctly listed but when I select the third (Panic state), the next fields are not displayed. The fifth event works perfectly.
So what’s wrong in my event definition ?

Here is the definition of the static variable:

<stateVariable sendEvents="yes" allowRepeats="yes"> <name>PanicStatus</name> <dataType>boolean</dataType> <defaultValue>0</defaultValue> </stateVariable>

This is the format I have in the Weather Plugin: 480 "allowedValueList" : [ 481 { 482 "value": "Chance of Showers", 483 "HumanFriendlyText": { 484 "lang_tag": "hft_chance_of_showers", 485 "text": "_DEVICE_NAME_: Condition is 'Chance of Showers'" 486 } 487 },

with “[tt]value[/tt]” being the way to convey the return value.

Your example looks like a hybrid between [tt]eventList[/tt] and [tt]eventList2[/tt] styles.

BTW: Is [tt]urn:upnp-org:serviceId:SecurityRemote1[/tt] a standard UPnP Spec service? I haven’t seen that one before.

[quote=“guessed, post:2, topic:172604”]This is the format I have in the Weather Plugin: 480 "allowedValueList" : [ 481 { 482 "value": "Chance of Showers", 483 "HumanFriendlyText": { 484 "lang_tag": "hft_chance_of_showers", 485 "text": "_DEVICE_NAME_: Condition is 'Chance of Showers'" 486 } 487 },

with “[tt]value[/tt]” being the way to convey the return value.

Your example looks like a hybrid between [tt]eventList[/tt] and [tt]eventList2[/tt] styles.[/quote]

I will try with “value” but note that my example is exactly what is done by MCV for the BinaryLight1 device and it works.

I have “eventList” and “eventList2” in my JSON file, I will try to suppress eventList in case that would be the reason.

BTW: Is [tt]urn:upnp-org:serviceId:SecurityRemote1[/tt] a standard UPnP Spec service? I haven't seen that one before.

No, it is something new I have created for the RFXtrx plugin to handle alarm security remotes.

[quote=“lolodomo, post:3, topic:172604”][quote=“guessed, post:2, topic:172604”]This is the format I have in the Weather Plugin: 480 "allowedValueList" : [ 481 { 482 "value": "Chance of Showers", 483 "HumanFriendlyText": { 484 "lang_tag": "hft_chance_of_showers", 485 "text": "_DEVICE_NAME_: Condition is 'Chance of Showers'" 486 } 487 },

with “[tt]value[/tt]” being the way to convey the return value.

Your example looks like a hybrid between [tt]eventList[/tt] and [tt]eventList2[/tt] styles.[/quote]

I will try with “value” but note that my example is exactly what is done by MCV for the BinaryLight1 device and it works.

I have “eventList” and “eventList2” in my JSON file, I will try to suppress eventList in case that would be the reason.

BTW: Is [tt]urn:upnp-org:serviceId:SecurityRemote1[/tt] a standard UPnP Spec service? I haven't seen that one before.

No, it is something new I have created for the RFXtrx plugin to handle alarm security remotes.[/quote]

It is best to use a different service id then that of upnp-org. For example use lolodomo-com or something in that nature. Upnp-org should be kept to the standards that were created by upnp.

  • Garrett

[quote=“garrettwp, post:4, topic:172604”]It is best to use a different service id then that of upnp-org. For example use lolodomo-com or something in that nature. Upnp-org should be kept to the standards that were created by upnp.

  • Garrett[/quote]

In this case, I would have to redefine all the device types and services ids I defined in the plugin…
Will it be transparent for users having already devices created by the plugin and loading a new version of the plugin with different device type and service id ?

I could use rfxcom.com rather than lolodomo.com, no ?

If you change a deviceType then the corresponding device is recreated next time you do a luup.chdev.*. Changing the services that you implement doesn’t cause he device to get recreated (deviceId doesn’t change) but any serviceVariables its storing will need to be recreated (if it has any) since the service name is part of the key for a variable.

Ok. In this case, I will change only the new device (in fact what is not yet released).

I finally discovered what was wrong. In my allowedValueList, I have to replace

"End panic": "0",

by

"EndPanic": "0",

Space is not allowed.

Many, Many thanks for this thread, i’m exactly on the same kind of problem on a new plugin, and it seem’s that it also solve my problem !

I think i forget to create the static variable

Status boolean 0

Unfortunately, I now encounter what is probably a MCV bug: the event is not repeated.
When I compare with a working repeated event, there are two differences:

  • ui2 type vs boolean type
  • without vs with a list of allowed values

Before stopping yesterday, I tried with no success: ui2 type + value list.
So the problem could be due to the use of an allowed value list.

To be continued…