# Nodered and ewpe-smart-mqtt

**URL:** <https://discourse.nodered.org/t/nodered-and-ewpe-smart-mqtt/29828>\
**Category:** General\
**Created:** [10 July 2020 07:32 UTC](https://discourse.nodered.org/t/nodered-and-ewpe-smart-mqtt/29828 "2020-07-10T07:32:45Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![MAaron](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/maaron/32/9813_2.png) [@MAaron](https://discourse.nodered.org/u/MAaron)\
**Post date:** [12 July 2020 08:39 UTC](https://discourse.nodered.org/t/nodered-and-ewpe-smart-mqtt/29828/21 "2020-07-12T08:39:36Z")

</div>

> [@craigcurtin](#):
>
> ```auto
> [{"id":"807888c6.ed5a78","type":"inject","z":"4988251a.07771c","name":"Imaginary Temperature","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"21","payloadType":"num","x":240,"y":80,"wires":[["6cb9b920.48c1f8"]]},{"id":"71e6163e.dd4528","type":"inject","z":"4988251a.07771c","name":"Imaginary Temperature","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"21","payloadType":"num","x":240,"y":180,"wires":[["6cb9b920.48c1f8"]]},{"id":"9285636b.25636","type":"inject","z":"4988251a.07771c","name":"Imaginary Temperature","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"21","payloadType":"num","x":240,"y":120,"wires":[["6cb9b920.48c1f8"]]},{"id":"6cb9b920.48c1f8","type":"smooth","z":"4988251a.07771c","name":"Average Temp","property":"payload","action":"mean","count":"10","round":"0","mult":"single","reduce":false,"x":550,"y":120,"wires":[["4851bcde.92eed4"]]},{"id":"4851bcde.92eed4","type":"switch","z":"4988251a.07771c","name":"test for range","property":"payload","propertyType":"msg","rules":[{"t":"btwn","v":"21","vt":"num","v2":"25","v2t":"num"},{"t":"btwn","v":"26","vt":"num","v2":"30","v2t":"num"},{"t":"btwn","v":"27","vt":"num","v2":"31","v2t":"num"}],"checkall":"true","repair":false,"outputs":3,"x":800,"y":120,"wires":[["4c35c53a.24312c"],["662581ab.5079b"],["e916ccec.bff"]]},{"id":"4c35c53a.24312c","type":"change","z":"4988251a.07771c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":100,"wires":[["f214e6fa.5dc348"]]},{"id":"662581ab.5079b","type":"change","z":"4988251a.07771c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":160,"wires":[["f214e6fa.5dc348"]]},{"id":"e916ccec.bff","type":"change","z":"4988251a.07771c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":220,"wires":[["f214e6fa.5dc348"]]},{"id":"f214e6fa.5dc348","type":"rbe","z":"4988251a.07771c","name":"send on change","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1310,"y":140,"wires":[[]]}]
> 
> ```

Sry, I don't get what you saying here.

My main focus was exactly that **not** to send, if "range" hasn't changed. Don't really need the average part of node, that part only delays. I'm already rounding the current temperature value, if that was the concern for it, in another flow.

Now, with the flow I've imported, it works flawlessly.

I've even made an mqtt broker within the nodered (aedes mqtt), that publishes the power information (only the "pow": 1 or "pow": 0), also put an rbe (so that it doesnt send this simple info every 2 secs) subscribed from my phone, put it in tasker. In tasker, if this value changes (tasker--\>mqtt client: message arrived), it puts this as a global variable.  
In another tasker task, which is a tasker shortcut I have on my homescreen, if this global valiable is 0, it sends an "aircondon" join message, that starts the flow, if its 1, it sends the "aircondoff" join message, which stops it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 September 2020 08:42 UTC](https://discourse.nodered.org/t/nodered-and-ewpe-smart-mqtt/29828/22 "2020-09-10T08:42:01Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/nodered-and-ewpe-smart-mqtt/29828.md?page=1)
