quielb / hass-airscape

A custom component to control a Airscape Whole House Fan with Gen2 controls
https://github.com/quielb/hass-airscape
3 stars 2 forks source link

New Install of Airscape in HA #14

Closed gjgeary closed 2 years ago

gjgeary commented 2 years ago

Hi Barry,

Thanks for creating this integration for HA. I'm bringing up my HA system over the last week or so and added this through HACS. Then I put the entry in config.yaml and started getting errors at startup and I couldn't find the integration. Here are the errors.
2022-04-29 12:03:52 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140303914560720] Sending {"id":53,"type":"result","success":true,"result":[{"name":"homeassistant.components.websocket_api.http.connection","message":["[140303863854128] Received invalid command: mobile_app/push_notification_channel"],"level":"ERROR","source":["components/websocket_api/connection.py",96],"timestamp":1651259031.024024,"exception":"","count":1,"first_occurred":1651259031.024024},{"name":"homeassistant.components.fan","message":["airscape: Error on device update!"],"level":"ERROR","source":["custom_components/airscape/fan.py",216],"timestamp":1651259030.3532186,"exception":"Traceback (most recent call last):\n File \"/usr/src/homeassistant/homeassistant/helpers/entity_platform.py\", line 431, in _async_add_entity\n await entity.async_device_update(warning=False)\n File \"/usr/src/homeassistant/homeassistant/helpers/entity.py\", line 735, in async_device_update\n await task\n File \"/usr/local/lib/python3.9/concurrent/futures/thread.py\", line 58, in run\n result = self.fn(*self.args, **self.kwargs)\n File \"/config/custom_components/airscape/fan.py\", line 216, in update\n self._state = bool(fan_data[\"fanspd\"])\nKeyError: 'fanspd'\n","count":1,"first_occurred":1651259030.3532186}]}

Thanks again.

Greg

quielb commented 2 years ago

Can you send me the output from curl http:///status.json.cgi

gjgeary commented 2 years ago

Hi Barry,

Thanks for getting back to me. I assumed I would open a terminal in home assistant and issue that curl command. It couldn’t resolve the host.

Where should I run that from?

Thanks

Greg

On Apr 30, 2022, at 6:22 PM, Barry Quiel @.***> wrote:

 Can you send me the output from curl http:///status.json.cgi

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

quielb commented 2 years ago

Looks like I didn't pay attention to my post: Can you send me the output from curl http://\<ip of fan>/status.json.cgi

gjgeary commented 2 years ago

Hi Barry,

Here is the response I get…

I can turn the fan on and off with the curl commands http:// http://%3cfan /fansp.cgi?dir1|2|3|4, and it works fine with the app and in a browser.

The developer of the Airscape fan happens to be a personal friend of mine, so I contacted him. It seems that the 2.0 version of software does not support the json and xml commands/formats. Unfortunately, I can’t upgrade my fan due to hw limitations.

There is another command – curl http:// http://%3cfan fanspd.cgi?dir that would get you the same information, just not in json. See below.

Can you parse this?

Thanks for your help.

Greg

