Announcement

Collapse
No announcement yet.

Help pulling values for feature templates?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help pulling values for feature templates?

    Hi All,

    Trying to build an air quality sensor using an ESP32, a few sensors and Tasmota. Successfully posting data to a MQTT broker and getting the info below in return by subscribing to "teletopic%/SENSORS/#". New to MQTT and not sure If there is a way to subscribe to a feed that would deliver more granular data.

    If not, any scripting advice to pull values for feature templates would be greatly appreciated!

    {
    "Time": "2022-12-29T19:38:53",
    "ANALOG": {
    "A1": 2339
    },
    "BME680": {
    "Temperature": 20.6,
    "Humidity": 41.9,
    "DewPoint": 7.2,
    "Pressure": 1002.7,
    "Gas": 170.34
    },
    "SGP30": {
    "eCO2": 400,
    "TVOC": 22,
    "aHumidity": 7.5793
    },
    "PressureUnit": "hPa",
    "TempUnit": "C"
    }​

    #2
    What have you put together so far? Show us the device and/or feature templates and we might be able to help.

    Thanks!
    stefxx

    Comment


      #3
      Thanks stefxx,

      Here's the device:

      Click image for larger version  Name:	image.png Views:	0 Size:	41.8 KB ID:	1583662
      And the device template:

      Click image for larger version  Name:	image.png Views:	0 Size:	17.4 KB ID:	1583664

      And the feature template:

      Click image for larger version  Name:	image.png Views:	0 Size:	49.9 KB ID:	1583665
      Just wanted to get the "Temperature" function going and then add the rest of the values to the device template.

      Also noticed that the MQTT values in the Homeseer devices were not updating as expected even after hitting all the "update" buttons on the plugin page.

      Thanks again for looking at this!

      Comment


        #4
        Nice, looks good. I do see an error, "teletopic%/SENSOR:BME680:Temperature". I guess it should be "tele/#TOPIC#/SENSOR:BME680:Temperature" instead. The correct replacement variable for the topic is "#TOPIC#" (in capitals).

        That might explain why no updates are being processed.
        stefxx

        Comment


          #5
          Thanks stefxx - that worked. The trick was turning off tls in Tasmota and setting up Mosquitto here on the local network.

          Happy New Year!

          Click image for larger version

Name:	image.png
Views:	70
Size:	74.3 KB
ID:	1584048

          Comment

          Working...
          X