Jump to content

Polyglot NodeServer for Wireless Sensor Tags?


Chioti

Recommended Posts

I wanted to start a thread to determine if there are other people like me who would really like a Polyglot NodeServer for these tags?

 

I unfortunately do not have the Python skills to develop this myself. If someone does and is will to develop one I would be happy to be a tester. 

Link to comment
Share on other sites

In addition to being much more secure than using a KumoApp it would have the huge benefit of eliminating the need of having variables to represent temp and humidity for each tag. You could just use these directly from the nodes.

To get the values into ISY it would take a bridge CPU to inject the values into ISY.

 

Since there us no control of kumoapps to be used it makes no sense to develop a bridge software to do this at all.

 

Kumoapps will write your values directly into your ISY, trigger programs, scenes or whatever you like without adding any additional hardware already.

 

See older threads for complete information on how to do this. Many are here to help with your questions.

 

Sent from my SGH-I257M using Tapatalk

Link to comment
Share on other sites

To get the values into ISY it would take a bridge CPU to inject the values into ISY.

 

Since there us no control of kumoapps to be used it makes no sense to develop a bridge software to do this at all.

 

Kumoapps will write your values directly into your ISY, trigger programs, scenes or whatever you like without adding any additional hardware already.

 

See older threads for complete information on how to do this. Many are here to help with your questions.

 

Sent from my SGH-I257M using Tapatalk

 

 

I already do that.

 

However I do have an always on CPU running Polyglot and the Nest NodeServer and I would like to add my Wireless Sensor Tags to that. The idea of storing my ISY password on a cloud server is the main reason why I want to drop KumoApps.

 

Additionally there is already a Python library for Wireless Sensor Tags, so I'm hoping!

Link to comment
Share on other sites

I have a PHP script on a Linux host that the KumoApp calls (with a discrete key), and my ISY credential is in that code. That way, the credential is not needed on the third party server, and stays in my control.

 

However, a node server for the sensor tags would be awesome! Count me as a +1.

Link to comment
Share on other sites

I have a PHP script on a Linux host that the KumoApp calls (with a discrete key), and my ISY credential is in that code. That way, the credential is not needed on the third party server, and stays in my control.

 

However, a node server for the sensor tags would be awesome! Count me as a +1.

Any chance you would share your PHP script and KumoApps calls with us? 

 

+1 on this also on node server.

Link to comment
Share on other sites

Apologies - it's not a PHP script (getting confused between different solutions)..  It's an Apache virtual host configuration.

 

This is it:

<VirtualHost *:443>
        ServerAdmin webmaster@lights.domain.com
        ServerName lights.domain.com
        ProxyRequests Off
        ProxyPreserveHost On
        KeepAlive On
        KeepAliveTimeout 5000
        ProxyVia Off
        SetEnv force-proxy-request-1.0 1
        SetEnv proxy-nokeepalive 1
        SetEnvIf Request_URI ^/iHcKyi24f1ucXmGiOymYdCj6aGTdK6KVvKFXHzTJsjvK70vLkqY8pBMQHPcZfQt/ noauth=1
        <Proxy *>
                Require host lights.domain.com
                AuthName "Authentication Required"
                AuthType Basic
                AuthUserFile /etc/htpasswd-isy
                AuthGroupFile /dev/null
                Order deny,allow
                Satisfy any
                Deny from all
                require valid-user
                Allow from env=noauth
        </Proxy>
        RequestHeader set Authorization "Basic {REPLACE_ME_ISY_AUTH}"
        ProxyPass /iHcKyi24f1ucXmGiOymYdCj6aGTdK6KVvKFXHzTJsjvK70vLkqY8pBMQHPcZfQt/rest http://{REPLACE_ME_ISY_IP}/rest
        ProxyPassReverse /iHcKyi24f1ucXmGiOymYdCj6aGTdK6KVvKFXHzTJsjvK70vLkqY8pBMQHPcZfQt/rest http://{REPLACE_ME_ISY_IP}/rest
        ProxyPass / http://{REPLACE_ME_ISY_IP}/
        ProxyPassReverse / http://{REPLACE_ME_ISY_IP}/
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        ErrorLog ${APACHE_LOG_DIR}/error.log
        SSLEngine on
        SSLCertificateFile    /etc/ssl/certs/wc.domain.com.pem
        SSLCertificateKeyFile /etc/ssl/private/wc.domain.com.key
        SSLCertificateChainFile /etc/ssl/AlphaSSLchain.crt
</VirtualHost>

Replace {REPLACE_ME_ISY_IP} with the IP of your ISY

