Open Bram-diederik opened 2 years ago
what's your hacompanion config?
Is your service running the whole time?
[homeassistant]
# Generate the token on the /profile page in Home Assistant
token = mytoken
# The display name of your device in Home Assistant
device_name = "mylaptop"
# Enter the full URL of your Home Assistant instance.
host = "https://mydomain:443"
[companion]
# New sensor values are sent to Home Assistant at this interval.
update_interval = "15s"
# The location, where all registration information for Home Assistant will be stored on your machine.
# You do not need to change this.
registration_file = "~/.config/hacompanion-registration.json"
[notifications]
# Where Home Assistant should send notifications to. Make sure to insert your
# local IP address here. Make sure the port is the same as in the `listen` setting below.
push_url = "http://mylaptophostname:8080/notifications"
# The IP and Port where the Notification server on your machine will listen.
# By default listens on port 8080 on all interfaces.
listen = "0.0.0.0:8080"
##
## Below are all available senors. Enable/Disable them as needed.
##
# Report the number of processes that are currently accessing your webcam.
# This will send the number as reported by `lsmod | grep uvcvideo`.
[sensor.webcam]
enabled = true
name = "Webcam Process Count"
# Report the CPU temperature of all cores.
# Note: Requires `lm-sensors` package to be installed locally.
[sensor.cpu_temp]
enabled = true
name = "CPU Temperature"
meta = { celsius = true }
# Report the CPU usage of all cores.
[sensor.cpu_usage]
enabled = true
name = "CPU Usage"
# Report the current system uptime since last boot.
[sensor.uptime]
enabled = true
name = "Last Boot"
# Report the current memory/swap usage.
[sensor.memory]
enabled = true
name = "Memory"
# Report the current battery charge.
# In case of multiple batteries, you can set which battery to monitor
# in the meta section. To see available batteries run
# `ls /sys/class/power_supply/`
[sensor.power]
enabled = true
name = "Power"
meta = { battery = "BAT0" }
# Report if the companion process is running on this machine.
[sensor.companion_running]
enabled = true
name = "Companion Is Running"
# Report if this machine has connection to a remote host.
# You can configure which host to ping in the meta section.
#[sensor.online_check]
#enabled = true
#name = "Is Online"
## Available modes are "http" and "ping".
## meta = { target = "192.168.1.1", mode = "ping" }
#meta = { target = "https://google.com", mode = "http" }
# Report the average system load in the last 1m, 5m and 15m.
[sensor.load_avg]
enabled = true
name = "Load Avg"
# Report the audio volume and mute state.
[sensor.audio_volume]
enabled = true
name = "Audio Volume"
## Register a custom sensor that is populated by a custom script.
## See the README for more details on this feature.
# [script.your_custom_script_sensor]
# path = "/path/to/your/script.sh"
## Attributes according to
## https://developers.home-assistant.io/docs/api/native-app-integration/sensors
# name = "Friendly name of your custom sensor"
# icon = "mdi:script-text"
# type = "sensor" # or binary_sensor
## unit_of_measurement = "%"
## device_class = "battery"
[script.Upgradable_packages]
name = "Upgradable Packages"
path = "/usr/local/bin/apt-check.sh"
icon = "mdi:script-text"
type = "sensor"
the laptop does go to sleep.
other sensors do get updated after a sleep of the laptop.
I created a custom script. But it does not refresh to home assistant unless
systemctl --user restart hacompanion
is run.running it local shows expected outcome.