2023-08-14 16:34:08.902 DEBUG (MainThread) [custom_components.ssh] frigatessh: /sbin/shutdown -r now => , [‘Call to Reboot failed: Interactive authentication required.’], 1
It does the same from shell. I’ll see if you got your command right.
— edit
Right!!
I now understand. This file creates the possibility to execute an elevated command without entering the password. I’ll edit the command in the integration. thanks
Hi
I have installed the integration for connecting to a windows device via SSH. The integration connected well but all sensors are in unknown state except Network Status and SSH Status, that show Connected.
Additionally the Power command is disabled. I think this is on purpose as I read the documentation but I do know how to enable it.
I also have a Docker container running a voice inference server (that uses the GPU).
I can get lots of info out of the log in real time using this command
docker logs --follow 6c3f7e83827b
Now the hard part… I want to extract the variable length sentence
“Tell me a story that takes lots of GPU cycles to infer.” from the logs:
[2023-12-08 23:39:52 +0000] [99] [DEBUG] WHISPER: ASR transcript: Tell me a story that takes lots of GPU cycles to infer.
[2023-12-08 23:39:52 +0000] [99] [DEBUG] WHISPER: Inference took 593.489 ms
[2023-12-08 23:39:52 +0000] [99] [DEBUG] WHISPER: Inference speedup: 9x
The beginning delimiter is “transcript:” and the end is [ on the next line.
I’ve tried piping the output of the ‘docker logs’ command to get the Inference speedup number with
But, it doesn’t seem like that command allows piping. I also tried sending it to a file with
docker logs --tail 1 6c3f7e83827b > file.out
but that file was empty.
If I can find the right command to extract the info from the last 3 lines in the log and isolate the info when running the command, I can create sensors that show the values. Heres an example of the command that isolates the GPU Memory used:
I have added your sensors. Thanks for that! Haven’t been able to test the update button yet since there are no updates ;-). Unfortunately I cannot seem to get the sensor going. It keeps reporting Unknown. When I execute the command inside the regular SSH putty window it reports 0. Any clue? Using Bookworm debian on raspi 4.
This is honestly exceptional work. I couldn’t figure it out for the life of me how to send commands to turn off an external display (remote lovelace dashbaord connect to a pi). Your integration helped solve that in literal minutes. Now I can attach a motion sensor to turn on/off a monitor. Amazing stuff! Thanks so much
To answer my own question, it reports unknown when there are No updates available. When there are, it’ll report a number. It would be great if it would report 0 instead of ‘unknown’, but don’t know how to do that.
Hey hopefully this integration is still maintained, I just moved over to this from SSH Sensor, which hasn’t been maintained for three years and stopped working with 2024.7.0.
Anyway I had to slightly rewrite one of my sensors (uptime) moving from that unmaintained sensor. Here it is, if it helps!
- command: uptime -s
scan_interval: 60
sensors:
- type: text
name: uptime
key: uptime
value_template: >-
{%- set line = value.split("\r\n")[0] -%}
{%- set lastboot = as_timestamp(strptime(line, "%Y-%m-%d %H:%M:%S")) -%}
{%- set now = as_timestamp(now()) -%}
{%- set uptime = now - lastboot | int -%}
{%- set years = uptime // 31536000 -%}
{%- set months = (uptime % 31536000) // 2592000 -%}
{%- set days = (uptime % 2592000) // 86400 -%}
{%- set hours = (uptime % 86400) // 3600 -%}
{%- set minutes = (uptime % 3600) // 60 -%}
{{ '%dy ' % years if years else '' }}{{ '%dm ' % months if months else '' }}{{ '%dd ' % days if days else '' }}{{ '%dh ' % hours if hours else '' }}{{ '%dm ' % minutes if minutes else '' }}
I know that the host (192.168.1.202) is not down and that it is reachable from homeassistant because I can ssh to it manually from a terminal when I’m using Home Assistant Community Add-on: SSH & Web Terminal.