For me, the REST API works well - it shows "state":"20.0 ℃" in the response for such items.
HABpanel doesn’t
I think this is the problem - HABPanel does not yet know how to handle numbers with dimensions - @henning it seems that we have totally missed that part when introducing the quantity types… @ysc Could you investigate how much change it would mean to HABPanel to support those new types? @henning do you have any advice of how the handling should be done best as you changed the Paper UI accordingly?
@chris Same question to you: What would it mean to bring support of Number items with dimension to HABmin?
A rest PUT request will update the item state. That works
A rest POST request (sendCommand) shows this in the log:
2018-06-01 21:50:36.038 [ome.event.ItemCommandEvent] - Item 'House_NestTargetTemperature' received command 21
2018-06-01 21:50:36.044 [vent.ItemStateChangedEvent] - House_NestTargetTemperature changed from 19.0 ℃ to 21.0 ℃
BUT it doesn’t get actioned by the binding and the thermostat stays at 19°C
Sending 21|°C as a command by the rest API results in this:
2018-06-01 21:53:06.624 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/House_NestTargetTemperature' with an invalid status value '21|°C'.
So this is an issue of the binding then and not of the REST API as you can see yourself from the log that it is correctly received through the REST API.
Sending 21|°C as a command by the rest API results in this
Clear, because this is not a valid format (only to be used in scripts).
That’s good news and quite some relief for me @ysc, thanks
Only 21 and 21 °C are valid commands, NOT 21|°C (as I said, this syntax is only used for variables in scripts).
If I see it right, you are using the Nest binding, which is in openhab2-addons, not ESH.
rule "proxy in"
when
Item House_NestTargetProxy received command
then
House_NestTargetTemperature.sendCommand(receivedCommand.toString + "°C")
end
rule "proxy out"
when
Item House_NestTargetTemperature changed
then
House_NestTargetProxy.postUpdate(House_NestTargetTemperature.state as Number)
end
The binding can be modified so it assumes the unit is the same as the unit used for state updates. However when there are several items that each have their own unit the binding does not know about this.
For example:
Number:Temperature Thermostat_SP_C "Set Point [%.1f °C]" { channel="nest:thermostat:9fc91dad:PuNbMpQGIY3hk7Nf8qJh6secrx8nUoq_:set_point" }
Number:Temperature Thermostat_SP_F "Set Point [%.1f °F]" { channel="nest:thermostat:9fc91dad:PuNbMpQGIY3hk7Nf8qJh6secrx8nUoq_:set_point" }
Number:Temperature Thermostat_SP_K "Set Point [%.1f K]" { channel="nest:thermostat:9fc91dad:PuNbMpQGIY3hk7Nf8qJh6secrx8nUoq_:set_point" }