Replace {REPLACE_ME_ISY_AUTH} with the Base64  version of your ISYs USERNAME:PASSWORD

 

Change iHcKyi24f1ucXmGiOymYdCj6aGTdK6KVvKFXHzTJsjvK70vLkqY8pBMQHPcZfQt (this is NOT my actual key!!) with a different random string

 

I've change my domain name to domain.com for this example. And I have an SSL certificate that's publicly trusted..

 

The ISYs REST interface can now be accessed via apache at https://lights.domain.com/rest using usernames and passwords defined in /etc/htpasswd-isy. This way - NO external sites need your ISYs actual username.

 

Additionally - the REST interface becomes available at https://lights.domain.com/iHcKyi24f1ucXmGiOymYdCj6aGTdK6KVvKFXHzTJsjvK70vLkqY8pBMQHPcZfQt/rest -without needing any auth (just knowledge of the secret key on the URL - SSL is required to keep this secure!).

 

In all cases, Apache adds the needed Authorization header to auth to ISY itself. If the remote site is compromised - simply deauth that account or change the key.

 

Be aware - the remote service will be able to do anything. You can also define multiple URLs behind the key to specific REST endpoints (to limit what the key can do). It quickly becomes difficult to manage though.

 

Michael.

Link to comment
Share on other sites

I already do that.

 

However I do have an always on CPU running Polyglot and the Nest NodeServer and I would like to add my Wireless Sensor Tags to that. The idea of storing my ISY password on a cloud server is the main reason why I want to drop KumoApps.

 

Additionally there is already a Python library for Wireless Sensor Tags, so I'm hoping!

I doubt that would drop kumoapps.  You would just be adding one more box to the chain.

Link to comment
Share on other sites

Actually it wouldn't. It would work in the same way as the Nest NodeServer in that it would poll the tag manager (using the published REST api) in order to set it's states; temp, humidity, etc.

 

You can then use these node states in the same way as variables within your ISY programming.

 

I looked into this a bit last year and successfully made calls using the REST api, but I have zero Python skills to take on developing a NodeServer on my own.

 

I doubt that would drop kumoapps.  You would just be adding one more box to the chain.

Link to comment
Share on other sites

Actually it wouldn't. It would work in the same way as the Nest NodeServer in that it would poll the tag manager (using the published REST api) in order to set it's states; temp, humidity, etc.

 

You can then use these node states in the same way as variables within your ISY programming.

 

I looked into this a bit last year and successfully made calls using the REST api, but I have zero Python skills to take on developing a NodeServer on my own.

CAO claims they have to run compensation curves on temperature and humidity scales that are too complex to be contained inside the Tag Manager.

 

This would mean the data path is dependant on their cloud server and there us no way to avoid that part of the path.

 

It has been demonstrated several times the system will not function without cloud intervention.

 

Sent from my SGH-I257M using Tapatalk

Link to comment
Share on other sites

CAO claims they have to run compensation curves on temperature and humidity scales that are too complex to be contained inside the Tag Manager.

This would mean the data path is dependant on their cloud server and there us no way to avoid that part of the path.

 

It has been demonstrated several times the system will not function without cloud intervention.

 

Sent from my SGH-I257M using Tapatalk

 

I get that. I am not trying to cut out their cloud server. What I want to do is eliminate Kumoapps having to update ISY state variables for use in my programming (and storing my ISY credentials on their server). Considering that I use ISY for garage door openers I want to eliminate this security vulnerability.

 

I know there was another suggestion as to how to do that, but a NodeServer using their REST api would solve that in what I believe is a much simpler manner. 

Link to comment
Share on other sites

I get that. I am not trying to cut out their cloud server. What I want to do is eliminate Kumoapps having to update ISY state variables for use in my programming (and storing my ISY credentials on their server). Considering that I use ISY for garage door openers I want to eliminate this security vulnerability.

 

I know there was another suggestion as to how to do that, but a NodeServer using their REST api would solve that in what I believe is a much simpler manner.

I'm using Node—Red on a pi to query my tags and push the data to my ISY. Very simple to do, they have pre-programmed nodes for wireless tags. So your credentials stay local.

 

Sent from my XT1575 using Tapatalk

Link to comment
Share on other sites

I'm using Node—Red on a pi to query my tags and push the data to my ISY. Very simple to do, they have pre-programmed nodes for wireless tags. So your credentials stay local.

 

Sent from my XT1575 using Tapatalk

 

 

Interesting. I've just installed it and will play around with it.

Link to comment
Share on other sites

