Closed Jay2645 closed 1 month ago
Hey there, thanks for trying out Go Hass Agent! That's no good that it isn't working, this is odd!
Can you try the following:
~/.config/go-hass-agent
.Let me know how the above steps work out.
This is an interesting problem. The hostname change shouldn't stop Go Hass Agent from working correctly. But it will likely result in multiple entries in the Mobile App integration in Home Assistant (Step 3 above), or a doubling up of sensor entities in a single entry (with the new sensors prefixed with the new hostname that report values and old sensors with the old hostname no longer reporting values).
Its very odd for Go Hass Agent to successfully register but then not write anything to its local registry (the sensor.reg
file) without reporting errors. But before digging in on that, I am curious about the results of the steps above for resetting the agent locally and in Home Assistant then re-registering.
Thanks also for reporting that issue with the container images. It looks like I need to make some changes after the recent releases for the container builds!
Hi, yes, hello!
I tried that earlier - it's the same result. Completely clearing the entire Mobile App device and redoing everything from scratch didn't seem to affect anything.
Full console:
jay@Bomu-Bazzite:~$ go-hass-agent version
Go Hass Agent: v10.1.0
jay@Bomu-Bazzite:~$ go-hass-agent register --token <snip> --server http://192.168.86.223:8123 --log-level debug
Sep 3 12:53:48.351 DEBUG Setting language. lang=[en-US]
Sep 3 12:53:48.715 INFO Agent registered.
jay@Bomu-Bazzite:~$ go-hass-agent run
Sep 3 12:54:38.222 DEBUG Setting language. lang=[en-US]
Sep 3 12:54:38.222 DEBUG Read sensor registry from disk. file=sensor.reg
Sep 3 12:54:38.225 WARN Could not start a sensor worker. linux.controller=sensor error="unable to monitor location updates: unsupported hardware"
Sep 3 12:54:38.225 WARN Could not start a sensor worker. linux.controller=sensor error="unable to monitor laptop sensors: unsupported hardware"
Sep 3 12:54:38.225 DEBUG Processing sensor updates.
Sep 3 12:54:38.226 WARN Sensor not found in registry. sensor_id=agent_version
Sep 3 12:54:38.226 WARN Sensor not found in registry. sensor_id=agent_version
Sep 3 12:54:38.226 WARN Unable to retrieve sensors. worker=abrt_problems_sensor worker_type=polling error="unable to retrieve the list of ABRT problems: SystemBus: unable to get data org.freedesktop.problems.GetProblems from org.freedesktop.problems: The name is not activatable"
Sep 3 12:54:38.226 WARN Sensor not found in registry. sensor_id=memory_free
Sep 3 12:54:38.226 WARN Sensor not found in registry. sensor_id=memory_corrupted
Sep 3 12:54:38.226 WARN Sensor not found in registry. sensor_id=memory_corrupted
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=memory_buffered
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=memory_buffered
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=memory_cached
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=memory_cached
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=memory_free
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=swap_total
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=swap_total
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=zram0_disk_reads
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=zram0_disk_reads
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=swap_cached
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=swap_cached
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=zram0_disk_write_rate
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=zram0_disk_write_rate
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=swap_free
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=swap_free
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=core_0_cpu_usage
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=core_0_cpu_usage
Sep 3 12:54:38.227 WARN Sensor not found in registry. sensor_id=cpufreq_core1_frequency
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=core_4_cpu_usage
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=core_6_cpu_usage
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=core_6_cpu_usage
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=cpufreq_core10_frequency
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=cpufreq_core10_frequency
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=processes_blocked
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=processes_blocked
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=core_11_cpu_usage
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=core_11_cpu_usage
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=total_processes_created
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=total_processes_created
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=core_2_cpu_usage
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=core_2_cpu_usage
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=core_9_cpu_usage
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=core_9_cpu_usage
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=total_cpu_usage
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=total_cpu_usage
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=core_4_cpu_usage
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=cpufreq_core2_frequency
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=cpufreq_core2_frequency
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=zram0_disk_writes
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=zram0_disk_writes
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=zram0_disk_read_rate
Sep 3 12:54:38.228 WARN Sensor not found in registry. sensor_id=zram0_disk_read_rate
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=core_1_cpu_usage
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=core_1_cpu_usage
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core0_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core0_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=core_3_cpu_usage
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core3_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core4_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=core_5_cpu_usage
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core5_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core6_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=core_7_cpu_usage
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core7_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=core_8_cpu_usage
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core8_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=core_10_cpu_usage
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core9_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=total_cpu_context_switches
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core11_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=processes_running
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=processes_running
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core1_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=core_3_cpu_usage
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core3_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core4_frequency
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=core_5_cpu_usage
Sep 3 12:54:38.229 WARN Sensor not found in registry. sensor_id=cpufreq_core5_frequency
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=cpufreq_core6_frequency
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=core_7_cpu_usage
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=cpufreq_core7_frequency
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=core_8_cpu_usage
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=cpufreq_core8_frequency
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=core_10_cpu_usage
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=enp_9_s_0_connection_state
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=enp_9_s_0_connection_state
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=cpufreq_core9_frequency
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=lo_connection_state
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=lo_connection_state
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=total_cpu_context_switches
Sep 3 12:54:38.230 WARN Sensor not found in registry. sensor_id=cpufreq_core11_frequency
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_sysroot
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_sysroot
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_sysroot_ostree_deploy_default_var
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_sysroot_ostree_deploy_default_var
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_run_media_jay_Data
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_run_media_jay_Data
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_usr
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_usr
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_run
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_run
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_var_home
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_var_home
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_dev_shm
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_dev_shm
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_var
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_var
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_etc
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_etc
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_boot
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_boot
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_tmp
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_tmp
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_var_home_jay_.steam
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_var_home_jay_.steam
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_run_user_1000
Sep 3 12:54:38.233 WARN Sensor not found in registry. sensor_id=mountpoint_run_user_1000
Sep 3 12:54:38.234 WARN Sensor not found in registry. sensor_id=mountpoint_run_media_jay_Server
Sep 3 12:54:38.234 WARN Sensor not found in registry. sensor_id=mountpoint_run_media_jay_Server
Sep 3 12:54:38.234 WARN Sensor not found in registry. sensor_id=mountpoint_run_media_jay_HomeAssistant
Sep 3 12:54:38.234 WARN Sensor not found in registry. sensor_id=mountpoint_run_media_jay_HomeAssistant
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_3
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_3
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_5
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_5
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_2
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_2
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_4
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_4
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_7
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_7
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_1
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_1
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_6
Sep 3 12:54:38.238 WARN Sensor not found in registry. sensor_id=hwmon_4_zenergy_energy_6
Sep 3 12:54:38.651 ERROR Process sensor failed. error="%!v(PANIC=Error method: runtime error: invalid memory address or nil pointer dereference)"
...
Sep 3 12:54:43.348 ERROR Process sensor failed. error="%!v(PANIC=Error method: runtime error: invalid memory address or nil pointer dereference)"
^CSep 3 12:54:44.524 WARN Websocket connection closed with error. error="gws: close normal"
Once I was writing this message, I realized that I didn't have the actual log file for you. I tried that one more time just to make sure that I didn't miss anything in the logs during the registration step (I didn't)... but then...
Sep 3 12:58:48.351 DEBUG Setting language. lang=[en-US]
Sep 3 12:58:48.715 INFO Agent registered.
jay@Bomu-Bazzite:~$ go-hass-agent run
Sep 3 13:01:06.955 WARN Could not start a sensor worker. linux.controller=sensor error="unable to monitor location updates: unsupported hardware"
Sep 3 13:01:06.955 WARN Could not start a sensor worker. linux.controller=sensor error="unable to monitor laptop sensors: unsupported hardware"
Sep 3 13:01:06.956 WARN Sensor not found in registry. sensor_id=agent_version
Sep 3 13:01:06.956 WARN Sensor not found in registry. sensor_id=agent_version
Sep 3 13:01:06.956 WARN Sensor not found in registry. sensor_id=uptime
Sep 3 13:01:06.956 WARN Sensor not found in registry. sensor_id=uptime
Sep 3 13:01:06.956 WARN Sensor not found in registry. sensor_id=distribution_name
Sep 3 13:01:06.956 WARN Sensor not found in registry. sensor_id=distribution_name
Sep 3 13:01:06.956 WARN Sensor not found in registry. sensor_id=distribution_version
Sep 3 13:01:06.956 WARN Sensor not found in registry. sensor_id=distribution_version
Sep 3 13:01:06.957 WARN Sensor not found in registry. sensor_id=cpu_load_average_(1_min)
Sep 3 13:01:06.957 WARN Sensor not found in registry. sensor_id=cpu_load_average_(1_min)
Sep 3 13:01:06.957 WARN Sensor not found in registry. sensor_id=bytes_received
Sep 3 13:01:06.957 WARN Sensor not found in registry. sensor_id=bytes_received
Sep 3 13:01:06.957 WARN Sensor not found in registry. sensor_id=last_reboot
Sep 3 13:01:06.957 WARN Sensor not found in registry. sensor_id=last_reboot
Sep 3 13:01:06.958 WARN Sensor not found in registry. sensor_id=cpu_load_average_(15_min)
Sep 3 13:01:06.958 WARN Sensor not found in registry. sensor_id=cpu_load_average_(15_min)
Sep 3 13:01:06.958 WARN Sensor not found in registry. sensor_id=bytes_sent_throughput
Sep 3 13:01:06.958 WARN Sensor not found in registry. sensor_id=bytes_sent_throughput
Sep 3 13:01:06.958 WARN Unable to retrieve sensors. worker=abrt_problems_sensor worker_type=polling error="unable to retrieve the list of ABRT problems: SystemBus: unable to get data org.freedesktop.problems.GetProblems from org.freedesktop.problems: The name is not activatable"
Sep 3 13:01:06.958 WARN Sensor not found in registry. sensor_id=power_state
Sep 3 13:01:06.958 WARN Sensor not found in registry. sensor_id=power_state
...
Sep 3 13:01:07.089 WARN Sensor not found in registry. sensor_id=external_ipv4_address
Sep 3 13:01:07.089 WARN Sensor not found in registry. sensor_id=external_ipv4_address
Sep 3 13:03:17.492 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:03:17.496 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:03:31.253 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:03:58.014 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:04:01.859 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:04:01.861 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:04:01.863 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:04:07.439 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:04:07.441 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:07:02.592 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:07:02.593 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:07:43.153 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:08:14.217 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:09:00.559 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:09:00.561 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:09:17.617 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:09:58.168 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:09:58.449 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:09:58.454 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:10:01.855 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:10:02.279 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:10:02.280 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:10:02.284 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:10:02.285 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:10:02.502 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:10:02.502 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:11:02.225 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:11:02.225 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:11:06.739 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:11:28.170 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
...
Sep 3 13:16:12.548 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:16:18.042 WARN Unable to retrieve sensors. worker=abrt_problems_sensor worker_type=polling error="unable to retrieve the list of ABRT problems: SystemBus: unable to get data org.freedesktop.problems.GetProblems from org.freedesktop.problems: The name is not activatable"
Sep 3 13:16:44.747 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:16:44.770 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:17:01.065 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:17:01.444 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:17:03.988 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:17:03.997 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:17:14.395 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:17:14.515 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:17:14.519 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:18:02.107 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:18:02.107 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:18:02.107 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:18:02.109 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:18:02.110 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:18:02.110 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:18:02.118 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:19:01.279 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:20:15.273 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:20:54.940 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
^CSep 3 13:21:12.748 WARN Websocket connection closed with error. error="gws: close normal"
And it seems to be working?
Mind you, I changed nothing. Not even a computer reboot. You can see in the timestamps that I spent 4 minutes writing this message, decided to try again to grab the actual log files... and it worked? (Kind of, there's those errors at the end.)
Here's the files from the working setup:
Considering I had this working and it randomly failed during a boot, it makes me wonder if there is a race condition somewhere.
Literally the only thing I did between runs is type in this comment window and delete the folder to get clean log files for you at each step!
EDIT: For completeness, I killed it and tried again, and it worked again:
jay@Bomu-Bazzite:~$ go-hass-agent run
Sep 3 13:21:15.160 WARN Could not start a sensor worker. linux.controller=sensor error="unable to monitor location updates: unsupported hardware"
Sep 3 13:21:15.160 WARN Could not start a sensor worker. linux.controller=sensor error="unable to monitor laptop sensors: unsupported hardware"
Sep 3 13:21:15.163 WARN Unable to retrieve sensors. worker=abrt_problems_sensor worker_type=polling error="unable to retrieve the list of ABRT problems: SystemBus: unable to get data org.freedesktop.problems.GetProblems from org.freedesktop.problems: The name is not activatable"
Sep 3 13:21:25.227 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
Sep 3 13:21:25.228 ERROR Process sensor failed. error="failed to send sensor update request: code <nil>: "
I'm not sure if any of this is helpful at all, but it sure is interesting at least...
Thank you for the additional data and confirmation of the steps!.
That is very odd. It could be a race condition. I have made a fair few changes since I last looked for potential race conditions, I will do some more digging. I've hopefully fixed the logging so that those "ERROR Process sensor failed" messages will show more details in the next release (another regression after some changes). Are you noticing any missing sensors or incorrect data in Home Assistant? The first two warnings are expected at least for deskop hardware and the third warning about abrt just means you don't have that configured or being used.
If you are still getting a lot of those messages "ERROR Process sensor failed" messages while running for a while, you could try turning on trace logging by adding --log-level trace
to the command-line. That logging should show more details about any responses from Home Assistant, though the messages may contain more private information (endpoints, tokens, any private information in actual sensor details), so please ensure you check and sanitize them if you wish to share them.
I'm glad it is working though!
I will spin up a Bazzite VM and see if I can reproduce anything similar. It'd be interesting if it was specific to Bazzite or atomic-based distros.
The one I have right now seems to have all its sensors and has been holding up thus far.
When I originally set it up on this distro, it was missing the sensors in my scripts
directory. I had assumed this was my fault at the time and had intentions to poke at it and verify that the scripts were working in the new distro, and that nothing changed between major versions as I had jumped from 9 to 10 when re-installing the agent.
When I was clearing out old entries in the Mobile App integration to try from scratch, I noticed one of the setups was missing roughly half the sensors (it had about 60ish). I don't know which run it was from.
This is my first time seriously using an atomic distro, so it might be something weird with the atomicity of it for sure. Things about this distro continue to surprise (and occasionally frustrate) me.
That said, I had used an older version of Go-Hass-Agent on my Steam Deck without issue, and that's also largely immutable (although Arch-based and not Fedora-based). I don't remember that having issues - but again, there are a number of different variables there.
Thanks for the update @Jay2645 and that's cool to see it working on the steam deck. I'd be curious, is there any other sensors or controls that would be useful on that hardware?
So the main challenge with Steam Deck is that Valve will periodically install a new image when you do a system update, and that wipes the /usr folder.
The suggested solution is to only use Flatpaks, but of course since that's sandboxed it means we don't have access to as much as we could. I believe AppImage might also work (using the Gear Lever Flatpak to run it). And of course if everything is inside your home directory that prevents any issues to begin with.
Otherwise you can install it, but next time the OS updates it will re-image /usr and everything will be wiped (either installed via package or Docker). So a way to manage everything from the user folder, Flatpak, or AppImage would be fantastic.
(I suppose I could just move the executable into my home directory, but it's somewhat awkward to do standard file operations on the Deck because you aren't working with a mouse and keyboard. Being able to press a button and make it work is much easier. Maybe pacman already offers something like this and I just don't know enough about pacman to realize it.)
Also, because you don't go to your desktop by default you need to enable the systemd process so it runs properly in the background when Game Mode is up.
As far as sensors go - I have a handful of ones I wrote myself. I'll hop on the Deck and upload my scripts shortly. Other than the aforementioned update issues, there's not much different from a "regular" Linux install at the end of the day - except for Game Mode (gamescope) which allows the OS to start games without a Desktop Environment (saving resources). I wrote a script to detect Game Mode, although really I haven't done anything useful with this stuff.
Since it can be hooked up to the big screen, being able to turn it on and off is neat - although I enabled ssh and just use the shell_command integration instead of MQTT (simply because I never bothered to set up MQTT on the Deck).
The process using the most CPU (presumably a game, handles non-Steam games):
#!/bin/bash
# Get the process ID of the process using the most CPU
top_process=$(ps -eo pid,%cpu --sort=-%cpu | awk 'NR==2 {print $1}')
# Get the name of the process using the most CPU
top_process_name=$(ps -p "$top_process" -o comm=)
# Create the JSON output
json_output='{
"schedule": "@every 5s",
"sensors": [
{
"sensor_name": "Top CPU Process",
"sensor_icon": "mdi:expansion-card",
"sensor_state": "'"$top_process_name"'"
}
]
}'
# Output the JSON
echo "$json_output"
Game Mode active:
#!/bin/bash
output=$(pgrep gamescope-wl)
# Initialize variables
sensor_state="false"
# Check the length of the output string
if [ ${#output} -gt 0 ]; then
sensor_state="true"
fi
# Create the JSON output
json_output='{
"schedule": "@every 5s",
"sensors": [
{
"sensor_name": "Game Mode",
"sensor_type": "binary",
"sensor_device_class": "power",
"sensor_icon": "mdi:controller",
"sensor_state": '"$sensor_state"'
}
]
}'
# Output the JSON
echo "$json_output"
Process started by Steam (Steam game):
#!/bin/bash
# Find the PID of the steam process
steam_pid=$(pgrep -x steam)
# Function to find the last child process started by reaper
find_last_child_process_of_reaper() {
local parent_pid="$1"
local last_child_pid=""
# Find all child processes of the parent PID in /proc
child_pids=$(pgrep -a -P "$parent_pid" | awk '{print $1}')
for pid in $child_pids; do
# Check if the child process is reaper
if [[ $(cat /proc/"$pid"/comm) == "steam" ]] || [[ $(cat /proc/"$pid"/comm) == "sh" ]] || [[ $(cat /proc/"$pid"/comm) == "reaper" ]] || [[ $(cat /proc/"$pid"/comm) == "pv-bwrap" ]] || [[ $(cat /proc/"$pid"/comm) == "pressure-vessel" ]]; then
# If it's reaper, continue searching in its children
last_child_pid=$(find_last_child_process_of_reaper "$pid")
if [ -n "$last_child_pid" ]; then
# Found a child process started by reaper, so return it
echo "$last_child_pid"
return
fi
break
elif [[ $(cat /proc/"$pid"/comm) != "steamwebhelper" ]] && [[ $(cat /proc/"$pid"/comm) != "steam-runtime-l" ]] && [[ $(cat /proc/"$pid"/comm) != "gameoverlayui" ]]; then
echo "$pid"
fi
done
}
# Call the function to find the last child process of reaper
child_pid_list=$(find_last_child_process_of_reaper "$steam_pid")
last_child_pid=0
# Iterate through each number in the list
for number in $child_pid_list; do
# Compare the current number with the maximum value
if [ "$number" -gt "$last_child_pid" ]; then
last_child_pid="$number"
fi
done
result=""
if [ "$last_child_pid" -gt 0 ]; then
result=$(cat /proc/"$last_child_pid"/comm)
fi
# Create the JSON output
json_output='{
"schedule": "@every 5s",
"sensors": [
{
"sensor_name": "Current Steam Game",
"sensor_icon": "mdi:steam",
"sensor_state": "'"$result"'"
}
]
}'
# Output the JSON
echo "$json_output"
Hey @Jay2645 thank you for the details, that is so cool and interesting! I'm so glad Go Hass Agent is useful to you!
I'll close this issue off for now, as I believe the problem is fixed. If that is not the case, please re-open and we can continue troubleshooting!
Go Hass Agent Version Go Hass Agent: v10.1.0
Describe the bug I just set up a new Linux distro on a machine that was running Go Hass Agent previously (KDE Neon -> Bazzite, based on Fedora Kinoite).
Kinoite/Bazzite is an immutable distribution, but you can layer in packages using
rpm-ostree
, so I set up the latest Go Hass Agent that way.Everything seemed to work okay for several reboots. I was able to see my sensors as expected within Home Assistant on the new distro, and they all updated as I would expect.
Then after a while I noticed that Go Hass Agent wasn't reporting any sensors. I believe it started after I changed my hostname, but I can't actually be sure.
Checking the logs, I saw:
Unable to retrieve sensors. worker=abrt_problems_sensor worker_type=polling error="unable to retrieve the list of ABRT problems: SystemBus: unable to get data org.freedesktop.problems.GetProblems from org.freedesktop.problems: The name is not activatable"
Followed by a bunch of spam in the format:
Sensor not found in registry. sensor_id:<Sensor ID here>
Process sensor failed. error="failed to send sensor update request: code <nil>: Unavailable"
Process sensor failed. error="%!v(PANIC=Error method: runtime error: invalid memory address or nil pointer dereference)"
Rinse and repeat.
If I move
.config/go-hass-agent
to.config/go-hass-agent-bak
and try to redo setup from a "fresh start", I am able to register okay (Sep 1 15:09:04.760 INFO Agent registered.
), and I see the machine in Home Assistant - but trying to run it gives the same issue.I get the same result whether I run via GUI or via terminal. I did notice that
sensorRegistry
is empty except forsensor.reg
which is 0 bytes. Trying the backed-upsensor.reg
doesn't resolve the issue.I'm a little mystified as to what could be causing this behavior. I'm going to try an older build and see if the issues persist there, but wanted to raise this for now.
To Reproduce Steps to reproduce the behaviour:
Expected behaviour Go-Hass-Agent runs without issue
Screenshots
Logs agent.log go-hass-agent.zip
(While I have made efforts to not log sensitive information, please check the log before uploading to GitHub and remove any information you do not want to share).
Desktop (please complete the following information):
Additional context I've also tried the container approach, although that doesn't seem to work for a different reason:
Although that seems to be a different bug altogether :)
Thanks!