Invalid Status Value

hi,

why is this not working as expected?

Item

Switch    sw_homebb01_eg_kueche_licht    "Licht"    <light>    (grp_homebb01_etage_eg_kueche,grp_homebb01_persistence_mysql)        

Sitemap

Switch item=sw_homebb01_eg_kueche_licht mappings=[0="Aus", 1="Decke", 2="Tisch"]

Rule

rule "eg_kueche_licht"
when
    Item sw_homebb01_eg_kueche_licht changed
then
    //sendHttpGetRequest("http://.../httprequest.php?RO=15&ST=" + sw_homebb01_eg_kueche_licht.state)
    logInfo("kueche licht", "http://.../httprequest.php?RO=15&ST=" + sw_homebb01_eg_kueche_licht.state)
end

Openhab.log

2016-09-04 11:45:38.916 [WARN ] [o.i.r.i.resources.ItemResource] - Received HTTP POST request at 'items/sw_homebb01_eg_kueche_licht' with an invalid status value '0'.
2016-09-04 11:45:39.109 [WARN ] [o.i.r.i.resources.ItemResource] - Received HTTP POST request at 'items/sw_homebb01_eg_kueche_licht' with an invalid status value '1'.
2016-09-04 11:45:39.309 [WARN ] [o.i.r.i.resources.ItemResource] - Received HTTP POST request at 'items/sw_homebb01_eg_kueche_licht' with an invalid status value '2'.

regards

1 Like

I think the problem is with the definition of the item, a Switch can only be ON or OFF, not a numeric value, you need to use Number.

3 Likes

oh oh oh, i see, thanks, it works now.