Interesting. I've just installed it and will play around with it.

 

Can you PM me an example flow using this? I must admit I can't even figure out how to specify the uri, email, password on the wireless node.

 

... now I figured out the config ... but a sample flow would be useful.

Link to comment
Share on other sites

Can you PM me an example flow using this? I must admit I can't even figure out how to specify the uri, email, password on the wireless node.

 

... now I figured out the config ... but a sample flow would be useful.

OK, here is an example of a freeze warning I send to my ISY from my Wireless Tag on my patio. It sets a variable as 0 or 1 depending on the temp reaching the freezing point. You can just as easily push the current temp to the ISY variable or any of the other tag outputs.

 

First, here is the source for the Wireless Tag nodes: https://flows.nodered.org/node/node-red-contrib-wirelesstag

 

Second here is my flow diagram for my ISY freeze switch: post-7475-0-53234600-1513977909_thumb.jpg

 

Third is the code for my flow, sans any credential info:

 

[{"id":"8972126f.24991","type":"inject","z":"3f5f002d.f63fe","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"x":130,"y":700,"wires":[["4a0c656f.8084dc"]]},{"id":"4a0c656f.8084dc","type":"wirelesstag","z":"3f5f002d.f63fe","tagmanager":"EA691FDA29B7","tag":"15ebbbf9-9271-4438-ad22-750ede0ce5e2","sensor":"temp","name":"Patio Temp","autoUpdate":false,"topic":"","topicIsPrefix":false,"defaultName":"Patio (temp)","cloud":"c8df4da9.4662a","x":290,"y":700,"wires":[["880b0af0.8ec6d8"]]},{"id":"f3c0feac.7ed4f","type":"wirelesstag-all","z":"3f5f002d.f63fe","name":"","topic":"","topicIsPrefix":false,"cloud":"c8df4da9.4662a","x":310,"y":760,"wires":[[]]},{"id":"e687ff7e.5fc12","type":"ui_text","z":"3f5f002d.f63fe","group":"801a8a6a.1452b8","order":2,"width":"10","height":"9","name":"","label":"Degrees F","format":"{{msg.payload}}","layout":"col-center","x":930,"y":680,"wires":[]},{"id":"880b0af0.8ec6d8","type":"xml","z":"3f5f002d.f63fe","name":"","attr":"","chr":"","x":450,"y":700,"wires":[["4839ef87.b1c7c"]]},{"id":"4839ef87.b1c7c","type":"html","z":"3f5f002d.f63fe","name":"","tag":"root reading","ret":"html","as":"single","x":590,"y":700,"wires":[["53072dee.d9e3b4"]]},{"id":"53072dee.d9e3b4","type":"split","z":"3f5f002d.f63fe","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":730,"y":700,"wires":[["e687ff7e.5fc12","719bcba9.615774","66e81f21.cc659","1f14c475.62ef9c"]]},{"id":"719bcba9.615774","type":"ui_chart","z":"3f5f002d.f63fe","name":"Patio Temp","group":"801a8a6a.1452b8","order":3,"width":"19","height":"15","label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"20","ymax":"80","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":900,"y":720,"wires":[[],[]]},{"id":"4b4b113d.fbb3f","type":"debug","z":"3f5f002d.f63fe","name":"","active":true,"console":"false","complete":"false","x":970,"y":500,"wires":[]},{"id":"c370a7a1.bc6698","type":"http request","z":"3f5f002d.f63fe","name":"Send Freeze warning to ISY 2,3 1","method":"GET","ret":"txt","url":"http://10.128.0.10/rest/vars/set/2/3/1","tls":"","x":1040,"y":400,"wires":[[]]},{"id":"1f14c475.62ef9c","type":"smooth","z":"3f5f002d.f63fe","name":"","action":"mean","count":"1","round":"0","mult":"single","x":660,"y":500,"wires":[["4b4b113d.fbb3f","5989f49d.92d73c"]]},{"id":"5989f49d.92d73c","type":"switch","z":"3f5f002d.f63fe","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"37","vt":"num"},{"t":"gte","v":"37","vt":"num"}],"checkall":"true","outputs":2,"x":770,"y":420,"wires":[["c370a7a1.bc6698"],["32e4f73e.800bb8","4b4b113d.fbb3f"]],"outputLabels":["FREEZING",null]},{"id":"32e4f73e.800bb8","type":"httprequest","z":"3f5f002d.f63fe","name":"Send  Non Freeze to ISY 2,3 0","method":"GET","ret":"txt","url":"http://10.128.0.10/rest/vars/set/2/3/0","tls":"","x":1030,"y":440,"wires":[[]]},{"id":"c8df4da9.4662a","type":"wirelesstag-config","z":"","apiURI":"","name":"Chalfont Wireless Tag Manager"},{"id":"801a8a6a.1452b8","type":"ui_group","z":"","name":"Wireless Tags","tab":"bf76b689.b1e448","disp":true,"width":"20"},{"id":"bf76b689.b1e448","type":"ui_tab","z":"","name":"Home Tags","icon":"dashboard"}]

 

You can just cut and paste this code into a flow area and it will create the nodes for you, but without credentials (I hope). 

 

The thing that is kind of odd about this node set is there is what I call a floating node. It is unattached to anything, it just exists in your flow sheet area. The node called "Wireless Tag - All" just simply acts as a communication and credential portal to your Tag Manager. So it has to be there for the query node(s) to work. 

 

The virtual link goes to another flow, so you don't need to worry about it.

 

Also keep in mind that the trigger doesn't need to "trigger" any faster than your wireless tags report in. So if your wireless tags are on a 15 minute report cycle, your trigger in the node flow should be the same. Otherwise it just sends blank information.

 

Hope this helps.

Link to comment
Share on other sites

OK, here is an example of a freeze warning I send to my ISY from my Wireless Tag on my patio. It sets a variable as 0 or 1 depending on the temp reaching the freezing point. You can just as easily push the current temp to the ISY variable or any of the other tag outputs.

 

First, here is the source for the Wireless Tag nodes: https://flows.nodered.org/node/node-red-contrib-wirelesstag

 

Second here is my flow diagram for my ISY freeze switch: attachicon.gifTag to ISY Node Red flow diagram.JPG

 

Third is the code for my flow, sans any credential info:

 

[{"id":"8972126f.24991","type":"inject","z":"3f5f002d.f63fe","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"x":130,"y":700,"wires":[["4a0c656f.8084dc"]]},{"id":"4a0c656f.8084dc","type":"wirelesstag","z":"3f5f002d.f63fe","tagmanager":"EA691FDA29B7","tag":"15ebbbf9-9271-4438-ad22-750ede0ce5e2","sensor":"temp","name":"Patio Temp","autoUpdate":false,"topic":"","topicIsPrefix":false,"defaultName":"Patio (temp)","cloud":"c8df4da9.4662a","x":290,"y":700,"wires":[["880b0af0.8ec6d8"]]},{"id":"f3c0feac.7ed4f","type":"wirelesstag-all","z":"3f5f002d.f63fe","name":"","topic":"","topicIsPrefix":false,"cloud":"c8df4da9.4662a","x":310,"y":760,"wires":[[]]},{"id":"e687ff7e.5fc12","type":"ui_text","z":"3f5f002d.f63fe","group":"801a8a6a.1452b8","order":2,"width":"10","height":"9","name":"","label":"Degrees F","format":"{{msg.payload}}","layout":"col-center","x":930,"y":680,"wires":[]},{"id":"880b0af0.8ec6d8","type":"xml","z":"3f5f002d.f63fe","name":"","attr":"","chr":"","x":450,"y":700,"wires":[["4839ef87.b1c7c"]]},{"id":"4839ef87.b1c7c","type":"html","z":"3f5f002d.f63fe","name":"","tag":"root reading","ret":"html","as":"single","x":590,"y":700,"wires":[["53072dee.d9e3b4"]]},{"id":"53072dee.d9e3b4","type":"split","z":"3f5f002d.f63fe","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":730,"y":700,"wires":[["e687ff7e.5fc12","719bcba9.615774","66e81f21.cc659","1f14c475.62ef9c"]]},{"id":"719bcba9.615774","type":"ui_chart","z":"3f5f002d.f63fe","name":"Patio Temp","group":"801a8a6a.1452b8","order":3,"width":"19","height":"15","label":"chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"20","ymax":"80","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":900,"y":720,"wires":[[],[]]},{"id":"4b4b113d.fbb3f","type":"debug","z":"3f5f002d.f63fe","name":"","active":true,"console":"false","complete":"false","x":970,"y":500,"wires":[]},{"id":"c370a7a1.bc6698","type":"http request","z":"3f5f002d.f63fe","name":"Send Freeze warning to ISY 2,3 1","method":"GET","ret":"txt","url":"http://10.128.0.10/rest/vars/set/2/3/1","tls":"","x":1040,"y":400,"wires":[[]]},{"id":"1f14c475.62ef9c","type":"smooth","z":"3f5f002d.f63fe","name":"","action":"mean","count":"1","round":"0","mult":"single","x":660,"y":500,"wires":[["4b4b113d.fbb3f","5989f49d.92d73c"]]},{"id":"5989f49d.92d73c","type":"switch","z":"3f5f002d.f63fe","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"37","vt":"num"},{"t":"gte","v":"37","vt":"num"}],"checkall":"true","outputs":2,"x":770,"y":420,"wires":[["c370a7a1.bc6698"],["32e4f73e.800bb8","4b4b113d.fbb3f"]],"outputLabels":["FREEZING",null]},{"id":"32e4f73e.800bb8","type":"httprequest","z":"3f5f002d.f63fe","name":"Send  Non Freeze to ISY 2,3 0","method":"GET","ret":"txt","url":"http://10.128.0.10/rest/vars/set/2/3/0","tls":"","x":1030,"y":440,"wires":[[]]},{"id":"c8df4da9.4662a","type":"wirelesstag-config","z":"","apiURI":"","name":"Chalfont Wireless Tag Manager"},{"id":"801a8a6a.1452b8","type":"ui_group","z":"","name":"Wireless Tags","tab":"bf76b689.b1e448","disp":true,"width":"20"},{"id":"bf76b689.b1e448","type":"ui_tab","z":"","name":"Home Tags","icon":"dashboard"}]

 

You can just cut and paste this code into a flow area and it will create the nodes for you, but without credentials (I hope). 

 

The thing that is kind of odd about this node set is there is what I call a floating node. It is unattached to anything, it just exists in your flow sheet area. The node called "Wireless Tag - All" just simply acts as a communication and credential portal to your Tag Manager. So it has to be there for the query node(s) to work. 

 

The virtual link goes to another flow, so you don't need to worry about it.

 

Also keep in mind that the trigger doesn't need to "trigger" any faster than your wireless tags report in. So if your wireless tags are on a 15 minute report cycle, your trigger in the node flow should be the same. Otherwise it just sends blank information.

 

Hope this helps.

 

 

Thanks for your help. I have temperature readings from 5 tags populating variables and no longer need my KumoApp. Not quite as slick as a polyglot node server but no-one had to write any additional code!

 

:-P

Link to comment
Share on other sites

I planned to look at creating a Polyglot node server and had hoped for a simple URL push option but never heard back on my post asking if it was possible. I would prefer not to have to poll. I'm not completely happy with my cao temperature monitors, but need to spend more time with them, or just continue using aeotec multisensors.

 

https://groups.google.com/forum/m/#!topic/wireless-sensor-tags/Gu7GAu_6ow0

 

 

Sent from my Pixel 2 XL using Tapatalk

Link to comment
Share on other sites

I planned to look at creating a Polyglot node server and had hoped for a simple URL push option but never heard back on my post asking if it was possible. I would prefer not to have to poll. I'm not completely happy with my cao temperature monitors, but need to spend more time with them, or just continue using aeotec multisensors.

 

https://groups.google.com/forum/m/#!topic/wireless-sensor-tags/Gu7GAu_6ow0

 

 

Sent from my Pixel 2 XL using Tapatalk

I am not sure I understand your objective here but...

Did you not read the long thread on CAO tags?  MWareman wrote kumoapp code and I updated it (with absolutely no knowledge of js myself) to push the data via REST to ISY variables.

 

I would be sure you (with your experience) could take this code and update it to whatever you wanted it to do in a few hours. The descriptions for every variable available and function are all in the online help inside the kumoapp editor.

Link to comment
Share on other sites

Yes, I have a version of that kumo script running, but wanted a simple one that would send all variables for any type of sensor, but don't remember seeing one for that?

 

What I really would like is a single URL that all sensors would use to send all their info instead of setting each one individually

 

Sent from my Pixel 2 XL using Tapatalk

Link to comment
Share on other sites

Yes, I have a version of that kumo script running, but wanted a simple one that would send all variables for any type of sensor, but don't remember seeing one for that?

 

What I really would like is a single URL that all sensors would use to send all their info instead of setting each one individually

 

Sent from my Pixel 2 XL using Tapatalk

So you didn't want to send these into ISY via REST interface then but rather to somewhere else with a POST style send?

 

I saw your URL from your linked page. Can you not smash together some string magic, to make  a POST line using code like this to create it?

I know you could do it with python. Or is the problem just familiarity with the js syntax?

 

https://forum.universal-devices.com/topic/21471-cao-tags-kumoapps-for-isy-rest-injection/

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...