KidSquid
(The Squid)
October 1, 2018, 5:48am
1
I’m having difficulty getting a value into OH from an PSI sensor that I’ve built.
Here’s what I have done.
Utilized ESPEasy to connect to the sensor and broadcast back the data to OH.
Using MQTT Spy and MQTT Box I have subscribed to the topic and I can see data coming in.
Currently the data is comming in as a negative value ex: -350.00, -329.00, -305.00 etc.
The item looks like this…
Number poolpump_psi "DE Filter PSI [%.1f]" {mqtt="<[broker:Pressure_Sensor/PSI_Sensor/PSI:state:REGEX((.*?))]"}
Simple Sitemap
Text item=poolpump_psi
This is what I see on my sitemap:
Just the - sign
I’ve tried different transformations and nothing seems to work…
What am I missing???
Sample MQTT message
<MqttMessage id="180" timestamp="1538371910558" topic="/Pressure_Sensor/PSI_Sensor/PSI" qos="0" retained="false">-329.00</MqttMessage>,
Squid
KjetilA
(Kjetil Asdal)
October 1, 2018, 5:57am
2
It looks like the MQTT message is sent to a topic with a leading slash (*), however, your item is setup to subscribe to the topic without the leading slash. If possible, try removing the leading slash from the publisher (your ESPEasy device). Alternatively, try to add it to the subscriber (openHAB).
(*) Although fully compliant to the “MQTT specification”, I believe most sources recommends to not use a leading slash in your MQTT topics.
vzorglub
(Vincent Regaud)
October 1, 2018, 6:40am
3
Correct, it adds a layer to the topics and can cause confusion. As it did just here
KidSquid
(The Squid)
October 2, 2018, 1:34am
4
@KjetilA / @vzorglub
Thanks to both of you - after looking at it for hours…it all melted together - and it was right there in front of my eyes.
I have since gone in to ESPEasy and adjusted the configuration for the MQTT topic and removed the leading slash.