[SOLVED] Setup innogy SmartHome Button - one item linked to channels button1 and button2

Hi,

I’m trying to configure an innogy SmartHome Button.
I would like to create one item called ‘SmartHome Button’ which is linked to the channels button1 and button2 of the thing ‘WSC2: Wohnzimmer Smart Switch (Living room)’.

I’m using the version openhab2 / 2.3.0-1 together with the PaperUI.

Thanks!

What have you tried and what was the result?

Theoretically it should be possible but maybe not through PaperUI.

Typically you would create the Item. Then link the Item to each channel, one at a time.

In the first step I’ve created the following item:

But I’m not sure which type I should use: Switch, Contact, Text,
I’ve tried different types but I’m not able to link the channel to this item.

The item selection is always empty.

Thing details:

  {
  "statusInfo": {
    "status": "ONLINE",
    "statusDetail": "NONE"
  },
  "editable": true,
  "label": "WSC2: Wohnzimmer Smart Switch (Living room)",
  "bridgeUID": "innogysmarthome:bridge:036a58f0",
  "configuration": {
    "id": "22e09f2e674d4fd1aa5207a12250bec2"
  },
  "properties": {
    "serialNumber": "914130034233",
    "Time of discovery": "May 16, 2018 12:40:40 PM",
    "Version": "1.0",
    "vendor": "RWE",
    "Battery powered": "yes",
    "Device Type": "Radio",
    "id": "22e09f2e674d4fd1aa5207a12250bec2",
    "Time of acceptance": "May 16, 2018 12:41:06 PM",
    "Location": "Living room"
  },
  "UID": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2",
  "thingTypeUID": "innogysmarthome:WSC2",
  "channels": [
    {
      "linkedItems": [],
      "uid": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button1",
      "id": "button1",
      "channelTypeUID": "system:button",
      "kind": "TRIGGER",
      "label": "Button",
      "defaultTags": [],
      "properties": {},
      "configuration": {}
    },
    {
      "linkedItems": [],
      "uid": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button2",
      "id": "button2",
      "channelTypeUID": "system:button",
      "kind": "TRIGGER",
      "label": "Button",
      "defaultTags": [],
      "properties": {},
      "configuration": {}
    },
    {
      "linkedItems": [],
      "uid": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button1_count",
      "id": "button1_count",
      "channelTypeUID": "innogysmarthome:PushButtonCounter",
      "itemType": "Number",
      "kind": "STATE",
      "label": "Button pushed count",
      "description": "The count of button pushes.",
      "defaultTags": [],
      "properties": {},
      "configuration": {}
    },
    {
      "linkedItems": [],
      "uid": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button2_count",
      "id": "button2_count",
      "channelTypeUID": "innogysmarthome:PushButtonCounter",
      "itemType": "Number",
      "kind": "STATE",
      "label": "Button pushed count",
      "description": "The count of button pushes.",
      "defaultTags": [],
      "properties": {},
      "configuration": {}
    },
    {
      "linkedItems": [],
      "uid": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:battery_low",
      "id": "battery_low",
      "channelTypeUID": "system:low-battery",
      "itemType": "Switch",
      "kind": "STATE",
      "label": "Low Battery",
      "defaultTags": [],
      "properties": {},
      "configuration": {}
    }
  ]
}

It may be that you cannot do this through PaperUI. You will have to create the Item in a .items file or create a proxy Item and Rule to synchronize the two Item linked to the channels.

I was able to create two Items linked to the channels of the Thing via the REST API. (don’t know why PaperUI is not able to do this)

PUT /items
[
  {
    "type": "String",
    "name": "WSC2WohnzimmerSmartSwitchLivingRoom_Button1",
    "label": "Wandschalter Wohnzimmer Button1",
    "category": "Button",
    "tags": [],
    "groupNames": []
  }
]

PUT /links/{itemName}/{channelUID}
{
  "itemName": "WSC2WohnzimmerSmartSwitchLivingRoom_Button1",
  "channelUID": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button1",
  "configuration": {}
}


PUT /items
[
  {
    "type": "String",
    "name": "WSC2WohnzimmerSmartSwitchLivingRoom_Button2",
    "label": "Wandschalter Wohnzimmer Button2",
    "category": "Button",
    "tags": [],
    "groupNames": []
  }
]

PUT /links/{itemName}/{channelUID}
{
  "itemName": "WSC2WohnzimmerSmartSwitchLivingRoom_Button2",
  "channelUID": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button2",
  "configuration": {}
}

But the following state change of the channel is not automatically synced to the Items. Why?
Maybe a wrong Item type? Which Item type do I have to use for this PRESSED event?

{"topic":"smarthome/channels/innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button1/triggered","payload":"{\"event\":\"PRESSED\",\"channel\":\"innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button1\"}","type":"ChannelTriggeredEvent"}

Do I have to create a Rule for each Item to synchronize the two Items?
Please can you give me an example of such a Rule?

There must be an easier way for creating an Item for a SmartHome switch!?

