Hi,
Just wanted to say that this is a great add-on. I have been trying to perform actions and update sensors from my ZFS Server to no avail.
Then I stumbled upon this and had my sensors up and running within minutes.
Fantastic,
Much appreciated
Hi,
Just wanted to say that this is a great add-on. I have been trying to perform actions and update sensors from my ZFS Server to no avail.
Then I stumbled upon this and had my sensors up and running within minutes.
Fantastic,
Much appreciated
Yay, this is exactly what I was looking for! Thanks a lot for the add-on, I love it! ![]()
This integration really hits a sweet spot! Iām using it for some parent work - checking and setting TimeKPR time budgets for my kidsā laptops and workstations (okay, typically āplayā-stations).
One thing I didnāt get to work out: Iāve got a controllable sensor for ātime leftā. However, timekpr gives me times in seconds - and Iād like (my wife) to be able to enter times in minutes. I tried using @{value * 60} and tinkered with templates but to no real avail. Thereās probably a simple solution⦠could anyone help?
Just discovered this integration and Iām very excited to use it, as it will solve one of my long lasting problems - quick turning on/off port forwarding on my router, that can only be done either via GUI (requires to expose it to internet
) or via SSH CLI, that is troublesome due to login requirementā¦
So I installed integration and configured my router as first device⦠and got stuck. Not really sure how to configure properly this integration to perform what I want.
Command to turn on appropriate open port policy on my router is:
srv nat openport 1 1 -a 1
To turn it it off:
srv nat openport 1 1 -a 0
To get state of policy I use:
srv nat openport 1 1 -v
and it provides output:
%% Status: Disable
%% Comment: Remote Desktop
%% WAN Interface: WAN1
%% Private IP address: 192.168.52.32
%% Source ip type: 0
%% Source ip idx: 0
Index Protocal Start Port End Port
*****************************************************************
1. TCP/UDP 3389 3389
2. TCP/UDP 0 0
3. TCP/UDP 0 0
4. TCP/UDP 0 0
5. TCP/UDP 0 0
6. TCP/UDP 0 0
7. TCP/UDP 0 0
8. TCP/UDP 0 0
9. TCP/UDP 0 0
10. TCP/UDP 0 0
So based on this information I created following configuration for my router, within SSH integration:
Action commands:
- command: srv nat openport 1 1 -a 1
name: Turn RDP On
- command: srv nat openport 1 1 -a 0
name: Turn RDP Off
and sensor command:
- command: srv nat openport 1 1 -v
sensors:
- type: text
name: RDP State
value_template: "{{ value.split(': ')[1] }}"
Value template might require some tuning, but for now should be sufficient to get Disable or Enable values.
But none of these does not work. As I look for Router device state it shows all of these entities unavailable:
Have you tried the full path to the srv command?
What you mean by full path? This is exactly what I enter in router console, when connecting from terminal.
If you type find / -name srv what path does it say. Probably /usr/sbin/srv or something
This is not Linux based router, but using custom operating system (DrayOS), so its CLI does not accept any commands, but these defined to manage device⦠Nor, it accepts path in commands. Iām limited to:
HOME-ROUTER> ?
% Valid commands are:
csm ddns dos exit internet ip
ipf log ldap tacacsplus mngt msubnet
object port portmaptime ppa hwaccswap prn
qos hwqos quit show smb srv
switch sys testmail fs upnp usb
vigbrg fullbrg vlan vpn wan hsportal
radius local_8021x wol user appqos nand
apm sfp ethoam ha swm fw_backupmode
cert service dmn
Just found this amazing SSH integration - truly amazing - got it up and running to monitor the temperature of my Coral TPUs in a Frigate Unraid server⦠so coolā¦
Getting the above to work was as simple as modifying an example, very easy to copy that butā¦.
Can someone point me to an example or point me in the correct direction to get the following parsed into ideally four sensors.
.
One for Size, Used, Available, % Used
Any help would be greatly appreciated Thanks and well done on such a great add on
Hello,
I added the following sensor to my server which I added to home-assistant using ssh-integration
The problem I have is that I only see the title of the output and not all the lines ā¦

Output of df -Hl command on server
Filesystem Size Used Avail Use% Mounted on
tmpfs 824M 4.6M 820M 1% /run
efivarfs 132k 87k 40k 69% /sys/firmware/efi/efivars
/dev/sdb2 244G 210G 22G 91% /
tmpfs 4.2G 0 4.2G 0% /dev/shm
tmpfs 5.3M 0 5.3M 0% /run/lock
/dev/sdb1 1.2G 6.5M 1.2G 1% /boot/efi
/dev/sda1 2.0T 153G 1.8T 9% /data/downloads
tmpfs 824M 13k 824M 1% /run/user/1000
any idea?
Thx
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ā
I just installed this great integration and came across the same issue (āupdates availableā sensor showing āunknownā instead of 0). Although I realize we are more than a year later, I share below a workaround I found in case it can still help someone:
Instead of the original syntax
- command: apt-get -s -o Debug::NoLocking=true upgrade |grep -c ^Inst
use this one:
- command: >-
resp=$(apt-get -s -q -o Debug::NoLocking=true upgrade | grep -c ^Inst);echo $resp
Although both (expectedly) show an identical result in the console, for some reason that Iām not smart enough to figure out, only the second variant (that echoes the result through an intermediate variable) will have a 0-value properly imported as 0.
@Kytrix This is super helpful, thanks!
Iāve gotten the āavailable updatesā sensor working nicely using your code (and fixing the zero-updates-shows-as-unknown issue using this trick). But, I keep getting timeout errors when I try to execute the action command.
Specifically when I āpressā the command, Home Assistant waits for a while then gives me a popup:
Failed to perform the action button/press. Execution failed (Timeout during command)
The update command works fine when I manually SSH in, though, leading me to believe that this is an issue that the command just takes longer than some timeout limit that is set somewhere. Is this possible? If so, any ideas how to change the timeout duration?
Additionally, is there a way to force the āavailable updatesā sensor to update immediately after completing the āpackages updateā action command?
Thanks!