cdjackson / HABmin

A web admin console for openHAB home automation
http://www.cd-jackson.com/index.php/openhab/habmin
217 stars 51 forks source link

405 Method not allowed - Adding item in openhab2 #193

Closed abhiklkothari closed 8 years ago

abhiklkothari commented 9 years ago

var param=JSON.stringify({bindings: [{binding: '', config: ' ' }], groups: [], icon: 'Light', label: 'Item1', format: '', units: '', model: 'demo', name: 'Item1', translateRule: 'None', translateService: '', type: 'SwitchItem'});

jQuery.ajax ({ type: "PUT", url:'http://localhost:8080/services/habmin/config/items/Item1', dataType: 'json', async: true,

    contentType: "application/json",
    data: param,

    success: function (response) 
    {

    },
    complete:function(xhr,status)
    {  

    },
    error:function(xhr,status,error)
    {

    },
}).fail(function(payload)
{

});

i have added the habmin jar in addons this call is working with openhab 1.6 but it gives 405 error with openhab2.0

cdjackson commented 9 years ago

I think the config folder location has changed in OH2 so this won’t work at the moment.=