The result should be:
{
“channelUID”: “zwave:device:b6c71408:node13:switch_binary”,
“configuration”: {
“profile”: “system:default”,
expire=“1m,state=OFF”
},
“itemName”: “WaterBoiler_Switch”
}
The result should be:
{
“channelUID”: “zwave:device:b6c71408:node13:switch_binary”,
“configuration”: {
“profile”: “system:default”,
expire=“1m,state=OFF”
},
“itemName”: “WaterBoiler_Switch”
}
Expire profile has not been merged yet, it is still WIP, see
Only solution for now is using the V1.x Expire Binding.
That is what @mjeshurun is using. But he wants to add an expire parameter via REST API.
He has no .items file and created all items via PaperUI. In PaperUI you have to select a profile e. g. “system:default” while linking an item to a channel (+create new item). This is then shown in REST API → GET /links/{itemName}/{channelUID}
As already answered in the following thread, this is not possible without items file
To use the expire v1.x binding, you must create the item in xxx.items file (to be able to link to a 1.x binding)
When you create an Item from xxx.items file, it is treated as “not manageable” from PaperUI , REST API etc.
For some reason, I’m getting an error message when running the PUT, which means the GET /links/{itemName}/{channelUID} doesn’t update with the added expire line in the result.
I don’t know how else we can put it, the “some reason” is that you cannot add a link to a v.1 binding in that way.
No
In fact all your Paper UI items can remain, the items with expire binding can be in a file all by themselves and coexist with your Paper UI created items. Just create unique switch items with expire configuration
here is example
Switch BedtimeTimer { expire="60s,command=OFF" }
ok… I’m going to post my reply… from April 2019…
To use the expire binding you must create a switch item. If creating an item is already over your head, I’ll post link to learn. When the switch is triggered, however long you have configured it to run, then the stuff you coded in happens
Jee whiz… I can’t believe you found that Hans
and for completeness here is link to docs for folks stumbling across this thread in the future
and items files docos
Items are defined using the following syntax:
itemtype itemname "labeltext [stateformat]" <iconname> (group1, group2, ...) ["tag1", "tag2", ...] {bindingconfig}
itemtype
and itemname
are mandatoryThanks!
After I create the .items file with the expiry info how do I connect those items to specific things?
because PAPERUI doesn’t show the items listed in the .items file.
Do I need to use HABmin for that?
Please show us your items file.
I started with a test of one item till i get things working. Then I’ll add the other items that require Expire.
Switch WaterBoiler_Switch “Water Boiler” “Switchable” {zwave=“13”, expire=“1m,command=OFF” }
// vim: syntax=Xtend
This cannot work, as you are using V1 syntax for zwave and wrong tagging. Please try
Switch WaterBoiler_Switch "Water Boiler" [ "Switchable" ] { channel="zwave:device:b6c71408:node13:switch_binary", expire="1m,command=OFF" }
To link a file based Item to a channel of a Thing, whether it is a PaperUI creatd Thing, or a xxx.things file based Thing, you edit the channel UID (“name”) into the Item definition.
Examples at bottom of doc -
You’ll need to use keyword channel=
of course
and you’ll need to UID, which you either defined yourself in a xxx.things file or you can read off from PaperUI
Jackpot! This worked!!!
Many thanks to all of you for your patience and for teaching me something new
I’m facing a strange behavior with this switch and the expire command, and I could use your help.
When I’m running the expire command exactly as you wrote it, my water heater switch stops working automatically after 1m, but when I tried to change the expire time to 30m, 45m or 1h, the expire command did not automatically turn off the water heater switch.
The thing is I added two more switches to the .items file and their expire time work properly for 30m, 45m, and 1h.
Is there a special reason the water heater switch would not work (while the two other works)?
Here is my current .items files:
Switch Bathroom_Switch1 "Bathroom Fan" [ "Switchable" ] { channel="zwave:device:b6c71408:node6:switch_binary1", expire="30m,command=OFF" }
Switch Bathroom_Switch3 "Bathroom Heater" [ "Switchable" ] { channel="zwave:device:b6c71408:node6:switch_binary3", expire="30m,command=OFF" }
Switch WaterBoiler_Switch "Water Boiler" [ "Switchable" ] { channel="zwave:device:b6c71408:node13:switch_binary", expire="30m,command=OFF" }
// vim: syntax=Xtend
No special reason. The expire binding is v1.x , and so not very good at picking up in-flight edits. Be sure to restart the binding or system to pick up changes.
Unfortunately, a complete Raspberry pi restart did not solve the water boiler expire issue.
The two other switches in my expire .items list are working properly based on the expire rules – and they worked properly also before the restart.
There’s something amiss with your setup. What are you going to do about it?
Check carefully for Items with duplicate names in all your xxx.items
files.
Presuming you are editing remotely, be sure your file editor is saving files, saving them with the correct extension, and saving them in the right folder. See next para for a proof.
Look in your openhab.log for Loading model 'xxx.items'
messages, and make sure your files load error free.
On occasion, people get into trouble with an Item created in both PaperUI and xxx.items
file. That can be difficult to sort out - simple deletion doesn’t do it. The simplest workaround is to choose a new Item name altogether.
After running a few tests and double checks I can confirm this method fixed the problem.
Thanks again for your help and patience