Domoticz uptime on the dashboard. Topic is solved
Moderators: leecollings, remb0
Domoticz uptime on the dashboard.
It would be nice to have a Domoticz "uptime" on the dashboard.
If there is a problem with Domoticz I use monit to restart Domoticz.
By the "uptime" I could figure out if that happened recently and have to investigate why the restart took place.
If there is a problem with Domoticz I use monit to restart Domoticz.
By the "uptime" I could figure out if that happened recently and have to investigate why the restart took place.
Re: Domoticz uptime on the dashboard.
Uptime will only show you how long ago domoticz was restarted for the last time. What if this happend more times?
You can get more information from the monit log file /var/log/monit.log
You can get more information from the monit log file /var/log/monit.log
Re: Domoticz uptime on the dashboard.
I use the HTML interface daily and Domoticz is running fine for days or even weeks.
I would like to see on the interface if there was a restart.
If I see a recent restart then I could investigate monit.log and others for the reason of the restart.
Now I have to check monit.log every once in a while (or daily) and find out there there where a lot of restarts 5 days ago.
I would like to see on the interface if there was a restart.
If I see a recent restart then I could investigate monit.log and others for the reason of the restart.
Now I have to check monit.log every once in a while (or daily) and find out there there where a lot of restarts 5 days ago.
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: Domoticz uptime on the dashboard.
Or have monit send you a message with Pushover? There's a very easy script for that (just google monit and pushover).
Works like a charm for me
Works like a charm for me

homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
-
- Posts: 59
- Joined: Tuesday 07 October 2014 11:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: stable
- Location: France RA
- Contact:
Re: Domoticz uptime on the dashboard.
hi, add a new text dummy and this script
and chmod +x uptime.sh
Code: Select all
#!/bin/sh
#uptime.sh
pid=`ps -ef |grep 'domoticz -daemon' |grep -v grep |awk '{print $2}'`
updz=`ps -p $pid -o %t | tail -1 | sed -e 's/^[ \t]*//;s/[ \t]*$//' | awk 'sub( "...$", "" )'`
itime=`uptime | awk '{print $1}' | awk 'sub( "...$", "" )'`
min=$(uptime | grep -ci min)
day=$(uptime | grep -ci day)
if [ $min -eq 1 ] ; then
uptime=`uptime | awk '{print $3}'`
uptime2=`uptime | awk '{print $4}'`
elif [ $day -eq 1 ] ; then
uptime=`uptime | awk '{print $3}'`
uptime3=`uptime | awk '{print $5}'`
else
uptime=`uptime | awk '{print $3}'`
fi
curl "http://IPADRESS:PORT/json.htm?type=command¶m=udevice&idx=TEXTIDX&nvalue=0&svalue="$itime"%2c%20up%20"$uptime"%20"$uptime2"-"$uptime3"%20Dz%20"$updz""
RPi2 + RFLink, Domoticz
Chacon - micromodule 200w, remote 3b, 2x module 1000w, remote 16b, smoke detector, door contact, 2x 3500w plug
Oregon - 3x Thgr122Nx / OWL - CM180 / TRC02_2 RGB / Cheap - PiR, door contact, Temp Hum / 4x REVOLT NC5461
Chacon - micromodule 200w, remote 3b, 2x module 1000w, remote 16b, smoke detector, door contact, 2x 3500w plug
Oregon - 3x Thgr122Nx / OWL - CM180 / TRC02_2 RGB / Cheap - PiR, door contact, Temp Hum / 4x REVOLT NC5461
Re: Domoticz uptime on the dashboard.
I use telegram, and thats works perfectly. I know.
BUT. recently Domoticz was restarted frequently so I got a lot of alerts.
So thats why I suggest an "uptime" on the dashbord.
In my opinion it does not hurt anybody to add such a feature.
EDIT:
The above script is a good solution too (thanks), but takes up the place of a button on the dashboard.
BUT. recently Domoticz was restarted frequently so I got a lot of alerts.
So thats why I suggest an "uptime" on the dashbord.
In my opinion it does not hurt anybody to add such a feature.
EDIT:
The above script is a good solution too (thanks), but takes up the place of a button on the dashboard.
-
- Posts: 45
- Joined: Tuesday 26 May 2015 22:49
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Argentina
- Contact:
Re: Domoticz uptime on the dashboard.
this is my script for uptime
#!/bin/bash
pid=`ps -ef |grep "domoticz -daemon -www"|grep -v grep |awk '{print $2}'`
updz=`ps -p $pid -o %t | tail -1 | sed -e 's/^[ \t]*//;s/[ \t]*$//'`
val=$(echo ${updz/-/day(s)%20})
curl -s "http://IP:PORT/json.htm?type=command¶m=udevice&idx=100&nvalue=3&svalue=$val" > /dev/null
I use a TEXT sensor for display the value
#!/bin/bash
pid=`ps -ef |grep "domoticz -daemon -www"|grep -v grep |awk '{print $2}'`
updz=`ps -p $pid -o %t | tail -1 | sed -e 's/^[ \t]*//;s/[ \t]*$//'`
val=$(echo ${updz/-/day(s)%20})
curl -s "http://IP:PORT/json.htm?type=command¶m=udevice&idx=100&nvalue=3&svalue=$val" > /dev/null
I use a TEXT sensor for display the value
Razberry + 4 Eversrping HSM02 + 2 Aeotec Multi-Sensor + 1 Aeotec Micro Dimmer + 4 Aeotec Micro Smart Energy Switch, 2nd + 1 Remotec ZXT-120 + 1 Aeotec Smart Energy Monitor + 1 Everspring SE812 indoor Siren + 2 fibaro motion sensor + Aeotec water sensor
Re: Domoticz uptime on the dashboard.
Hi,
Tnx, for the sensor script.
Found it in Setup -> About.
Thats good for me too.
Was it always there?
Tnx, for the sensor script.
Found it in Setup -> About.
Thats good for me too.
Was it always there?
- gizmocuz
- Posts: 2548
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Domoticz uptime on the dashboard.
No, it was added a few days ago (did not know about this thread... so it was a coincidence 

Quality outlives Quantity!
-
- Posts: 370
- Joined: Monday 05 October 2015 10:16
- Target OS: -
- Domoticz version:
- Contact:
Re: Domoticz uptime on the dashboard.
The Setup/About is strange.
Running domotics for more dan 16000 days.. Started begin of July
Guess it reads a wrong value...
The script of Pluggin seems correctly reading current pid and runtime of it. As Domoticz will change pid when a restart accurred.
Sent from my D6503 using Tapatalk
Running domotics for more dan 16000 days.. Started begin of July

Guess it reads a wrong value...
The script of Pluggin seems correctly reading current pid and runtime of it. As Domoticz will change pid when a restart accurred.
Sent from my D6503 using Tapatalk
-
- Posts: 370
- Joined: Monday 05 October 2015 10:16
- Target OS: -
- Domoticz version:
- Contact:
Re: Domoticz uptime on the dashboard.
Found it and checked it... However this is what About says:gizmocuz wrote:No, it was added a few days ago (did not know about this thread... so it was a coincidence
Code: Select all
About Domoticz
Version: 2.3530
Build Hash: 9eef872
Compile Date: 2015-11-01 11:41:18
Uptime: 16755 Dagen, 19 Uren, 39 Minuten, 55 Seconden
Seems that the format isn't correct or using some other timecode/timesource.
According to uptime:
Time 20:48:40 up 9 days 7:29, 3 users...
9 days 7 hours 29 minutes comes close to restart around 14.00h.
Sent from my D6503 using Tapatalk
- proohu01
- Posts: 95
- Joined: Friday 17 October 2014 12:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: Domoticz uptime on the dashboard.
Is there a way to use this uptime value into a LUA script variable?
I have a couple of switches that send me a picture using Telegram. I alway get a lot of messages when the system is rebooted or when I update (restart) Domoticz. I would like to be able to change my LUA scripts so it doesn't do anything if the uptime is less than a minute.
I have a couple of switches that send me a picture using Telegram. I alway get a lot of messages when the system is rebooted or when I update (restart) Domoticz. I would like to be able to change my LUA scripts so it doesn't do anything if the uptime is less than a minute.
Pi 2 B | Pi Camera | PiFace 2 | RFXtrx433E (KaKu + Oregon Scientific) | Plugwise (9 Circles) | Aeon Z-Wave stick (Fibaro - dimmers, sockets, RGB, screens/blinds) | RFXMeter (Kwh/water/gaz) | WOL | Onkyo Receiver | RTC | Hikvision | Netatmo | Satel Integra
-
- Posts: 14
- Joined: Wednesday 11 March 2015 14:03
- Target OS: Linux
- Domoticz version: 2024.2
- Location: Norway
- Contact:
Re: Domoticz uptime on the dashboard.
I want to know about this to.
UptimeInMinutes or similar would be a nice feature.
UptimeInMinutes or similar would be a nice feature.
- proohu01
- Posts: 95
- Joined: Friday 17 October 2014 12:20
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: The Netherlands
- Contact:
Re: Domoticz uptime on the dashboard.
A standard method would be a very nice addition indeed? Any chance of getting this into Domoticz as a feature? UptimeInMinutes sound good to me.
In the meantime, I cooked up some lua code that works for me now...
In the meantime, I cooked up some lua code that works for me now...
Code: Select all
commandArray = {}
n = os.tmpname ()
os.execute ("var=$(ps -eo pid,args |grep 'domoticz -daemon' | grep -v grep |awk '{print $1}') && echo $(($(cut -d '.' -f1 /proc/uptime) - $(($(cut -d ' ' -f22 /proc/$var/stat)/100)))) > " .. n)
for line in io.lines (n) do
UptimeInSeconds = line
end
os.remove (n)
UptimeInSeconds = tonumber(UptimeInSeconds);
-- print('Domoticz has been running for '.. UptimeInSeconds .. ' seconds')
if UptimeInSeconds < 90 then
print('Domoticz uptime is less than 90 seconds')
commandArray['SendNotification']='Domoticz uptime is less than 90 seconds'
end
return commandArray
Pi 2 B | Pi Camera | PiFace 2 | RFXtrx433E (KaKu + Oregon Scientific) | Plugwise (9 Circles) | Aeon Z-Wave stick (Fibaro - dimmers, sockets, RGB, screens/blinds) | RFXMeter (Kwh/water/gaz) | WOL | Onkyo Receiver | RTC | Hikvision | Netatmo | Satel Integra
-
- Posts: 51
- Joined: Tuesday 22 April 2014 22:17
- Target OS: OS X
- Domoticz version: Beta
- Location: France
- Contact:
Re: Domoticz uptime on the dashboard.
Hello,
Why not adding a counter device for uptime in motherboard sensors?
It would be quite simple, can be used with blocky/scripts, and would have an history
.
Why not adding a counter device for uptime in motherboard sensors?
It would be quite simple, can be used with blocky/scripts, and would have an history

Who is online
Users browsing this forum: No registered users and 1 guest