openhabian (i.e. RaspberryPi)
openHAB 2.5.0~S1507-1 (Build #1507)
I mqtt.things:
Bridge mqtt:broker:redpi_mqtt_broker [ host="****", secure="AUTO", username="***", password="***" ]
{
Thing topic thermostat1 "Thermostat 1" {
Channels:
Type string : temperature1 "Temperature One" [ stateTopic="tstat1/temperature"]
Type string : setpoint "Set point" [ commandTopic="tstat1/setpoint"]
Type string : humidity1 "Humidity One" [ stateTopic="tstat1/humidity"]
Type string : request "tstat request" [ stateTopic="tstat1/request"]
}
And .items:
String mqtt_tstat1_temp "[%s]" {channel="mqtt:topic:redpi_mqtt_broker:thermostat1:temperature1"}
Number:Temperature ms6_temperature "MS6 Temperature [%.1f °F]" {channel="zwave:device:16500637f6a:node17:sensor_temperature"}
Number:Temperature ms6_temp_short "Stuff1 [%.1f]" (roomtemps) {channel="zwave:device:16500637f6a:node17:sensor_temperature"}
mqtt_tstat1_temp and ms6_temp_short are presisted in influxdb.
I have not been able to get mqtt_tstat1_temp to show in a Grafana chart.
I’m guessing because it is persisted as a string.
There may be a way to do the conversion in grafana…but, I’m not savy grafana.
I’m thinking the right way is to make an item that is the number represented by the mqtt_tstat1_temp string and persist it instead.
I tried adding another item:
String mqtt_tstat1_temp "[%s]" {channel="mqtt:topic:redpi_mqtt_broker:thermostat1:temperature1"}
Number mqtt_tstat1_tempnum "[%.1f]" {channel="mqtt:topic:redpi_mqtt_broker:thermostat1:temperature1"}
But that didn’t seem to populate…
I could do it with a rule and every time mqtt_tstat1_temp changed postUpdate to a simple number item.
But, is that the best way?