I just followed these steps provided by @ZzetT.
and
I used this until 2 days ago when I suddenly started getting these responses:
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
Anyone have any clues as to why this suddenly started happening?
Given the timing that might be related to the Lets Encrypt thingy (donāt know the proper term) expiring DST Root CA X3 Expiration (September 2021) - Let's Encrypt
Yeah that seems to be itā¦
The xprintidle
solution from martokk is awesome, simple and very versatileā¦ except for a tiny issue: getting SSH to run properly from the command_line
integration seems to be a nightmare (sample complaint post from 2020).
ssh
sshpass
in HA CoreOther solutions Iām leaning towards:
xprintidle
whenever a given page is requestedā¦ so somehow HA can pick that up through, idk, curl? Nonetheless, thatās a lot of work which could be simply done via SSH lol
crontab -e
; then add */1 * * * * DISPLAY=:0 xprintidle 2>&1 > /var/www/html/xprintidle.txt
<? passthru('xprintidle');
) because that process wonāt be executed by your actual user lolcommand_line
integration to HA which runs curl my-desktop-ip/xprintidle.txt
Dirtiest solution possible, butā¦ thatās what we have to put up with sometimes around Home Assistant āuser-friendlyā configurations? lolTo all my fellow Linux users ending up on this thread, I published a Python package to PyPI that allows you to report idleness to Home Assistant thanks to the HTTP integration.
I donāt like xprintidle for a very simple reason, I donāt want Home Assistant to think Iām idle while Iām watching videos (and therefore not using mouse or keyboard). My script is based on xidlehook which listens to PulseAudio events to make sure youāre not considered idle if your computer outputs audio.
Check it out : GitHub - ShellCode33/HASS-Desktop-Sensor: Desktop activity sensor for Home Assistant
Other user of IOT Link here. Very simple integration, I used the idle_time sensor to turn off my external audio amplifier after 10 min of inactivity. The automation would be better with a mmWave presence sensor like the Aquara FP1, but Iāve been spending too much on Home Assistant toys lately
Automation:
alias: SMSL off when PC idle
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.my_computer_idle_time
above: 600
action:
- service: remote.send_command
data:
device: smsl_ad18
command: power
target:
entity_id: remote.rm4c_mini_remote
mode: single
configuration.yaml:
mqtt:
sensor:
- name: "My Computer - Idle Time"
state_topic: "iotlink/workgroup/silent-desktop/windows-monitor/stats/system/idle-time"
unit_of_measurement: "seconds"
icon: mdi:timer
value_template: "{{ value }}"
availability_topic: "iotlink/workgroup/silent-desktop/lwt"
payload_available: "ON"
payload_not_available: "OFF"
qos: 1
Sorry for the necrobump, but thank you very much for this clever and well documented solution!