I tried to close a contact via the console…
… none of these worked…
openhab> smarthome:status Door_Shed_Tower_Roller_East
NULL
openhab> smarthome:send Door_Shed_Tower_Roller_East Closed
Error: Command 'Closed' is not valid for item 'Door_Shed_Tower_Roller_East'
Valid command types are:
RefreshType: REFRESH
openhab> smarthome:send Door_Shed_Tower_Roller_East CLOSED
Error: Command 'CLOSED' is not valid for item 'Door_Shed_Tower_Roller_East'
Valid command types are:
RefreshType: REFRESH
openhab> smarthome:send Door_Shed_Tower_Roller_East OFF
Error: Command 'OFF' is not valid for item 'Door_Shed_Tower_Roller_East'
Valid command types are:
RefreshType: REFRESH
openhab> smarthome:send Door_Shed_Tower_Roller_East 0
Error: Command '0' is not valid for item 'Door_Shed_Tower_Roller_East'
Valid command types are:
RefreshType: REFRESH
openhab> smarthome:send Door_Shed_Tower_Roller_East closed
Error: Command 'closed' is not valid for item 'Door_Shed_Tower_Roller_East'
Valid command types are:
RefreshType: REFRESH
openhab> smarthome:send Door_Shed_Tower_Roller_East 1
Error: Command '1' is not valid for item 'Door_Shed_Tower_Roller_East'
Valid command types are:
RefreshType: REFRESH
openhab> smarthome:send Door_Shed_Tower_Roller_East off
Error: Command 'off' is not valid for item 'Door_Shed_Tower_Roller_East'
Valid command types are:
RefreshType: REFRESH
openhab> smarthome:send Door_Shed_Tower_Roller_East Off
Error: Command 'Off' is not valid for item 'Door_Shed_Tower_Roller_East'
Valid command types are:
RefreshType: REFRESH
the contact is defined as follows (and worked in OH v1):
Contact Door_Shed_Tower_Roller_East "Roller Door East [MAP(en.map):%s]" <door> (gShed_Tower, gShedDoors) {mqtt="<[mymosquitto:ArgyleCourt/Shed/Tower/Rollerdoor/East:state:default]"}
You can’t, they only represent the current state of a device or a property of that device. So for example, you would use a contact for a door sensor, which you can not change via a command. The only way to change the state of a contact is by doing something in the physical world, so opening or closing a door, which is then registered by the sensor, and the status is updated as such.
If the device is something that you can actively control, you should use a Switch, not a Contact.
rule "initialise"
when
System started
then
myContactItem.postUpdate(OPEN)
end
There may be good reasons to do that. Perhaps it’s a virtual Item, with no real binding. Perhaps a real device only reports changes, so you want it initialized at some known state at system startup. Etc.
Commands and updates are different things. Commands sent to an Item get passed to any bindings. Commands need not change the state of that Item immediately, or indeed at all. Updates change the state but do not get passed to bindings.
Contact type Items are unusual in that they have no “output” function, no purpose in passing commands to bindings, by design.