Mike, our 2 versions return the exact same result, which is correct.
Kermit, your suggestion returns ‘home’ which is fine but its too general. I want to know which phone is at which AP. So, i can that Johnny is near the AP in the the basement, Jane is pinging in the loft and Tom is at the shop. They are all home.
When Johnny’s phone = the basement AP, I set 'Basement" to a Jonny-Helper entity. if Johnny goes to the shop, the helper will change to ‘Shop’ and so on. I have all this set up in Automations right now and it works very well. I’m trying to mimic it in Node-Red. My initial NR flow almost works. i have my statement (or Mike’s statement) in a template node and it returns ‘true’ when Johnny is in basement, perfect. I need the next node, say a ‘call service’ to set his helper to basement and then to email me, as an example. I must have the output properties incorrect. Been using msg.payload and trying all kinds of other things.
[{"id":"27dcbd6696b144e3","type":"api-call-service","z":"9bec33e3bc2ab894","name":"Buick","server":"86158645.d19e98","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.loft_buick_globes"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1120,"y":1940,"wires":[["3476710e3da070c0"]]},{"id":"b2a9bd69e8268424","type":"api-render-template","z":"9bec33e3bc2ab894","name":"LOFT","server":"86158645.d19e98","version":0,"template":"platform: template\nvalue_template: >-\n {{ state_attr('device_tracker.unifi_f2_d8_4a_3f_fd_a3_default', 'ap_mac') ==\n '78:8a:20:56:b5:ba'}}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"","templateLocationType":"none","x":720,"y":1990,"wires":[["fa065144a8e0780e","acf7a4f6e6483448"]]},{"id":"320adf2d1fc24e4d","type":"inject","z":"9bec33e3bc2ab894","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":510,"y":1990,"wires":[["b2a9bd69e8268424"]]},{"id":"319c881995cbf438","type":"debug","z":"9bec33e3bc2ab894","name":"2C","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1340,"y":1990,"wires":[]},{"id":"2377a3071dcc241d","type":"api-render-template","z":"9bec33e3bc2ab894","name":"Basement","server":"86158645.d19e98","version":0,"template":"platform: template\nvalue_template: >-\n {{ state_attr('device_tracker.unifi_f2_d8_4a_3f_fd_a3_default', 'ap_mac') ==\n '68:d7:9a:28:ea:b5'}}","resultsLocation":"payload","resultsLocationType":"msg","templateLocation":"","templateLocationType":"none","x":730,"y":1940,"wires":[["69ea57e3109eba0b","ea5d5165f7fa5b3d"]]},{"id":"0fa63ca3c6640e72","type":"api-call-service","z":"9bec33e3bc2ab894","name":"conference","server":"86158645.d19e98","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.loft_conference_globes"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1140,"y":1990,"wires":[["319c881995cbf438"]]},{"id":"0cd91a9baef67b5f","type":"inject","z":"9bec33e3bc2ab894","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":510,"y":1940,"wires":[["2377a3071dcc241d"]]},{"id":"3476710e3da070c0","type":"debug","z":"9bec33e3bc2ab894","name":"1C","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1340,"y":1940,"wires":[]},{"id":"69ea57e3109eba0b","type":"switch","z":"9bec33e3bc2ab894","name":"True?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"True","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":910,"y":1940,"wires":[["27dcbd6696b144e3","ad5b9cecf36e5f69"]]},{"id":"fa065144a8e0780e","type":"switch","z":"9bec33e3bc2ab894","name":"True?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"True","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":910,"y":1990,"wires":[["0fa63ca3c6640e72","87d3ea9315b4adc6"]]},{"id":"ad5b9cecf36e5f69","type":"debug","z":"9bec33e3bc2ab894","name":"1B","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1120,"y":1890,"wires":[]},{"id":"87d3ea9315b4adc6","type":"debug","z":"9bec33e3bc2ab894","name":"2B","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1120,"y":2050,"wires":[]},{"id":"ea5d5165f7fa5b3d","type":"debug","z":"9bec33e3bc2ab894","name":"1A","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":910,"y":1890,"wires":[]},{"id":"acf7a4f6e6483448","type":"debug","z":"9bec33e3bc2ab894","name":"2A","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":910,"y":2050,"wires":[]},{"id":"86158645.d19e98","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]
Debug 1A returns "platform: template↵value_template: >-↵ False"
Debug 2A returns "platform: template↵value_template: >-↵ True"
1A,1C,2A,2C return nothing
I’m just turning on lights as a test, because I can quickly tell if its working right. Mike, your statement returns the exact same thing.
thanks for any feedback folks