HassOSArgonOneAddon icon indicating copy to clipboard operation
HassOSArgonOneAddon copied to clipboard

sensor.argon_one_addon_fan_speed entity not created (anymore)

Open pascalkrielen opened this issue 1 year ago • 19 comments

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.

pascalkrielen avatar Aug 06 '23 10:08 pascalkrielen

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

Yorkie71 avatar Aug 09 '23 10:08 Yorkie71

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 `

fra-bri avatar Aug 09 '23 11:08 fra-bri

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

MrYohji avatar Aug 09 '23 11:08 MrYohji

Not sure how to handle this. I cannot reproduce.

adamoutler avatar Aug 09 '23 15:08 adamoutler

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.

jweston2112 avatar Aug 09 '23 16:08 jweston2112

I have lost the speed sensor too.

mcfarlde avatar Aug 09 '23 18:08 mcfarlde

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 avatar Aug 09 '23 19:08 adamoutler

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.

adamoutler avatar Aug 09 '23 19:08 adamoutler

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

Yorkie71 avatar Aug 09 '23 19:08 Yorkie71

Yes, thanks for looking into it so quickly. The use of ChatGPT is intriguing.

On Aug 9, 2023, at 1:28 PM, Yorkie71 @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/adamoutler/HassOSArgonOneAddon/issues/61#issuecomment-1672022137, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHOJDTKJ4RVQW56XONCRN23XUPQELANCNFSM6AAAAAA3F2HVEQ. You are receiving this because you commented.

mcfarlde avatar Aug 09 '23 20:08 mcfarlde

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 avatar Aug 09 '23 23:08 adamoutler

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 avatar Aug 10 '23 20:08 adamoutler

Green light, go!

adamoutler avatar Aug 10 '23 20:08 adamoutler

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

Yorkie71 avatar Aug 10 '23 22:08 Yorkie71

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

pascalkrielen avatar Aug 11 '23 06:08 pascalkrielen

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

fra-bri avatar Aug 11 '23 13:08 fra-bri

works again. Thanks

candyman2903 avatar Aug 13 '23 18:08 candyman2903

Great! Having problems with pushing to production automatically

adamoutler avatar Aug 13 '23 19:08 adamoutler

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

jackelmore avatar Aug 15 '23 14:08 jackelmore