How to monitor your internet connection with virtual custom sensors
Moderator: leecollings
-
- Posts: 147
- Joined: Thursday 13 August 2015 13:36
- Target OS: NAS (Synology & others)
- Domoticz version: beta
- Location: Netherlands
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
Hi ilpier, nice that you have at least output in the txt file.
ok, please check if all the parameters are OK:
port=8080
username=Admin
password=***
host=localhost
pingidx=239
downloadidx=241
uploadidx=240
If that is the case then change:
curl -s -i -H "Accept: application/json" "http://$username:$password@$host:$port/json.htm type=command¶m=udevice&idx=$pingidx&svalue=$ping"
to
curl -s -i -H "Accept: application/json" "http://Admin:***@localhost:8080/json.ht ... svalue=245"
and lets see if the ping on domoticz then get the value 245
ok, please check if all the parameters are OK:
port=8080
username=Admin
password=***
host=localhost
pingidx=239
downloadidx=241
uploadidx=240
If that is the case then change:
curl -s -i -H "Accept: application/json" "http://$username:$password@$host:$port/json.htm type=command¶m=udevice&idx=$pingidx&svalue=$ping"
to
curl -s -i -H "Accept: application/json" "http://Admin:***@localhost:8080/json.ht ... svalue=245"
and lets see if the ping on domoticz then get the value 245
Best regards Bert
Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
-
- Posts: 147
- Joined: Thursday 13 August 2015 13:36
- Target OS: NAS (Synology & others)
- Domoticz version: beta
- Location: Netherlands
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
of course change the *** to your password
Best regards Bert
Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
-
- Posts: 31
- Joined: Friday 24 February 2017 12:01
- Target OS: Windows
- Domoticz version:
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
yes of course i've insert the correct password!
But no,nothing happen in Domoticz with the modify
curl -s -i -H "Accept: application/json" "http://Admin:***@localhost:8080/json.ht ... svalue=245"
But no,nothing happen in Domoticz with the modify
curl -s -i -H "Accept: application/json" "http://Admin:***@localhost:8080/json.ht ... svalue=245"
-
- Posts: 31
- Joined: Friday 24 February 2017 12:01
- Target OS: Windows
- Domoticz version:
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
Now Work,reboot and work with first:
curl -s -i -H "Accept: application/json" "http://$username:$password@$host:$port/json.htm type=command¶m=udevice&idx=$pingidx&svalue=$ping"
Thx too much!
curl -s -i -H "Accept: application/json" "http://$username:$password@$host:$port/json.htm type=command¶m=udevice&idx=$pingidx&svalue=$ping"
Thx too much!
-
- Posts: 147
- Joined: Thursday 13 August 2015 13:36
- Target OS: NAS (Synology & others)
- Domoticz version: beta
- Location: Netherlands
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
Good to hear, lots of fun with it!ilpier wrote:Now Work,reboot and work with first:
curl -s -i -H "Accept: application/json" "http://$username:$password@$host:$port/json.htm type=command¶m=udevice&idx=$pingidx&svalue=$ping"
Thx too much!
Best regards Bert
Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
-
- Posts: 5
- Joined: Sunday 13 November 2016 10:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Brisbane, Australia
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
I'm really happy with the speed monitoring, it's been running since last year.
Download speed:
(Big drop off in speed moving from Hamburg, Germany to Brisbane, Australia)
Ping:
Download speed:
(Big drop off in speed moving from Hamburg, Germany to Brisbane, Australia)
Ping:
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
Glad you like itvisser wrote:I'm really happy with the speed monitoring, it's been running since last year.
I never expected my simple script would attract such a large audience haha
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
- gielie
- Posts: 290
- Joined: Tuesday 12 January 2016 11:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest β
- Location: The Netherlands (Alkmaar)
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
@safi
Tanks for the script, i changed it a little bit to use it on my Synology and send the data to my Domoticz Pi. Works great. Now to monitor my Ziggo account so i can complain about the slow speeds.
Tanks for the script, i changed it a little bit to use it on my Synology and send the data to my Domoticz Pi. Works great. Now to monitor my Ziggo account so i can complain about the slow speeds.
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
- gielie
- Posts: 290
- Joined: Tuesday 12 January 2016 11:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest β
- Location: The Netherlands (Alkmaar)
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
gielie wrote:@safi
Tanks for the script, i changed it a little bit to use it on my Synology and send the data to my Domoticz Pi. Works great. Now to monitor my Ziggo account so i can complain about the slow speeds.
ps. Is it possible to create a report from the log?
- Aeon Labs USB Stick met Z-wave plus
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
- Aeotec MultiSensor 6
- FIBARO FGS223
- FIBARO FGWPE Wall Plug
- Neo CoolCam Power plug
- Popp Smoke Detector
- Toon
- Kodi Media Server
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
What do you mean?gielie wrote:ps. Is it possible to create a report from the log?
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
-
- Posts: 390
- Joined: Wednesday 30 November 2016 11:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
hi guys, I had it running well on my synology NAS unitll I decided To reinstall my NAS.
is there a chance anyone can help me out how to install it on my nas?
I already put the two files in a folder but I also need to install it am totaly lost.
Thx in advance!
is there a chance anyone can help me out how to install it on my nas?
I already put the two files in a folder but I also need to install it am totaly lost.
Thx in advance!
-
- Posts: 147
- Joined: Thursday 13 August 2015 13:36
- Target OS: NAS (Synology & others)
- Domoticz version: beta
- Location: Netherlands
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
When someone search how to install on Synology --> this might be helpfulEdwinK wrote: ↑Tuesday 18 April 2017 19:54 Running this on a Synology NAS too, and had it working in matter of minutes.
Synology doesn't have apt-get, so you need to find another way to get the files. I used easy_install, but can't quite remember how I did install that.
Search for easy_install and Synology on the Google.
https://pypi.python.org/pypi/speedtest-cli/
Best regards Bert
Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
-
- Posts: 147
- Joined: Thursday 13 August 2015 13:36
- Target OS: NAS (Synology & others)
- Domoticz version: beta
- Location: Netherlands
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
Sorry for the late replyTrigun wrote: ↑Wednesday 26 July 2017 22:00 hi guys, I had it running well on my synology NAS unitll I decided To reinstall my NAS.
is there a chance anyone can help me out how to install it on my nas?
I already put the two files in a folder but I also need to install it am totaly lost.
Thx in advance!
Try this to download speedtest-cli --> https://pypi.python.org/pypi/speedtest-cli/
and follow this wiki --> https://www.domoticz.com/wiki/Bash_-_Sp ... monitoring
Let me know where you get stucked when you are not successful, but i think you will
Best regards Bert
Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
-
- Posts: 129
- Joined: Saturday 01 October 2016 14:48
- Target OS: Raspberry Pi / ODroid
- Domoticz version: LastBeta
- Location: Italy BG
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
Hi, it is possible send the result of the test with telegram in a bot ?
Master (pi3) - MB sensors + Dummy + Sysfs gpio + 1 NodOn MSP-3 + 1 Aeotec DSB28 Energy Meter + 3 Danfoss RS Room + 7 Danfoss Z Thermostat + 1 Swiid Inter + 9 FGS222
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
-
- Posts: 204
- Joined: Thursday 05 September 2013 15:39
- Target OS: Linux
- Domoticz version: LastBeta
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
Yes.guantolento wrote: ↑Tuesday 05 September 2017 23:45 Hi, it is possible send the result of the test with telegram in a bot ?
Use the search function, there's alot of information about that in countless threads on how to do that.
Good luck!
homebridge, rfxcom, zwave, nest, applamp, hue, debian, apple, mysensors, netatmo, fibaro, synology, foscam, otherz
-
- Posts: 390
- Joined: Wednesday 30 November 2016 11:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
hi all, I finally managed to install speedtest on my synology.
when I run speedtest-cli I get results.
but when I try to run the script, it doesn't work.
when I run I get the following errors: Line 2 and line 11 are empty lines.
strange thing is that I do get an "output.txt" file, but nothing in domoticz.
can anyone help me out here?
when I run speedtest-cli I get results.
but when I try to run the script, it doesn't work.
when I run I get the following errors: Line 2 and line 11 are empty lines.
Code: Select all
#!/bin/bash
#setup
host=192.168.1.21
port=8084
pingidx=3
downloadidx=1
uploadidx=2
# no need to edit
speedtest-cli --simple > output.txt
ping=$(cat output.txt | sed -ne 's/^Ping: \([0-9]*\.[0-9]*\).*/\1/p')
download=$(cat output.txt | sed -ne 's/^Download: \([0-9]*\.[0-9]*\).*/\1/p')
upload=$(cat output.txt | sed -ne 's/^Upload: \([0-9]*\.[0-9]*\).*/\1/p')
#output if you run it manually
echo "ping = $ping ms"
echo "download = $download Mbps"
echo "upload = $upload Mbps"
curl -s -i -H "Accept: application/json" "http://$host:$port/json.htm?type=command¶m=udevice&idx=$pingidx&svalue=$ping"
curl -s -i -H "Accept: application/json" "http://$host:$port/json.htm?type=command¶m=udevice&idx=$downloadidx&svalue=$download"
curl -s -i -H "Accept: application/json" "http://$host:$port/json.htm?type=command¶m=udevice&idx=$uploadidx&svalue=$upload"
can anyone help me out here?
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
As far as my knowledge goes \r is a dos<=>unix issue.
Please open the file in a good editor and see your CarageReturns and Linefeed at then end of each line.
Please open the file in a good editor and see your CarageReturns and Linefeed at then end of each line.
-
- Posts: 10
- Joined: Wednesday 25 March 2015 21:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
Hi guys,
I am running this script successfully nowsince 1 year, but yesterday internet connection dropped for 4 hrs (Ziggo storing) and I found out that the last value continues (sensor "last seen" did not change). So, no drop to zero for "download speed" f.i.
What needs to be changed in the script to force a zero value when there is no connection at all ?
thnx, dbfan
I am running this script successfully nowsince 1 year, but yesterday internet connection dropped for 4 hrs (Ziggo storing) and I found out that the last value continues (sensor "last seen" did not change). So, no drop to zero for "download speed" f.i.
What needs to be changed in the script to force a zero value when there is no connection at all ?
thnx, dbfan
-
- Posts: 390
- Joined: Wednesday 30 November 2016 11:58
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.10717
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
Hi freijn,
i am using an exact copy of the script being used(with my own info)
not sure where it goed wrong, Ik keep getting the error.
the result is that I do get an output.txt file but no data is send to domoticz
Grtz
-
- Posts: 536
- Joined: Friday 23 December 2016 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Netherlands Purmerend
- Contact:
Re: How to monitor your internet connection with virtual custom sensors
Hi Trigun,
You wrote "(with my own info)" So you did edit the file and therefore changed it.
please read this :
https://stackoverflow.com/questions/186 ... -not-found
or search in Google on your error message : '\r': command not found [duplicate]
What OS system are you using edditing the file?
You could put the ORIGINAL ! file on the domoticz system and start editing using nano.
Doing so I am 100% you will not see this '\r' error again
Cheers,
Frank
You wrote "(with my own info)" So you did edit the file and therefore changed it.
please read this :
https://stackoverflow.com/questions/186 ... -not-found
or search in Google on your error message : '\r': command not found [duplicate]
What OS system are you using edditing the file?
You could put the ORIGINAL ! file on the domoticz system and start editing using nano.
Doing so I am 100% you will not see this '\r' error again
Cheers,
Frank
Who is online
Users browsing this forum: No registered users and 0 guests