the JS file in in transform folder i tried it with and without typecast to string
(function(x) {
var result;
result = "{ \"current_heating_setpoint\": " + String(input) + " }";
return result;
})(input)
If I change the Setpoint in the eventlog it logs fine the select value is set and shown in the gui but as i checked the thermostat the value was not setted.
2019-11-03 21:22:06.639 [ome.event.ItemCommandEvent] - Item 'ThermosLi_Setpoint' received command 24.0
2019-11-03 21:22:06.762 [nt.ItemStatePredictedEvent] - ThermosLi_Setpoint predicted to become 24.0
2019-11-03 21:22:06.763 [vent.ItemStateChangedEvent] - ThermosLi_Setpoint changed from NULL to 24.0
If i check zigbee2mqtt log I found:
11/3/2019, 9:22:06 PM - error: No converter available for 'state' (JS:setTempThermostat.js)
So it seems the js script was not executed and just passed as string
JavaScriptTransformation is installed.
i almost got the same problem. I use the 2.4 binding and need to send also the “current_heating_setpoint: xy” If i understand it, i need to configurate a converter. But this is not the same like transform? So I can not use the script from above?
First tried { “current_heating_setpoint”:"%.1f " }" now, but didnt work Just send the information like: “30” but not in JSON.
From your screenshot, you ended with a quote mark but did not begin with a quote mark. I do not know if it needs them, but they should be used in pairs.
" In order to parse the messages of your zigbee device we need to add converter(s) to node_modules/zigbee-shepherd-converters/converters/fromZigbee.js ."
No converter was required at the zigbee2mqtt end. The erroneous use of formatBeforePublish= in the openHAB Thing resulted in the literal string "JS:setTempThermostat.js" being sent to it. It’s in the thread title.