[Solved - Contact not meant to be switchable] Received HTTP POST request at 'items/DeviceLocked_Living' with an invalid status value 'CLOSED'

  • Platform information:
    • openHAB version: 2.4
  • Issue of the topic:

I am receiving the topic error in the log of OPENHAB, but i am not entirely sure why ? the device should support that value. In the log you can see the value change from OPEN to CLOSED…

  • Please post configurations (if applicable):
    • Items configuration related to the issue
Contact DeviceLocked_Living                 "Bediensperre Wohnen [MAP(lock.map):%s]"      <lock>              (G_Temperature_Lock)    {channel="avmfritz:FRITZ_DECT_301:main:Heat_Living:device_locked"}
  • Sitemap configuration related to the issue
Switch item=DeviceLocked_Living      	visibility=[DeviceLocked_Living==OPEN] 			mappings=[OPEN="offen",CLOSED="gesperrt"]
  • If logs where generated please post these here using code fences:
2018-12-23 13:17:04.031 [vent.ItemStateChangedEvent] - DeviceLocked_Living changed from OPEN to CLOSED
2018-12-23 13:08:20.775 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/DeviceLocked_Living' with an invalid status value 'CLOSED'.
2018-12-23 13:09:14.071 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/DeviceLocked_Living' with an invalid status value 'OPEN'.

Try adding quotes around OPEN in the sitemap visibility and see if that helps.:crossed_fingers:

visibility=[DeviceLocked_Living=="OPEN"] 

Hmm, i think i didnt ask the question precisely… The Problem doesnt occur with the Visibility, that works fine and i also tested Exchanging OPEN for CLOSED and it works the other way around.

But setting the state to OPEN or CLOSED fails, so something must be wrong with the mapping statement at the end, although from the first line in the log you can see that both values exist and are used by the fritz.box interface when i use the setting there. Also in the documentation those values are stated.

Also the visibility option works with both values without quotes, so it must be without quotes. I tried it with quotes and it postet the same problem, looking exactly the same with the syntax.

The item is defined as a Contact, which uses OPEN/CLOSED without the transformation, so please post your lock.map file.

Thanks

Are you trying to command the item through basicui? A POST request to the rest API is for sending commands to items, and contact items don’t support commands, only state updates.

Contact items in basicui is supposed to be read-only, since toggling them sends a command.

hmm, i am not instructing to use the map file, or is that automatically used in mappings[]

it looks like this :

CLOSED=gesperrt
OPEN=offen
NULL=???

actually i am trying to set a status, yes change it from OPEN to CLOSED and back. but how can i switch that state then, do i have to change the Item config itself to switch ?
I know you can switch the state in the fritz box menu… and it got by default inserted as a contact…

the binding docu documents it as a contact as well…

device_locked Contact Device is locked for switching manually (OPEN/CLOSE) - FRITZ!DECT 301,

the state seems to be CLOSED though, since that works for the visibility option…

thx for the help

Contact DeviceLocked_Living                 "Bediensperre Wohnen [MAP(lock.map):%s]"      <lock>              (G_Temperature_Lock)    {channel="avmfritz:FRITZ_DECT_301:main:Heat_Living:device_locked"}

In the item file your using the MAP transformation and in the site map your also using mappings.

If this is an item that can be switched, then your correct, change the item from a contact to a switch. As @pacive mentioned contact items are read only.

After changing to a switch check the logs to verify everything is correct.

Since the channel is defined as a contact by the binding, it is probably not possible to change this through openhab.

thx for the help, i guess it is really not meant to be switched by openhab…

i tried to change it to a switch in the thing config which gave me faults…