If logs where generated please post these here using code fences:
Traceback (most recent call last):
File “./xxxx.py”, line 33, in
BoilerTemperature.command(58.5)
File “/usr/local/lib/python3.5/dist-packages/openhab/items.py”, line 128, in command
self._validate_value(value)
File “/usr/local/lib/python3.5/dist-packages/openhab/items.py”, line 88, in _validate_value
raise ValueError()
ValueError
Don’t know what is wrong - if I change the item type to Number it works.
Thanks for support
GeorgJ
I am a bit baffled inspite of the full description of your system, as it is not clear to me what actually is not working.
Is your python generating errors? or is that diligently sending the data but is openHab not understanding it…unless you “make it a numbertype” (where? in Python? in OpenHab?)
You probably have your reasons not to make it a number, but sometimes if you send a number as a string via MQTT and it has a leading or trailing space…openhab may have difficulty changing it back to a number.
Could it be that the value you are getting in- and sending from python has leading/trailing spaces?
Thanks Kees!
Python is sending the error message - if I use “just” a Number-type item (in openHAB) it works perfectly.
The Number:Temperature-type item (in openHAB) are not accepted in python or I didn’t find the right format to update the item. As from the error message it seems to be some validation error.
GeorgJ
Sorry, for the confusion:
I want to update a Number:Temperature-type item from python via REST API - which is not working.
If you “get” the item in python from openhab (BoilerTemperature = openhab.get_item(‘BoilerTemperature’)) everything is okay and works perfect. I am looking for the right syntax to send the information back - if this is working at all. @sim0nx: Georges, since you have written the openhab module could you please have a look. Maybe the Number:Temperature items are not validated correctly. If one updates the item via bash/REST API it works fine. Thanks for a hint.