Jump to content

Polyglot V2 Airscape Nodeserver


Jimbo.Automates

Recommended Posts

Jimbo, you da man!  I plan to install your nodeserver this week.  BTW, right now I run a pair of shell scripts on a raspberry pi to send updates via variables to the ISY.  Here are my 2 programs, which I have been using with good success for past 2 years or so:

First one, which checks fan speed and interlock status every 4 seconds:

#!/bin/bash
oldfanspeed=-1
oldinterlock=-1
for (( ; ; ))
do

fanspeed=$(curl -s http://192.168.1.121/fanspd.cgi | grep fanspd | grep -o \[0-9]*)
if [ $fanspeed != $oldfanspeed ]
  then
    curl 192.168.1.145/rest/vars/set/2/1/$fanspeed -u xxx:xxx
    oldfanspeed=$fanspeed
fi 

sleep 2

interlock=$(curl -s http://192.168.1.121/fanspd.cgi | grep interlock2 | grep -o '>[0-9]<' | grep -o \[0-9]*)
if [ $interlock != $oldinterlock ]
  then
    curl 192.168.1.145/rest/vars/set/2/48/$interlock -u xxx:xxx
    oldinterlock=$interlock
fi

sleep 2

done

This checks to see if there are any changes so that I am not constantly writing to the ISY and slowing it down.  The fan speed is obvious.  I want it every 4 seconds so that I can update buttons on a KPL which show the speeds from 1-7.  The interlock is related to the optional negative pressure sensor I have installed on the Airscape.  It tells me when I need to open more windows.  If I do not open them, the airscape will slow itself down to avoid too much negative pressure in the house.  

The second program below gives me the 3 temperature readings (inside, outside, attic) which my airscape provides.  I update once per minute since I do not care about resolution better than that for temperature:

#!/bin/bash
oldintemp=0
oldouttemp=0
oldattictemp=0
for (( ; ; ))
do

intemp=$(curl -s http://192.168.1.121/fanspd.cgi | grep inside | grep -o \[0-9]*)
if [ $intemp != $oldintemp ]
  then
    curl 192.168.1.145/rest/vars/set/2/2/$intemp -u xxx:xxx
    oldintemp=$intemp
fi 

sleep 20

outtemp=$(curl -s http://192.168.1.121/fanspd.cgi | grep OA | grep -o \[0-9]*)
if [ $outtemp != $oldouttemp ]
  then
    curl 192.168.1.145/rest/vars/set/2/3/$outtemp -u xxx:xxx
    oldouttemp=$outtemp
fi

sleep 20

attictemp=$(curl -s http://192.168.1.121/fanspd.cgi | grep attic | grep -o \[0-9]*)
if [ $attictemp != $oldattictemp ]
  then
    curl 192.168.1.145/rest/vars/set/2/4/$attictemp -u xxx:xxx
    oldattictemp=$attictemp
fi


sleep 20

done

Also, as you noted in your github README, there is no ability to directly set fan speed on the airscape. I have asked if they can update firmware to allow this, but no luck yet.  So, I use the following program to set fan speed, which mostly works.  But your idea of polling door status (which is given as a response to polling the airscape), is a great idea.  For me, I just worked out the timing for how long it takes after initial on to reliably accept the next "speed up" command and went from there.  Here is my ISY program for speed 5, as an example:

If
        'Devices-Inside / WHF KPL Auto / WHF KPL 5' is switched On
    And Program 'WHF Test Windows are Closed' is False
 
Then
        Resource 'WHF Off'
        Wait  2 seconds
        Resource 'WHF Speed Up'
        Set 'Scenes-Inside / WHF on-off' On
        Wait  3 seconds
        Resource 'WHF Speed Up'
        Wait  1 second
        Resource 'WHF Speed Up'
        Wait  1 second
        Resource 'WHF Speed Up'
        Wait  1 second
        Resource 'WHF Speed Up'
        $WHF_Fan_Speed  = 5
 
Else
   - No Actions - (To add one, press 'Action')
 


This responds to my pressing speed 5 on my KPL, checks to make sure there is a windows open somewhere using my ELK, and sets the speed to 5.  Not great, but it works right now.  

Link to comment
Share on other sites

Nice job scripting that up!  I thought my kit would include the pressure sensor, but it didn't, I need to see if they still offer that.  I'll be getting an ELK installed hopefully in a few weeks so I want to do the same.  It's a bummer that their new controller doesn't have the API, it has a much nicer hardwired controller but that can't be used when you add the Gen 2 controller...

 

Link to comment
Share on other sites

Jimbo, the store will only load 2.0.0 version.  Should I just download from github myself and install?

In 2.0.0 I have the "Airscape Controller" node that shows Server Running = True and debug level = warning.  But no other nodes were added.  

Link to comment
Share on other sites

Jimbo, the store will only load 2.0.0 version.  Should I just download from github myself and install?
In 2.0.0 I have the "Airscape Controller" node that shows Server Running = True and debug level = warning.  But no other nodes were added.  
Sorry, I forgot to actually change the version, so you do have the latest, but if you check again you can update and it will actually show 2.0.2

You need to do the last step from the Install instructions from the README
Add the info for your fan in the NodeServer configuration page



Sent from my Pixel 3 XL with Tapatalk

Link to comment
Share on other sites

Hmmm.  I am missing something then.  I followed the steps including adding the name (WHF) and IP address (192.168.1.121) of my airscape fan.  I get the node "Airscape Controller" but no other nodes added.  I did just notice in my log the following:

2019-04-17 22:40:45,435 [Controller] [ERROR] Airscape WHF:get: Connection error for http://192.168.1.121/status.json.cgi: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /status.json.cgi (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x75cbfad0>, 'Connection to 192.168.1.121 timed out. (connect timeout=10)'))

Yet when I put 192.168.1.121/status.json.cgi into my browser, I get the proper string response.  Not sure what is going on.  Did a reboot of both ISY and Polyglot server.  

EDIT: I deleted the nodeserver and re-installed and followed instruction again.  This time, it does add the Airscape WHF node as shown in Polyglot interface.  It shows (2) nodes.  But only the "Airscape Controller" node shows up in ISY.  No nodes for fan speed or anything like that in the ISY.  And no options for adding anything in program then/else statements.    I do get this warning in the node log:

2019-04-17 22:46:26,043 [MainThread] [WARNING] /home/pi/.local/lib/python3.5/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (3.0.4) doesn't match a supported version!

and this in the master Polyglot log:

2019-4-17 22:46:28 - error: Airscape(5): n005_WHF was not added sucessfully. ISY returned Reason: 5002 2019-4-17 22:46:28 - error: addNode: failure, node removed :: Error: n005_WHF was not added sucessfully. ISY returned Reason: 5002 at Object.doNodeAdd (/snapshot/polyglot-v2/lib/modules/nodeserver.js:293:17) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) 2019-4-17 22:46:28 - info: Airscape(5): completed adding node(s).

Link to comment
Share on other sites

9 hours ago, blueman2 said:

Hmmm.  I am missing something then.  I followed the steps including adding the name (WHF) and IP address (192.168.1.121) of my airscape fan.  I get the node "Airscape Controller" but no other nodes added.  I did just notice in my log the following:

2019-04-17 22:40:45,435 [Controller] [ERROR] Airscape WHF:get: Connection error for http://192.168.1.121/status.json.cgi: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /status.json.cgi (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x75cbfad0>, 'Connection to 192.168.1.121 timed out. (connect timeout=10)'))

Yet when I put 192.168.1.121/status.json.cgi into my browser, I get the proper string response.  Not sure what is going on.  Did a reboot of both ISY and Polyglot server.  

EDIT: I deleted the nodeserver and re-installed and followed instruction again.  This time, it does add the Airscape WHF node as shown in Polyglot interface.  It shows (2) nodes.  But only the "Airscape Controller" node shows up in ISY.  No nodes for fan speed or anything like that in the ISY.  And no options for adding anything in program then/else statements.    I do get this warning in the node log:

2019-04-17 22:46:26,043 [MainThread] [WARNING] /home/pi/.local/lib/python3.5/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (3.0.4) doesn't match a supported version!

and this in the master Polyglot log:

2019-4-17 22:46:28 - error: Airscape(5): n005_WHF was not added sucessfully. ISY returned Reason: 5002 2019-4-17 22:46:28 - error: addNode: failure, node removed :: Error: n005_WHF was not added sucessfully. ISY returned Reason: 5002 at Object.doNodeAdd (/snapshot/polyglot-v2/lib/modules/nodeserver.js:293:17) at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) 2019-4-17 22:46:28 - info: Airscape(5): completed adding node(s).

The first failure is strange, must have been something weird in the string.

Second issue is because I missed adding requests to the requirments.

Third issue is node address can't contain upper-case.  

All issues are fixed in 2.0.3, just update in the nodeserver store and restart the nodeserver.

 

Link to comment
Share on other sites

Thanks soooo much for this nodeserver and for helping me get it running.  I updated to 2.0.3, but got a big red box after update saying something about not being able to update.  It went away too fast to see.  Still no joy on the above issues.  I rebooted the Polyglot as well, but still get this:

2019-04-18 10:09:07,953 [MainThread] [INFO ] UDI Polyglot v2 Interface 2.0.29 Starting...
2019-04-18 10:09:08,209 [MainThread] [WARNING] /home/pi/.local/lib/python3.5/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (3.0.4) doesn't match a supported version!
2019-04-18 10:09:09,901 [Interface ] [INFO ] Connecting to MQTT... localhost:1883
2019-04-18 10:09:10,038 [Interface ] [INFO ] MQTT Connected with result code 0 (Success)
2019-04-18 10:09:10,041 [Interface ] [INFO ] MQTT Subscribing to topic: udi/polyglot/ns/5 -  MID: 1 Result: 0
2019-04-18 10:09:10,041 [Interface ] [INFO ] MQTT Subscribing to topic: udi/polyglot/connections/polyglot -  MID: 2 Result: 0
2019-04-18 10:09:10,042 [Interface ] [INFO ] Sent Connected message to Polyglot
2019-04-18 10:09:10,171 [NodeServer] [INFO ] Started Airscape NodeServer
2019-04-18 10:09:10,179 [NodeServer] [INFO ] controller:set_debug_mode: None
2019-04-18 10:09:10,190 [NodeServer] [INFO ] controller:set_all_logs: 30
2019-04-18 10:09:20,344 [Controller] [ERROR] Airscape WHF:get: Connection error for http://192.168.1.121/status.json.cgi: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /status.json.cgi (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x75bd9d70>, 'Connection to 192.168.1.121 timed out. (connect timeout=10)'))
2019-04-18 10:10:20,129 [Controller] [ERROR] Airscape WHF:get: Connection error for http://192.168.1.121/status.json.cgi: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /status.json.cgi (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x75357a50>, 'Connection to 192.168.1.121 timed out. (connect timeout=10)'))
2019-04-18 10:10:20,129 [Controller] [ERROR] Airscape WHF:get: Connection error for http://192.168.1.121/status.json.cgi: HTTPConnectionPool(host='192.168.1.121', port=80): Max retries exceeded with url: /status.json.cgi (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x75357a50>, 'Connection to 192.168.1.121 timed out. (connect timeout=10)'))

HOWEVER, I do now have the nodes showing up in the ISY.  It is just that all the values are zero.  So, making some progress!!

I am going to manually update urllib3 and chardet to see if that helps.  

Link to comment
Share on other sites

Thanks Jimbo, that did it!  Running install.sh succeeded without errors about urllib3 and chardet.  I then found out that I needed to reboot the wifi repeater I have in the attic which attaches to my Airscape.  Apparently it was being slow to respond which was causing timeout errors when your program tried to get data from it.  Not sure what was going on there.  But all is now working!!!!

Link to comment
Share on other sites

Thanks Jimbo, that did it!  Running install.sh succeeded without errors about urllib3 and chardet.  I then found out that I needed to reboot the wifi repeater I have in the attic which attaches to my Airscape.  Apparently it was being slow to respond which was causing timeout errors when your program tried to get data from it.  Not sure what was going on there.  But all is now working!!!!
Awesome! Damn WiFi repeaters can be a pain, I had one on my pool, switched to power line which isn't much better...
lI'll need to add a driver for the pressure sensor that you need. I'll be ordering mine tomorrow. Loved how that thing cooled down our house tonight, first real time we could use it.
Also the timeremaining probably doesn't work correctly. Let me know any other issues.

Sent from my Pixel 3 XL with Tapatalk

Link to comment
Share on other sites

  • 6 months later...
  • 3 weeks later...
  • 1 year later...

Archived

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


×
×
  • Create New...