Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sensor.argon_one_addon_fan_speed entity not created (anymore) #61

Open
pascalkrielen opened this issue Aug 6, 2023 · 19 comments
Open

Comments

@pascalkrielen
Copy link

I found that for some time now the sensor.argon_one_addon_fan_speed entity is not created anymore.
Not sure when this started to happen as multiple updates were probably installed before I noticed the thing being gone.
I tried deinstalling and re-installing both the "normal" and the "linear" version, but both only provide a sensor called something like update.argonone_active_linear_cooling_update
The logs do show the basic functionality is working though, so it does its job, but would be nice to have the sensor entity so it also shows this in the dashboard and history.

@Yorkie71
Copy link

Yorkie71 commented Aug 9, 2023

I concur with @pascalkrielen on this too. Having recently started with HA and now fallen down that rabbit hole, I have upgraded and purchased the Argon case. I came across @adamoutler's excellent addon, installed, configured and it works perfectly so thank you very much for the effort here.

However, not that it's a major issue but I just can't find the fan entity. I've configured, restarted, rebooted, turned off and read the whole community thread but still no entity. Standard HAOS build, nothing fancy.

Add-on version: 29c
You are running the latest version of this add-on.
System: Home Assistant OS 10.4  (aarch64 / raspberrypi4-64)
Home Assistant Core: 2023.8.1
Home Assistant Supervisor: 2023.08.1

@fra-bri
Copy link

fra-bri commented Aug 9, 2023

Same problem here. Since update to
Home Assistant Core: 2023.8.1 and
Home Assistant Supervisor: 2023.08.1
2023-08-09 13 25 14

`
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing...

Add-on: ArgonOne Active Cooling
Actively keeping your Argon One cool.

Add-on version: 29c
You are running the latest version of this add-on.
System: Home Assistant OS 10.4 (aarch64 / raspberrypi4-64)
Home Assistant Core: 2023.8.1
Home Assistant Supervisor: 2023.08.1

Please, share the above information when looking for help
or support in, e.g., GitHub, forums or the Discord chat.

[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Detecting Layout of i2c, we expect to see "1a" here.
checking i2c port 0 at /dev/i2c-0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
not found on /dev/i2c-0
checking i2c port 1 at /dev/i2c-1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- 1a -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
found at /dev/i2c-1
I2C Port 1
Settings initialized. Argon One Detected. Beginning monitor..
Current Temperature 44 °C
2023-08-09_13:08:12: 44C - Level 1 - Fan 0% (OFF)
Current Temperature 41 °C
Current Temperature 43 °C
Current Temperature 43 °C
Current Temperature 41 °C
Current Temperature 43 °C
`

@MrYohji
Copy link

MrYohji commented Aug 9, 2023

Same issue here, apparently with the latest changes in HA

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 

-----------------------------------------------------------
 Add-on: ArgonOne Active Cooling
 Actively keeping your Argon One cool.
-----------------------------------------------------------
 Add-on version: 29c
 You are running the latest version of this add-on.
 System: Debian GNU/Linux 11 (bullseye)  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2023.8.1
 Home Assistant Supervisor: 2023.08.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Detecting Layout of i2c, we expect to see "1a" here.
checking i2c port 1 at /dev/i2c-1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- 1a -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
found at /dev/i2c-1
I2C Port 1
Settings initialized. Argon One Detected. Beginning monitor..
Current Temperature 38 °C
2023-08-09_19:32:26: 38C - Level 1 - Fan 0% (OFF)
Current Temperature 37 °C
Current Temperature 36 °C

@adamoutler
Copy link
Owner

Not sure how to handle this. I cannot reproduce.

@jweston2112
Copy link

jweston2112 commented Aug 9, 2023

This problem is related to issue " Post sent to supervisor is invalid (unix2dos not working) #60" as I had it when Supervisor got updated to 2023.07.2 version of Supervisor.... it has to do with the AIOHTTP package.

@mcfarlde
Copy link

mcfarlde commented Aug 9, 2023

I have lost the speed sensor too.

@adamoutler
Copy link
Owner

I've been doing all my updates and hearing about this problem and checking every day. I just rechecked. This is the first abnormality I've seen with my unit as of last night at ~18:00EST
image

I see the following message within my Supervisor logs.
image

The following test demonstrates the problem and can be run with SSH&Terminal addon via ssh

docker exec -it  $(docker container ls|grep argon|sed 's/ .*//' ) bash #open a bash script in the Argon container

#run the actual problematic command used, but add dummy data
fanPercent=100
icon=mdi:fan-speed-3
fanMode=High
CorF=C
cpuTemp=199
fanLevel=3

reqBody='{"state": "'"${fanPercent}"'", "attributes": { "unit_of_measurement": "%", "icon": "'"${icon}"'", "mode": "'"${fanMode}"'", "Temperature '"${CorF}"'": "'"${cpuTemp}"'", "fan level": "'"${fanLevel}"'", "friendly_name": "Argon Fan Speed"}}'
  nc -i 1 hassio 80 <<< unix2dos<<EOF
