I have a Fibaro multisensor that reports temperature and light and I would like to push that data to my MQTT server so I can store values in my database.
My MQTT connection seems to be working, I get published data in my eventlog. But I want to publish to the topic. Almost all tutorials I find is either taking data from MQTT into OpenHAB or sending ON/OFF commands. The rule part of what I want to do is something like this:
rule "Send temperature to mqtt"
when
Item Sensor1Temperature received command
then
MQTT_data.sendCommand("temperature,sensor=DiningRoom value=<sensordata> <timestamp in epoch>")
end
MQTT_data is my channel for MQTT defined as this:
String MQTT_data "MQTT to influx" {channel="mqtt:systemBroker:LocalMQTT:tempData"}
The Sensor1Temperature is defined as this in my .things file and works fine
Sorry for slow response, haven’t had the time this week have a look at this.
The MQTT Action looks promising, I will give it a try.
The InfluxDB presistance module is probably not what I want, the sensor readings will end up in Grafana in the end so I want to properly format the data.