OpenHab 2 MQTT send 0.00 but open hab report error value

Hi, I have simple problem, I send 0.00 value over mqtt to openhab item, but open hab said

2017-07-06 00:55:31.654 [WARN ] [] - given new state is NULL, couldn't post update for 'Internal_Pwm'

but if I send 1 od 20 … open hab works

Number Internal_Pwm "Box pwm [%.2f %%]" <temperature> (Pwm,GF_Livingroom) {mqtt="<[mosquitto:openhab/internal/pwm:state:default]"}

There is likely a space before it after the number. To be parsable, the string from mqtt must contain a valid number with no white space or extraneous characters.

Hi, I copy another working part of code where I sending temperatures.

2017-07-06 10:08:04.119 [ItemStateChangedEvent     ] - Hall_Temp changed from 25.75 to 25.62

There is no white spaces. But OpenHAB2 takes 0 (zero) asi NULL, but for me is’t correct value.

2017-07-06 10:08:03.754 [WARN ] [] - given new state is NULL, couldn't post update for 'Internal_Pwm'
Number Internal_Temp "Box teplota [%.2f °C]" <temperature> (Temperature,GF_Livingroom) ["CurrentTemperature"] {mqtt="<[mosquitto:openhab/internal/temperature:state:default]"}
// Number Internal_Pwm "Box pwm [%.2f %%]" <temperature> (Pwm,GF_Livingroom) {mqtt="<[mosquitto:openhab/internal/pwm:state:default]"}
Number Internal_Pwm "Box pwm [%d %%]"  (Pwm,GF_Livingroom) {mqtt="<[mosquitto:openhab/internal/pwm:state:default]"}

Wow realy … white space before number!

Thank for help!

I’m not sure if you are still having a problem with this. The error “given new state is NULL” is the error you get when the passed in message cannot be parsed.

It really does seem there is white space in the string.

1 Like

Hi, I found bug and white space :slight_smile: now is already works.

Thank You!