POST /homeassistant/api/states/sensor.argon_one_addon_fan_speed HTTP/1.1
Authorization: Bearer ${SUPERVISOR_TOKEN}
Content-Length: $( echo -ne "${reqBody}" | wc -c )

${reqBody}
EOF

I can observe the following response with the above test

HTTP/1.0 400 Bad Request
Content-Type: text/plain; charset=utf-8
Content-Length: 307
Date: Wed, 09 Aug 2023 19:04:43 GMT
Server: Python/3.11 aiohttp/3.8.5

Invalid header value char:

  b'Authorization: Bearer 250099d1de7c4c97b63b533168c8de287f61d9387715686a199571615bde5bcc128869bf5eef4466ac3aa07affe2ec209d769a98ead32fbf'

I don't have time to troubleshoot right now, but later tonight.

@adamoutler
Copy link
Owner

Ran my test and expected results through ChatGPT and it provided this.

(echo -ne "POST /homeassistant/api/states/sensor.argon_one_addon_fan_speed HTTP/1.1
Authorization: Bearer ${SUPERVISOR_TOKEN}
Content-Length: $( echo -ne "${reqBody}" | wc -c )

${reqBody}") | unix2dos | nc -i 1 hassio 80

I'm going to see if I can clean it up a bit. I like the idea of having the entire request written out the way it was before. I'll see if I can do something better.

@Yorkie71
Copy link

Yorkie71 commented Aug 9, 2023

Sounds positive. Thanks for the details and the effort @adamoutler. I'm intrigued by how you are using ChatGPT to help troubleshoot.

@mcfarlde
Copy link

mcfarlde commented Aug 9, 2023 via email

@adamoutler
Copy link
Owner

adamoutler commented Aug 9, 2023

So I came up with this replacement method.

fanSpeedReportLinear(){
  fanPercent=${1}
  cpuTemp=${2}
  CorF=${3}
  icon=mdi:fan
  reqBody='{"state": "'"${fanPercent}"'", "attributes": { "unit_of_measurement": "%", "icon": "'"${icon}"'", "Temperature '"${CorF}"'": "'"${cpuTemp}"'", "friendly_name": "Argon Fan Speed"}}'
  exec 3<>/dev/tcp/hassio/80
  echo -ne "POST /homeassistant/api/states/sensor.argon_one_addon_fan_speed HTTP/1.1\r\n" >&3
  echo -ne "Connection: close\r\n" >&3
  echo -ne "Authorization: Bearer ${SUPERVISOR_TOKEN}\r\n" >&3
  echo -ne "Content-Length: $(echo -ne "${reqBody}" | wc -c)\r\n" >&3
  echo -ne "\r\n" >&3
  echo -ne "${reqBody}" >&3
  timeout=5
  debug=false
  if ${debug}; then
    while read -t "$timeout" -r line; do
      echo "$line"
    done <&3
  fi
  exec 3>&-
}

Keeping in mind that we are trying to avoid using binaries when possible, this method is technically superior.

If you add this repo, not the adamoutler/addons repo, then you can get your sensor back now. The problem is it is both updating the sensor, and causing an error in the supervisor with each tick.

23-08-09 19:46:17 ERROR (MainThread) [supervisor.homeassistant.api] Error on call http://172.30.32.1:8123/api/states/sensor.argon_one_addon_fan_speed: [Errno None] Can not write request body for http://172.30.32.1:8123/api/states/sensor.argon_one_addon_fan_speed
23-08-09 19:46:17 ERROR (MainThread) [supervisor.api.proxy] Error on API for request states/sensor.argon_one_addon_fan_speed

I'll work on it tomorrow about this time. I spent most of today debugging for changes in the build system environment since the last build.

@adamoutler
Copy link
Owner

Anyone using this repository should try updating to version 30a AFTER these checks pass and the build system gives a green light. https://github.com/adamoutler/HassOSArgonOneAddon/actions/runs/5825999372

I'll push to the production repo, adamoutler/addons later tonight assuming no problems. Let me know about your results in ArgonOne, ArgonOne Classic, and ArgonOne Linear.

@adamoutler
Copy link
Owner

Green light, go!

@Yorkie71
Copy link

Just updated the package and now I see the entity is listed. Nice work. Thanks.

@pascalkrielen
Copy link
Author

Same here, updated to 30a and it is back, thanks @adamoutler

@fra-bri
Copy link

fra-bri commented Aug 11, 2023

It's all right now. After the update it works as expected. Many Thanks you act so quick.

@candyman2903
Copy link

candyman2903 commented Aug 13, 2023

works again. Thanks

@adamoutler
Copy link
Owner

Great! Having problems with pushing to production automatically

@jackelmore
Copy link

Amazing - THANK YOU! This add-on rocks and I am so glad to have the entity back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants