Items states get update but NO CHANGE!

Hi, I’m new to openHAB and I really enjoy the technology, but I got some problems. When I try to control my things ( Philips hue Lamp) by updating his state with the method below, I can change the state of the Items but I can’t see NO CHANGES with my Light… Can you help me please to solve this problem ?

let stateValue = ‘50’;
fetch ( http://localhost:8080/rest/items/hue_0210_001788285fd9_10_color_temperature/state, {
method: ‘PUT’,
headers: {
‘Accept’: ‘application/json’,
‘content-type’: ‘text/plain’
},
body: stateValue
})

HUE Bulb ? Ikea Bulb ? Osram Bulb?

Philips Hue Bulb

Logfiles ? When to fire up your Command?

why fetch ?

I could also use http PUT Request ( J Query-Ajax) but I found the Fetch API easier, like I said the Request succeded but why the light doesn’t change ?

The Logfiles can tell you more …

log:set LEVEL package.subpackage

https://docs.openhab.org/administration/logging.html

20:33:13.714 [INFO ] [smarthome.event.ItemStateChangedEvent] - hue_0210_001788285fd9_10_color_temperature changed from 61 to 50
20:34:35.015 [INFO ] [smarthome.event.ItemStateChangedEvent] - hue_0210_001788285fd9_10_color_temperature changed from 50 to 40

this is what my Logs are saying. Iam not geting errors, it 's working fine but the Hue Lamp doesn’t changing.
PS: I am using 3rd Part REST API

Set the Logging to Debug of the Bindung… perhaps there you find the Problem

This can be the Problem … is the Value a Percent Type ?
What is wrong with the Build In REST API?

the value should be a string, like the REST API documentation recommand :
curl -X PUT --header “Content-Type: text/plain” --header “Accept: application/json” -d “50” “http://localhost:8080/rest/items/hue_0210_001788285fd9_10_color_temperature/state

Yes … but perhaps a transformation in Background of the RestAPI? I don’t known it… have you checked a command by this API?

this is what my logs are showing:

16:52:08.071 [INFO ] [smarthome.event.ItemStateChangedEvent] - hue_0210_001788285fd9_10_color_temperature changed from 61 to 80
16:52:54.863 [INFO ] [smarthome.event.ItemStateChangedEvent] - hue_0210_001788285fd9_10_color_temperature changed from 80 to 10
16:54:01.183 [INFO ] [smarthome.event.ItemStateChangedEvent] - hue_0210_001788285fd9_10_color_temperature changed from 10 to 5
16:54:38.742 [INFO ] [smarthome.event.ItemStateChangedEvent] - hue_0210_001788285fd9_10_color_temperature changed from 5 to 90

The openHAB Runtime received the changes of the ItemState : - from 61 (%) to 80 (%)
- from 80 (%) to 10 (%)
- from 10 (%) to 5 (%) and so on
BUT my Philips Hue Lamp does NOT change ( It should change the light intensity)

this is what my logs are showing:
16:52:08.071 [INFO ] [smarthome.event.ItemStateChangedEvent] - hue_0210_001788285fd9_10_color_temperature changed from 61 to 80
16:52:54.863 [INFO ] [smarthome.event.ItemStateChangedEvent] - hue_0210_001788285fd9_10_color_temperature changed from 80 to 10
16:54:01.183 [INFO ] [smarthome.event.ItemStateChangedEvent] - hue_0210_001788285fd9_10_color_temperature changed from 10 to 5
16:54:38.742 [INFO ] [smarthome.event.ItemStateChangedEvent] - hue_0210_001788285fd9_10_color_temperature changed from 5 to 90
The openHAB Runtime received the changes of the ItemState : - from 61 (%) to 80 (%)

  • from 80 (%) to 10 (%)
  • from 10 (%) to 5 (%) and so on
    BUT my Philips Hue Lamp does NOT change ( It should change the light intensity)

Thank you ei_Gelb_GeekKevin for your time and reply, I got it ! The Problem is, I was only sending a PUT Request ( what only update the state of my Item) BUT not sending a POST request

1 Like