From: Barry Quiel @.> Sent: Saturday, April 30, 2022 6:55 PM To: quielb/hass-airscape @.> Cc: gjgeary @.>; Author @.> Subject: Re: [quielb/hass-airscape] New Install of Airscape in HA (Issue #14)

Looks like I didn't pay attention to my post: Can you send me the output from curl http:// http://%3cip /status.json.cgi

— Reply to this email directly, https://github.com/quielb/hass-airscape/issues/14#issuecomment-1114098718 view it on GitHub, or https://github.com/notifications/unsubscribe-auth/ARHNXURDWV7C4FO2QE4ZQYLVHXP7FANCNFSM5UW7TYQA unsubscribe. You are receiving this because you authored the thread. https://github.com/notifications/beacon/ARHNXUULIA7ADYQ5RMHWGELVHXP7FA5CNFSM5UW7TYQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOIJT4YHQ.gif Message ID: < @.> @.>

gjgeary commented 2 years ago

Hi Barry,

I was hoping it would be possible to parse the non-json response from the fan?

Any thoughts?

Thanks again.

Greg Geary (408) 887-1636

On May 4, 2022, at 10:31 AM, @.*** wrote:

 Hi Barry, Here is the response I get…

I can turn the fan on and off with the curl commands http:///fansp.cgi?dir1|2|3|4, and it works fine with the app and in a browser.

The developer of the Airscape fan happens to be a personal friend of mine, so I contacted him. It seems that the 2.0 version of software does not support the json and xml commands/formats. Unfortunately, I can’t upgrade my fan due to hw limitations.

There is another command – curl http:// fanspd.cgi?dir that would get you the same information, just not in json. See below.

Can you parse this?

Thanks for your help.

Greg From: Barry Quiel @.> Sent: Saturday, April 30, 2022 6:55 PM To: quielb/hass-airscape @.> Cc: gjgeary @.>; Author @.> Subject: Re: [quielb/hass-airscape] New Install of Airscape in HA (Issue #14)

Looks like I didn't pay attention to my post: Can you send me the output from curl http:///status.json.cgi

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

quielb commented 2 years ago

Just so we are on the same page. This isn't an issue with the HA component. This is an issue with the pypi driver needing support for the format of the data that your fan returns. But I'm too laze to move this issue over there, so we carry on.

Also when responding with output/code/logs please use github formatting tools to make it a little more readable

Here is the response I get…

I don't see anything. Can you please give me the output from curl http://<ip of fan>/status.json.cgi

It seems that the 2.0 version of software does not support the json and xml commands/formats

That seems contrary to what my fan is showing. My fan software version is 2.15.1 and it responds to both:

curl http://<ip of fan>/status.json.cgi
curl http://<ip of fan>/status.xml.cgi

Is it specific to the exact 2.0 version or is it the whole 2.X branch?

The developer of the Airscape fan happens to be a personal friend of mine, so I contacted him

Maybe you can have them join in this conversation to add some clarity.

If status.json.cgi or status.xml.cgi aren't implemented on your particular fan then the output of the curl command should probably return a 404.

Please run the following commands and included formatted output:

curl http://<ip of fan>/status.json.cgi
curl http://<ip of fan>/status.xml.cgi

There is another command – curl http:// fanspd.cgi?dir that would get you the same information, just not in json. See below.

There is noting below. Did you forget to include it?

Can you parse this?

Yes I can, but its not ideal. It would have to be some sort of raw string parsing, losing the advantages of structured output like json or xml. You are welcome to take a stab at it by creating a pull request for the pypi airscape driver.

gjgeary commented 2 years ago

Hi Barry,

I am not a developer so I am not sure how you implement grabbing the response from the fan. It seems like you call a json tool that pulls it in and formats it. You are looking to pull a json formatted file that doesn’t exist.

Here is the curl response I got.

-- Trying 10.212.1.101:80... -- Connected to 10.212.1.101 (10.212.1.101) port 80 (#0)

GET /status.json.cgi HTTP/1.1 Host: 10.212.1.101 User-Agent: iCurlHTTP/1.16 libcurl/7.74.0 OpenSSL/1.1.1i zlib/1.2.11 nghttp2/1.42.0 Accept: / Connection: Upgrade, HTTP2-Settings Upgrade: h2c HTTP2-Settings: AAMAAABkAAQCAAAAAAIAAAAA

-- Mark bundle as not supporting multiuse HTTP/1.1 404 Not found Connection: close Content-Type: text/html

404: File not found
Use MPFS Upload to program web pages -- Closing connection 0

Timing Details -- Name Lookup: 0.00s -- TCP Connect: 0.11s -- First Byte: 0.33s -- Total Download: 1.00s -- Size: 87 bytes -- Speed: 87 bytes/sec -- Using: HTTP/1.1 RESULT CODE: 404

Greg

On May 11, 2022, at 7:45 PM, Barry Quiel @.***> wrote:

 Just so we are on the same page. This isn't an issue with the HA component. This is an issue with the pypi driver needing support for the format of the data that your fan returns. But I'm too laze to move this issue over there, so we carry on.

Also when responding with output/code/logs please use github formatting tools to make it a little more readable

Here is the response I get…

I don't see anything. Can you please give me the output from curl http:///status.json.cgi

It seems that the 2.0 version of software does not support the json and xml commands/formats

That seems contrary to what my fan is showing. My fan software version is 2.15.1 and it responds to both:

curl http:///status.json.cgi curl http:///status.xml.cgi Is it specific to the exact 2.0 version or is it the whole 2.X branch?

The developer of the Airscape fan happens to be a personal friend of mine, so I contacted him

Maybe you can have them join in this conversation to add some clarity.

If status.json.cgi or status.xml.cgi aren't implemented on your particular fan then the output of the curl command should probably return a 404.

Please run the following commands and included formatted output:

curl http:///status.json.cgi curl http:///status.xml.cgi There is another command – curl http:// fanspd.cgi?dir that would get you the same information, just not in json. See below.

There is noting below. Did you forget to include it?

Can you parse this?

Yes I can, but its not ideal. It would have to be some sort of raw string parsing, losing the advantages of structured output like json or xml. You are welcome to take a stab at it by creating a pull request for the pypi airscape driver.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

quielb commented 2 years ago

Thanks for sending over the output. Now that I know what the http error code is for the standard fetch I can handle that error.

Please also send over the output from curl http://<ip of fan>/status.xml.cgi

gjgeary commented 2 years ago

Hi Barry,

Here is the response to status.xml.cgi

-- Trying 10.212.1.101:80... -- Connected to 10.212.1.101 (10.212.1.101) port 80 (#0)

GET /status.xml.cgi HTTP/1.1 Host: 10.212.1.101 User-Agent: iCurlHTTP/1.16 libcurl/7.74.0 OpenSSL/1.1.1i zlib/1.2.11 nghttp2/1.42.0 Accept: / Connection: Upgrade, HTTP2-Settings Upgrade: h2c HTTP2-Settings: AAMAAABkAAQCAAAAAAIAAAAA

-- Mark bundle as not supporting multiuse HTTP/1.1 404 Not found Connection: close Content-Type: text/html

404: File not found
Use MPFS Upload to program web pages -- Closing connection 0

Timing Details -- Name Lookup: 0.00s -- TCP Connect: 0.21s -- First Byte: 0.43s -- Total Download: 1.06s -- Size: 87 bytes -- Speed: 82 bytes/sec -- Using: HTTP/1.1 RESULT CODE: 404

Thanks,

Greg

On May 17, 2022, at 10:22 AM, Barry Quiel @.***> wrote:

 Thanks for sending over the output. Now that I know what the http error code is for the standard fetch I can handle that error.

Please also send over the output from curl http:///status.xml.cgi

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

gjgeary commented 2 years ago

Hi Barry,

Here is the info returned if you just run (no xml or json). It looks like html.

Any possibility to use this info?

Thanks,

Greg

curl http:// fanspd.cgi?dir - verbose

GET /fanspd.cgi?dir HTTP/1.1

Host: 10.212.1.101

User-Agent: curl/7.79.1

Accept: /

Referer: rbose

< HTTP/1.1 200 OK

< Connection: close

< Content-Type: text/html

< Cache-Control: no-cache

<

fanspd0

doorinprocess0

timeremaining0

macaddr60:CB:FB:00:01:29

ipaddr10.212.1.101

model4.4eWHF

softver: 2.0

interlock1: 0

interlock2: 0

cfm: 0

power: 0

inside: 77

10.212.1.1

attic: 94

OA: 89

server response: f}sr4c5(

                                            </server_response>

DIP Switches: 11000

Remote Switch: 1111

From: Greg Geary @.> Sent: Tuesday, May 17, 2022 2:27 PM To: quielb/hass-airscape @.> Cc: quielb/hass-airscape @.>; Author @.> Subject: Re: [quielb/hass-airscape] New Install of Airscape in HA (Issue #14)

Hi Barry,

Here is the response to status.xml.cgi

-- Trying 10.212.1.101:80...

-- Connected to 10.212.1.101 (10.212.1.101) port 80 (#0)

GET /status.xml.cgi HTTP/1.1

Host: 10.212.1.101

User-Agent: iCurlHTTP/1.16 libcurl/7.74.0 OpenSSL/1.1.1i zlib/1.2.11 nghttp2/1.42.0

Accept: /

Connection: Upgrade, HTTP2-Settings

Upgrade: h2c

HTTP2-Settings: AAMAAABkAAQCAAAAAAIAAAAA

-- Mark bundle as not supporting multiuse

HTTP/1.1 404 Not found

Connection: close

Content-Type: text/html

404: File not found
Use MPFS Upload to program web pages

-- Closing connection 0

Timing Details

-- Name Lookup: 0.00s

-- TCP Connect: 0.21s

-- First Byte: 0.43s

-- Total Download: 1.06s

-- Size: 87 bytes

-- Speed: 82 bytes/sec

-- Using: HTTP/1.1

RESULT CODE: 404

Thanks,

Greg

On May 17, 2022, at 10:22 AM, Barry Quiel @. @.> > wrote:



Thanks for sending over the output. Now that I know what the http error code is for the standard fetch I can handle that error.

Please also send over the output from curl http:// http://%3cip /status.xml.cgi

— Reply to this email directly, view it on GitHub https://github.com/quielb/hass-airscape/issues/14#issuecomment-1129125888 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ARHNXUS3T3Y3UBOUSCNXNK3VKPIVPANCNFSM5UW7TYQA . You are receiving this because you authored the thread. https://github.com/notifications/beacon/ARHNXUQP4Y4K4DYDN7UH6ZTVKPIVPA5CNFSM5UW7TYQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOINGRQAA.gif Message ID: @. @.> >

quielb commented 2 years ago

That's not HTML, it's some sort of pseudo-xml.

I've started working on this in my limited free time, but have run into a few issues I'm trying to work out. No ETA at this point.

gjgeary commented 2 years ago

Hi Barry,

Sorry, no pressure from here. I realize this is all voluntary work. If there is any way I can support this effort in addition to testing it out, please let me know

Thanks again.

Greg

On May 25, 2022, at 7:53 PM, Barry Quiel @.***> wrote:

 That's not HTML, it's some sort of pseudo-xml.

I've started working on this in my limited free time, but have run into a few issues I'm trying to work out. No ETA at this point.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

gjgeary commented 2 years ago

Hi Barry,

I downloaded the new version. It still hasn’t created the fan. I added the configuration.yaml entry, but nothing showed up in integrations/devices/entities. The service calls were available to call, but failed due to an unknown error.

Configuration.yaml entry:

fan:

minimum: 4

Below is the log info.

Any thoughts?

Thanks,

Greg

2022-05-29 12:56:55 DEBUG (SyncWorker_0) [custom_components.airscape.fan] Calling slow_down for None

2022-05-29 12:56:55 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'NoneType' object has no attribute 'slow_down'

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 447, in _async_step

await getattr(self, handler)()

File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 680, in _async_call_service_step

await service_task

File "/usr/src/homeassistant/homeassistant/core.py", line 1627, in async_call

task.result()

File "/usr/src/homeassistant/homeassistant/core.py", line 1670, in _execute_service

await self._hass.async_add_executor_job(

File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run

result = self.fn(*self.args, **self.kwargs)

File "/config/custom_components/airscape/fan.py", line 73, in service_slow_down

entity.slow_down()

AttributeError: 'NoneType' object has no attribute 'slow_down'

2022-05-29 12:56:55 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140399234695616] Error handling message: Unknown error (unknown_error)

Traceback (most recent call last):

File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response

await func(hass, connection, msg)

File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 626, in handle_execute_script

await script_obj.async_run(msg.get("variables"), context=context)

File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1513, in async_run

await asyncio.shield(run.async_run())

File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 405, in async_run

await self._async_step(log_exceptions=False)

File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 449, in _async_step

self._handle_exception(

File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 472, in _handle_exception

raise exception

File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 447, in _async_step

await getattr(self, handler)()

File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 680, in _async_call_service_step

await service_task

File "/usr/src/homeassistant/homeassistant/core.py", line 1627, in async_call

task.result()

File "/usr/src/homeassistant/homeassistant/core.py", line 1670, in _execute_service

await self._hass.async_add_executor_job(

File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run

result = self.fn(*self.args, **self.kwargs)

File "/config/custom_components/airscape/fan.py", line 73, in service_slow_down

entity.slow_down()

AttributeError: 'NoneType' object has no attribute 'slow_down'

From: Barry Quiel @.> Sent: Sunday, May 29, 2022 10:57 AM To: quielb/hass-airscape @.> Cc: gjgeary @.>; Author @.> Subject: Re: [quielb/hass-airscape] New Install of Airscape in HA (Issue #14)

Closed #14 https://github.com/quielb/hass-airscape/issues/14 as completed via #19 https://github.com/quielb/hass-airscape/pull/19 .

— Reply to this email directly, view it on GitHub https://github.com/quielb/hass-airscape/issues/14#event-6698586341 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ARHNXUQWQSJKVFLKEVV7PU3VMOVXRANCNFSM5UW7TYQA . You are receiving this because you authored the thread. https://github.com/notifications/beacon/ARHNXUSMH34YT63Y733ZND3VMOVXRA5CNFSM5UW7TYQKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGPAAAAAAMPIRIOK.gif Message ID: @. @.> >

quielb commented 2 years ago

What does your service call look like?

gjgeary commented 2 years ago

-->Yaml code from Developer Tools – Services  service: airscape.speed_up data: {}

quielb commented 2 years ago

Please review the required parameters for this service call as described in Developer Tools - Services dashboard.

gjgeary commented 2 years ago

Hi Barry,

I rebooted the host and it looks like I now have an entity, the service calls work and the attributes are available.

I play with it for a few days and confirm.

Thanks for making this available.

Greg

On May 29, 2022, at 10:57 AM, Barry Quiel @.***> wrote:

 Closed #14 as completed via #19.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

gjgeary commented 2 years ago
Hi Barry, Everything seems to work.  One question.  My fan only has 6 speeds.  Is it supposed to read the fan model and scale the 6 speeds into percentage (which might be awkward – 16.667 per step). Or is always a 10 speed fan and in my case 10%, 20%, 30%, 40%, 50%, 60% are the only valid percentages? Thanks, Greg Sent from Mail for Windows From: Greg GearySent: Sunday, May 29, 2022 8:03 PMTo: quielb/hass-airscapeCc: quielb/hass-airscape; AuthorSubject: Re: [quielb/hass-airscape] New Install of Airscape in HA (Issue #14) Hi Barry, I rebooted the host and it looks like I now have an entity, the service calls work and the attributes are available. I play with it for a few days and confirm.  Thanks for making this available.GregOn May 29, 2022, at 10:57 AM, Barry Quiel ***@***.***> wrote:Closed #14 as completed via #19.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***> 
gjgeary commented 2 years ago

Hi Barry,

This has been working great for the last few months. I had a question about the sample rate. It seems to sample a couple of times a second. What would be the best way to reduce the sample rate to once per minute?

Thanks,

Greg Geary

On May 29, 2022, at 9:44 PM, Greg Geary @.***> wrote:

 Hi Barry,

Everything seems to work. One question. My fan only has 6 speeds. Is it supposed to read the fan model and scale the 6 speeds into percentage (which might be awkward – 16.667 per step). Or is always a 10 speed fan and in my case 10%, 20%, 30%, 40%, 50%, 60% are the only valid percentages?

Thanks,

Greg

Sent from Mail for Windows

From: Greg Geary Sent: Sunday, May 29, 2022 8:03 PM To: quielb/hass-airscape Cc: quielb/hass-airscape; Author Subject: Re: [quielb/hass-airscape] New Install of Airscape in HA (Issue #14)

Hi Barry,

I rebooted the host and it looks like I now have an entity, the service calls work and the attributes are available.

I play with it for a few days and confirm.

Thanks for making this available.

Greg

On May 29, 2022, at 10:57 AM, Barry Quiel @.***> wrote:

 Closed #14 as completed via #19.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.