The Item type required for each Channel is identified next to the Channel in PaperUI.

image

In the above screen shot, Heartbeat and Smoke must be linked to a Switch Item. Battery Level must be linked to a Number Item.

Possibly.

Linking two Channels to one Item is a rare occurrence. This thread is the first one I’ve encountered where anyone has attempted it.

Typically one has one Channel linked to on Item. If a command sent or received on one Item needs to trigger some other device to do something, that is done through Rules.

Okay this might be the problem here. PaperUI does not show any Type next to the Channel.

And that’s correct based on the REST API these channels do not have a Type.
But the Thing has two more Channels button1_count and button2_count, which are not shown by PaperUI. If they were shown, then it should be possible to create an Item link to the channels.

"UID": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2",
"thingTypeUID": "innogysmarthome:WSC2",
"channels": [{
		"linkedItems": [],
		"uid": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button1",
		"id": "button1",
		"channelTypeUID": "system:button",
		"kind": "TRIGGER",
		"label": "Button",
		"defaultTags": [],
		"properties": {},
		"configuration": {}
	}, {
		"linkedItems": [],
		"uid": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button2",
		"id": "button2",
		"channelTypeUID": "system:button",
		"kind": "TRIGGER",
		"label": "Button",
		"defaultTags": [],
		"properties": {},
		"configuration": {}
	}, {
		"linkedItems": [],
		"uid": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button1_count",
		"id": "button1_count",
		"channelTypeUID": "innogysmarthome:PushButtonCounter",
		"itemType": "Number",
		"kind": "STATE",
		"label": "Button pushed count",
		"description": "The count of button pushes.",
		"defaultTags": [],
		"properties": {},
		"configuration": {}
	}, {
		"linkedItems": [],
		"uid": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button2_count",
		"id": "button2_count",
		"channelTypeUID": "innogysmarthome:PushButtonCounter",
		"itemType": "Number",
		"kind": "STATE",
		"label": "Button pushed count",
		"description": "The count of button pushes.",
		"defaultTags": [],
		"properties": {},
		"configuration": {}
	}, {
		"linkedItems": [],
		"uid": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:battery_low",
		"id": "battery_low",
		"channelTypeUID": "system:low-battery",
		"itemType": "Switch",
		"kind": "STATE",
		"label": "Low Battery",
		"defaultTags": [],
		"properties": {},
		"configuration": {}
	}
]

So how can we fix this and tell PaperUI to show these two Channels button1_count and button2_count?
(maybe it’s because of the custom channelTypeUID - innogysmarthome:PushButtonCounter)

That was my misunderstanding. I was able to create an Item for each Channel. You are right, it makes no sense to have one Item for two Channels in this case.

Here are the REST API calls to link the two hidden Channels to new Items:

PUT /items
[
  {
    "type": "Number",
    "name": "WSC2WohnzimmerSmartSwitchLivingRoom_Button1",
    "label": "Wandschalter Wohnzimmer Button1",
    "category": "Button",
    "tags": [],
    "groupNames": []
  }
]

PUT /items
[
  {
    "type": "Number",
    "name": "WSC2WohnzimmerSmartSwitchLivingRoom_Button2",
    "label": "Wandschalter Wohnzimmer Button2",
    "category": "Button",
    "tags": [],
    "groupNames": []
  }
]

PUT /links/WSC2WohnzimmerSmartSwitchLivingRoom_Button1/innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button1_count
{
  "itemName": "WSC2WohnzimmerSmartSwitchLivingRoom_Button1",
  "channelUID": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button1_count",
  "configuration": {}
}

PUT /links/WSC2WohnzimmerSmartSwitchLivingRoom_Button2/innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button2_count
{
  "itemName": "WSC2WohnzimmerSmartSwitchLivingRoom_Button2",
  "channelUID": "innogysmarthome:WSC2:036a58f0:22e09f2e674d4fd1aa5207a12250bec2:button2_count",
  "configuration": {}
}

How were these Things created? Did you auto-discover them or did you write them by hand in a .things file? What you quote looks like it was auto-discovered.

I don’t know this binding but having no Type I’m sure is the root of your problem. I don’t think I’ve ever seen that before.

I pretty much exclusively use autodiscovery for Things and I’ve never had a problem like this so I don’t really know how to fix it. If these Things were auto-discovered I’d suspect there is a bug in that binding. It should be generating Channels without a Type, unless there is something I don’t know. You might want to file an issue on the binding in the openhab2-addons repo (I think that is where this is maintained).

Sorry guys for the late reply.

The “Button” channels are trigger channels that by design cannot be bound to an item, but used in rules:

rule "Button fired..."
when
    Channel 'innogysmarthome:WSC2:mybridge:myPushButton:button1' triggered PRESSED
then
    ...
end

I should add this to the binding docs as an example…

But the Button Channels button1_count and button2_count should be available right?

Yes, they are marked as advanced and thus hidden behind the „show more“ button in the PaperUI channels list.