Hello everyone! Openhab newbie here. Could someone please help me out?
I’ve been messing around with Tasmota running on Sonoff’s. Everything has been going good until now. I’m able to switch the Sonoff relay using mqtt. So, I flashed an esp8266-01 with tasmota and hooked a dht22 to the gpio2 pin. Sensor data is showing in the web guy.
I’m trying to publish the data to my openhab2 machine (RaspPi3 with Openhabian) using mqtt. Here is my item and sitemap code…
Number Main_Temp "Main Temp" <temperature> { mqtt="<[OH2:tele/Living_Temp/SENSOR]" }
Text item=Main_Temp label="Living Temp [%.1f °F]"
Could someone kindly inform me on what I’m doing wrong?
After some reading I discovered that the sensor data is in json form. Looking at the events.log… it says something about a configuration error. This is what I have done:
// Test rule for changing JSON String to Number
rule "Convert JSON to Item Type Number"
when
Item Main_Temp_json changed
then
// use the transformation service to retrieve the value
val newValue = transform("JSONPATH", ".$.AM2301.Temperature", Main_Temp_json.state.toString)
// post the new value to the Number Item
Main_Temp.postUpdate( newValue )
end
-events.log-
2018-04-19 00:33:51.055 [thome.event.RuleAddedEvent] - Rule '307fc459-78e2-4c9d-a10f-1eda79deb69a' has been added.
2018-04-19 00:33:51.072 [.event.RuleStatusInfoEvent] - 307fc459-78e2-4c9d-a10f-1eda79deb69a updated: INITIALIZING
2018-04-19 00:33:51.081 [.event.RuleStatusInfoEvent] - 307fc459-78e2-4c9d-a10f-1eda79deb69a updated: UNINITIALIZED (CONFIGURATION_ERROR): Validation of rule 307fc459-78e2-4c9d-a10f-1eda79deb69a has failed! Condition Type "core.ItemStateCondition" does not exist!
2018-04-19 00:33:51.688 [.event.RuleStatusInfoEvent] - 307fc459-78e2-4c9d-a10f-1eda79deb69a updated: INITIALIZING
2018-04-19 00:33:51.693 [.event.RuleStatusInfoEvent] - 307fc459-78e2-4c9d-a10f-1eda79deb69a updated: UNINITIALIZED (CONFIGURATION_ERROR): Validation of rule 307fc459-78e2-4c9d-a10f-1eda79deb69a has failed! Condition Type "core.ItemStateCondition" does not exist!