Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an additional tag/token 'lastelement' that contains the last el… #5

Closed
wants to merge 3 commits into from

Conversation

ps-nl
Copy link

@ps-nl ps-nl commented Apr 1, 2018

Added an addtional tag ("lastelement"), that contains the last element of the Topic that has triggered. This allows for OpenHAB style MQTT protocol communication, whereby 'lastelement' contains the measurement-name and 'message' the value of that variable.

I use it for reading from ESP_Easy connected sensors, and passing the values on to a virtual device.

Example:

  • ESPEasy device with a BME280 sensor, that measures temperature, humidity, and pressure;
  • ESPEasy publishes these measurements in the following Topics: /ESP_Easy/BME280/Temp; /ESP_Easy/BME280/Humidity; /ESP_EASY/BME280/Pressure;
  • I have created a Flow with as a Trigger a MQTT-client card that listens to "/ESP_Easy/BME280/+". Note the wildcard;
  • When trigerred, for each published measurement a token "lastelement" is passed to a virtual devices as the sensorname, and token "message" as the value of that sensor;
  • The number of sensors / measurements defined in ESP Easy dictates the number of subtopics, and therefore the number of times this flow is triggered.
  • measurements are now tracked in Insights;
  • measurement values of the virtual device can be used to trigger other flows.

Note:
to get the app to compile I had to delete the "retain checkbox" from app.json. May want to put that back.
,
{
"name": "retain",
"type": "checkbox",
"title": {
"en": "retain",
"nl": "retain"
}
}

…ement of Topic that has triggered. This allows for OpenHAB MQTT protocol communication, whereby 'lastelement' contains the measurement-name and 'message' the value of that variable.

I use it for reading from ESP_Easy connected sensors, and passing the values on to a virtual device.

Example:
- ESPEasy device with a BME280 sensor, that measures temperature, humidity, and pressure;
- ESPEasy publishes these measurements in the following Topics: /ESP_Easy/BME280/Temp; /ESP_Easy/BME280/Humidity; /ESP_EASY/BME280/Pressure;
- I have created a Flow with as a Trigger a MQTT-client card that listens to "/ESP_Easy/BME280/+". Note the wildcard;
- When trigerred, for each published measurement a token "lastelement" is passed to a virtual devices as the sensorname, and token "message" as the value of that sensor;
- The number of sensors / measurements defined in ESP Easy dictates the number of subtopics, and therefore the number of times this flow is triggered.
- measurements are now tracked in Insights;
- measurement values of the virtual device can be used to trigger other flows.

Note:
to get the app to compile I had to delete the "retain checkbox" from app.json. May want to put that back.
,
              {
                 "name": "retain",
                 "type": "checkbox",
                 "title": {
                    "en": "retain",
                    "nl": "retain"
                 }
              }
@ps-nl
Copy link
Author

ps-nl commented Apr 1, 2018

See below for Use-examples for this new tag

screen shot 2018-04-01 at 17 47 57
screen shot 2018-04-01 at 17 48 40
screen shot 2018-04-01 at 17 47 22

@ps-nl ps-nl closed this by deleting the head repository May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant