I dont see any errors on the nas!
all work fine, just the error in pimatic is anyyoing. I get 300 in 40 minutes When the nas is offline.
Nmap work with a rule every 10 sec. But how can i set a rule with a present dummy? And nmap gives a big notice on the webinterfce when nmap was executed. That doesent look very good. Any other method how it could work?
-
New Plugin for HTTP/HTTPS Service probes
-
@p4co86 OK, I’ll make sure there will be less error logging with the next version of pimatic-probe:
- Instead of logging an error I could perhaps store the error in a variable.
- I could also implement a strategy to avoid logging the same error message over and over again
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
That would be nice. Thanks for that
-
Ive found found a strange behavour. When i use httpprobe in rule and say … is present then it doesent work. Device is shown as present. It looks like tat absent and present are mixed. Any one else can confirm this?
-
@p4co86 Sure?
I have tested this and the following works 100% for me. Make sure you have the latest version of pimatic installed.
// Devices (sp1 is a Switch, basically) { "id": "probe5", "class": "HttpProbe", "name": "WebServer", "url": "http://www.local-server.tld:8080", "enableResponseTime": true, "interval": 10, "maxRedirects": 0, "acceptedStatusCodes": [ 200, 401 ] }, { "id": "sp1", "class": "EdimaxSmartPlug", "name": "Schaltsteckdose", "deviceName": "edimax", "host": "192.168.178.65", "interval": 10 } // Rules { "id": "httpsprobepresent", "name": "httpsProbePresent", "rule": "if WebServer is present then turn on Schaltsteckdose", "active": true, "logging": true }, { "id": "httpsprobeabsent", "name": "httpsProbeAbsent", "rule": "if WebServer is absent then turn off Schaltsteckdose", "active": true, "logging": true }
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
Please note, I have published Version 0.0.5 which solves two issues with probing “https” servers:
- Fixed bug: “Protocol:https: not supported”
- Fixed issue with web server using an untrusted certificate resulting in an “UNABLE_TO_VERIFY_LEAF_SIGNATURE” error. Untrusted cert will be accepted for now. This feature will be configurable with the next release.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
ok thanks, will test it later. it only occurs, when i have a rule like: if Server is present and Movie button is preset that it wouldn`t work. the present alone work. it is not mixed, my fault.
ive not updated jet, when iam back home i will do update and report.
-
Ive tested it. A rule like this works.
If server is present then turn on nachtlampe
A rule like this would not work.
If button movie is pressed and server is present then turn on nachtlampe
so you say it is normal that there will be errors in pimatic when server is offline.
It would be very nice when this could be handled smarter.have updated to 0.0.5
Thanks.
-
@p4co86 just wondering: Did you also test the following?
If button movie is pressed then turn on nachtlampe
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
of course ! this works when i test the and thing with ping plugin it works.
-
@mwittig said: OK, I am just trying to figure out what you’re saying:
- The rule
If button movie is pressed then turn on nachtlampe
is working fine for you - The rule
If server is present then turn on nachtlampe
is working fine ifserver
is aHttpProbe
device. - The rule
If button movie is pressed and server is present then turn on nachtlampe
is also working fine for you ifserver
is aPingPresence
device. - However, the previous does not work, if
server
is aHttpProbe
device.
Can you confirm this?
If yes, I am a bit lost here as the combined expression should work if the single expressions do. I’ll do some more testing on my side, but may be some Pimatic expert else can help as well, please?
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
- The rule
-
Yes! This is the exact behavour
-
@p4co86 ok, thanks. I have done more testing and I have not been able to reproduce the problem. Maybe you have other rules which are conflicting with the rule in question. So it would be helpful if I can perhaps review the complete rule set you have.
NB: I have published V0.0.6 which has reduced error logging
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
this are my rules.
"rules": [ { "id": "autoplay-1live-kuche", "name": "Autoplay 1Live Küche", "rule": "if Multiroom Server is present and Radio button is pressed then execute \"expect -f /root/programme/autoplay.expect\" and log \"klappt\"", "active": true, "logging": true }, { "id": "14", "name": "Anwesenheits", "rule": "if Stefan Handy is present or Cris Handy is present or comming home is on then set temp of thermostat to $Anwesenheitstemperatur", "active": true, "logging": false }, { "id": "13", "name": "Abwesenheit", "rule": "if Cris Handy is absent and Stefan Handy is absent and comming home is off then set temp of thermostat to $Abwesenheitstemperatur", "active": true, "logging": false }, { "id": "18", "name": "Computer pingen", "rule": "if Mein Computer is absent then switch Computer off", "active": true, "logging": false }, { "id": "19", "name": "Computer pingen2", "rule": "if Mein Computer is present then turn Computer on", "active": true, "logging": false }, { "id": "20", "name": "Computer starten", "rule": "if Computer is turned on then execute \"wakeonlan F4:6D:04:D4:A5:0B\"", "active": true, "logging": false }, { "id": "temperatursensor-wohnzimmer", "name": "Temperatursensor Wohnzimmer", "rule": "if temperature of Wohntemperatur was not updated for 1 hour then push title:\"pimatic: Sensoren\" message:\"Die Batterie des Temperatursensors (Wohnzimmer) ist aufgebraucht.\" and set mode of thermostat to \"manu\" and turn off Heizung", "active": true, "logging": false }, { "id": "temperatursensor-schlafzimmer", "name": "Temperatursensor Schlafzimmer", "rule": "if temperature of Schlaftemperatur was not updated for 40 minutes then push title:\"pimatic: Sensoren\" message:\"Die Batterie des Temperatursensors (Schlafzimmer) ist aufgebraucht.\" and set mode of thermostat to \"manu\"", "active": true, "logging": false }, { "id": "temperatur-fallt", "name": "Temperatur fällt", "rule": "if $Wohntemperatur.temperature < $PreviousTemp then $PreviousTemp = $Wohntemperatur.temperature and set $Raumtemperaturtrend to \"fallend\"", "active": true, "logging": false }, { "id": "temperatur-konstant", "name": "Temperatur konstant", "rule": "if $Wohntemperatur.temperature = $PreviousTemp for 1 minutes then $Raumtemperaturtrend to \"konstant\"", "active": true, "logging": false }, { "id": "temperatur-steigt", "name": "Temperatur steigt", "rule": "if $Wohntemperatur.temperature > $PreviousTemp then $PreviousTemp = $Wohntemperatur.temperature and set $Raumtemperaturtrend to \"steigend\"", "active": true, "logging": false }, { "id": "nas-auschalten", "name": "Nas Auschalten", "rule": "if Mein Computer is absent and Media Center is absent for 30 seconds and Media Center Wohnzimmer is absent for 30 seconds and Radio is off for 30 seconds then execute \"expect -f /root/programme/nas.expect\"", "active": true, "logging": false }, { "id": "nas-anschalten", "name": "Nas Anschalten", "rule": "if Mein Computer is present or Radio is on or Media Center is present or NAS Server is on or Media Center Wohnzimmer is present then execute \"wakeonlan 5C:F4:AB:50:11:B5\"", "active": true, "logging": true }, { "id": "nas-pingen", "name": "Nas pingen", "rule": "if MeinNAS is absent then turn off NAS Server", "active": true, "logging": false }, { "id": "nas-pingen-2", "name": "Nas pingen 2", "rule": "if MeinNAS is present then turn on NAS Server", "active": true, "logging": false }, { "id": "media-center-anschalten", "name": "Media Center Anschalten", "rule": "if Media Center is turned on then turn NAS Server on and set $ambient to \"Schlafen\"", "active": true, "logging": false }, { "id": "schlafen", "name": "Schlafen", "rule": "if Schlafen button is pressed and Mein NAS is absent then set $ambient to \"Schlafen\" and turn on NAS Server and after 70 seconds turn on Media Center", "active": true, "logging": false }, { "id": "movie", "name": "Movie", "rule": "if Movie button is pressed and Mein NAS is present then set $ambient to \"Movie\" and turn on Kodi Media Center", "active": true, "logging": false }, { "id": "alles-aus", "name": "Alles Aus", "rule": "if Allesaus button is pressed then turn NAS Server off and turn Media Center off and turn Nachttischlampe off and turn Weinregal off and turn Stehlampe off and turn Radio off and turn Kodi Media Center off and set $ambient to \"Kein Ambiente gewählt\"", "active": true, "logging": false }, { "id": "kein-ambiente", "name": "Kein Ambiente", "rule": "if Allesaus button is pressed or Mein NAS signals absent for 20 seconds or Radio is off then set $ambient to \"Kein Ambiente gewählt\"", "active": true, "logging": false }, { "id": "schlafen-licht", "name": "Schlafen Licht", "rule": "if Schlafen button is pressed and [it is after sunset or before sunrise] then turn Nachttischlampe on", "active": true, "logging": false }, { "id": "movie-licht", "name": "Movie Licht", "rule": "if Movie button is pressed and [it is after sunset or before sunrise] then turn Stehlampe on", "active": true, "logging": false }, { "id": "monatlicher-energieeintrag", "name": "Monatlicher Energieeintrag", "rule": "if [it is Jan 1 or Feb 1 or Mar 1 or Apr 1 or May 1 or Jun 1 or Jul 1 or Aug 1 or Sep 1 or Oct 1 or Nov 1 or Dec 1] and it is 00:01 then execute \"/root/programme/EnergySaver.py\" and push title:\"pimatic: Stromverbrauch\" message:\"Der Monatliche Stromverbrauch beträgt $verbauchletzter.Verbrauch letzter und $kostenletzter.Kosten vergangener \"", "active": true, "logging": false }, { "id": "radio", "name": "Radio", "rule": "if Radio button is pressed or Radio is on then turn on Radio and turn on NAS Server and set $ambient to \"Radio\"", "active": true, "logging": false }, { "id": "computer-herunterfahren", "name": "Computer Herunterfahren", "rule": "if Computer is turned off then execute \"net rpc shutdown -I 192.168.0.11 -U paco%technics86\"", "active": false, "logging": false }, { "id": "restart-pimatic", "name": "Restart pimatic", "rule": "if Restart Pimatic button is pressed then execute \"service pimatic restart\"", "active": true, "logging": false }, { "id": "schlafen-2", "name": "Schlafen 2", "rule": "if Schlafen button is pressed and Mein NAS is present then turn Media Center on and set $ambient to \"Schlafen\"", "active": true, "logging": false }, { "id": "heizung-weekend", "name": "Heizung Weekend", "rule": "if it is friday and after 12:00 or saturday or sunday and before 12:00 then set $weekend to 1", "active": true, "logging": false }, { "id": "heizung-weekday", "name": "Heizung Weekday", "rule": "if it is monday or tuesday or wednesday or thursday or friday or [sunday and after 12:00] then set $weekend to 0", "active": true, "logging": false }, { "id": "heizung-taganhebung-weekend", "name": "Heizung Taganhebung weekend", "rule": "if it is after 08:00 and before 23:59 and [Cris Handy is present or Stefan Handy is present] and $weekend is 1 then set $nachtabsenkungaktiv to \"Aus\"", "active": true, "logging": false }, { "id": "heizung-nachabsenkung-weekend", "name": "Heizung Nachabsenkung weekend", "rule": "if [it is after 23:59 or before 08:00] and [Cris Handy is present or Stefan Handy is present] and $weekend is 1 then set $nachtabsenkungaktiv to \"An\"", "active": true, "logging": false }, { "id": "pi-reboot", "name": "pi reboot", "rule": "if System Reboot is pressed then execute \"reboot\"", "active": true, "logging": false }, { "id": "comming-home-aus", "name": "comming home aus", "rule": "if Stefan Handy is present or Cris Handy is present then turn off comming home", "active": true, "logging": false }, { "id": "energymeter-sensor", "name": "EnergyMeter Sensor", "rule": "if Aktueller Verbrauch of aktuellerverbrauch was not updated for 20 minutes then push title:\"pimatic: Sensoren\" message:\"Der Stromsensor scheint ein Problem zu verursachen.\"", "active": true, "logging": false }, { "id": "thermostat-an", "name": "Thermostat an", "rule": "if $Wohntemperatur.temperature < ($thermostat.temperatureSetpoint - $tempstep) and Heizung Freigabe is on and [$Raumtemperaturtrend is \"konstant\" or $Raumtemperaturtrend is \"fallend\"] then turn Heizung on", "active": true, "logging": false }, { "id": "thermostat-aus", "name": "Thermostat aus", "rule": "if [$Wohntemperatur.temperature >= $thermostat.temperatureSetpoint and Heizung is on] or Heizung is off or Heizung Freigabe is off then turn Heizung off", "active": true, "logging": false }, { "id": "thermostat-boost", "name": "Thermostat boost", "rule": "if mode of Thermostat is boost then set temp of thermostat to 23", "active": true, "logging": false }, { "id": "thermostat-auto", "name": "Thermostat auto", "rule": "if mode of thermostat is auto then set temp of Thermostat to $Anwesenheitstemperatur", "active": true, "logging": false }, { "id": "thermostat-einstellen", "name": "Thermostat einstellen", "rule": "if $thermostat.temperatureSetpoint changes and mode of thermostat is not boost and [Stefan Handy is present or Cris Handy is present or comming home is on] and $nachtabsenkungaktiv is \"Aus\" then set $Anwesenheitstemperatur to $thermostat.temperatureSetpoint", "active": true, "logging": false }, { "id": "thermostat-einstellen-2", "name": "Thermostat einstellen 2", "rule": "if $thermostat.temperatureSetpoint changes and mode of thermostat is not boost and Stefan Handy is absent and Cris Handy is absent and comming home is off then set $Abwesenheitstemperatur to $thermostat.temperatureSetpoint", "active": true, "logging": false }, { "id": "thermostat-einstellen-3", "name": "Thermostat einstellen 3", "rule": "if $thermostat.temperatureSetpoint changes and mode of thermostat is not boost and mode of thermostat is not manu and comming home is on then set $Anwesenheitstemperatur to $thermostat.temperatureSetpoint", "active": true, "logging": false }, { "id": "thermostat-einstellen-nachtabsekung", "name": "Thermostat einstellen Nachtabsekung", "rule": "if $thermostat.temperatureSetpoint changes and mode of thermostat is not boost and mode of thermostat is not manu and $nachtabsenkungaktiv is \"An\" and [Stefan Handy is present or Cris Handy is present] then set $nachtabsenkung to $thermostat.temperatureSetpoint", "active": true, "logging": false }, { "id": "thermostat-nachtabsenkung", "name": "Thermostat Nachtabsenkung", "rule": "if $nachtabsenkungaktiv is \"An\" and [Stefan Handy is present or Cris Handy is present] then set temp of thermostat to $nachtabsenkung", "active": true, "logging": false }, { "id": "thermostat-taganhebung", "name": "Thermostat Taganhebung", "rule": "if $nachtabsenkungaktiv is \"Aus\" then set temp of thermostat to $Anwesenheitstemperatur", "active": true, "logging": false }, { "id": "comming-home-aus-2", "name": "comming home aus 2", "rule": "if [Stefan Handy is present or Cris Handy is present] and comming home is on then turn off comming home", "active": true, "logging": false }, { "id": "heizung-zeit-zahlen", "name": "heizung zeit zählen", "rule": "if Heizung is on and every 1 minute then set $heizung-zeit-minuten to $heizung-zeit-minuten +1", "active": true, "logging": false }, { "id": "heizung-zeit-nullen", "name": "heizung zeit nullen", "rule": "if it is 00:00 then set $heizung-zeit-monat to $heizung-zeit-monat + $heizung-zeit and after 10 ms $heizung-zeit to 0 and after 10 ms set $heizung-zeit-minuten to 0 and set $heizung-zeit-std to 0 and after 10 ms set $heizung-zeit to $heizung-zeit-minuten", "active": true, "logging": false }, { "id": "kodi-media-center-ausschalten", "name": "Kodi Media Center Ausschalten", "rule": "if Media Center Wohnzimmer is absent for 4 minutes then turn off Kodi Wohnzimmer", "active": true, "logging": false }, { "id": "kodi-media-center-anschalten", "name": "Kodi Media Center Anschalten", "rule": "if Kodi Media Center is turned on then turn NAS Server on and set $ambient to \"Movie\" and turn on Kodi Wohnzimmer", "active": true, "logging": false }, { "id": "media-center-ausschalten", "name": "Media Center Ausschalten", "rule": "if MediaCenter is absent for 4 minutes then turn Media Center off", "active": true, "logging": false }, { "id": "heizung-laufzeit-von-min-in-std", "name": "Heizung Laufzeit von min. in std.", "rule": "if $heizung-zeit-minuten = 3 then set $heizung-zeit-std = $heizung-zeit-std + 0.05 and after 10 ms set $heizung-zeit to $heizung-zeit-std and set $heizung-zeit-minuten = 0", "active": true, "logging": false }, { "id": "movie-3", "name": "Movie 3", "rule": "if Movie button is pressed then set $ambient to \"Movie\" and turn on NAS Server and turn Kodi Media Center on after 70 seconds", "active": true, "logging": false }, { "id": "kaffeemaschine-saubern", "name": "Kaffeemaschine säubern", "rule": "if it is sunday and 10:00 then pushover title:\"Kaffemaschine reinigen\" message:\"Bitte reinigen Sie ihre Kaffeemaschine um aromatischen Kaffee zu geniesen.\"", "active": true, "logging": false }, { "id": "heizung-nachabsenkung-weekday", "name": "Heizung Nachabsenkung weekday", "rule": "if [it is after 22:59 or before 06:00] and [Cris Handy is present or Stefan Handy is present] and $weekend is 0 then set $nachtabsenkungaktiv to \"An\"", "active": true, "logging": false }, { "id": "heizung-taganhebung-weekday", "name": "Heizung Taganhebung weekday", "rule": "if it is after 06:00 and before 22:59 and [Cris Handy is present or Stefan Handy is present] and $weekend is 0 then set $nachtabsenkungaktiv to \"Aus\"", "active": true, "logging": false }, { "id": "temperatursensor-kuhlschrank", "name": "Temperatursensor Kühlschrank", "rule": "if temperature of Kühlschrank was not updated for 40 minutes then push title:\"pimatic: Sensoren\" message:\"Die Batterie des Temperatursensors (Kühlschrank) ist aufgebraucht.\" and set mode of thermostat to \"manu\"", "active": true, "logging": false }, { "id": "movie-licht-2", "name": "Movie Licht 2", "rule": "if $ambient is \"Movie\" and [it is after sunset or before sunrise] then turn Stehlampe on", "active": false, "logging": false }, { "id": "autopause-1live-kuche", "name": "Autopause 1Live Küche", "rule": "if Radio is off then execute \"wget --no-cache http://192.168.0.18:9000/status.html?p0=pause&p1=1&player=192.168.0.110\"", "active": false, "logging": false }, { "id": "kodi-media-center-ausschalten-2", "name": "Kodi Media Center Ausschalten 2", "rule": "if Kodi Media Center is turned off and Media Center Wohnzimmer is present then execute \"expect -f /root/programme/kodi.expect\"", "active": true, "logging": false }, { "id": "kodi-media-center-ausschalten-3", "name": "Kodi Media Center Ausschalten 3", "rule": "if Kodi Media Center is turned off then turn off Kodi Wohnzimmer after 10 seconds", "active": true, "logging": false }, { "id": "multiroom-start", "name": "Multiroom start", "rule": "if Multi Room button is pressed or [Radio is on and Media Center Wohnzimmer is present] then turn on NAS Server and turn on Radio and turn on Kodi Media Center after 70 seconds and after 80 seconds execute \"expect -f /root/programme/multiroom.expect\" and set $ambient to \"Multiroom\"", "active": true, "logging": false }, { "id": "multiroom-start-2", "name": "Multiroom start 2", "rule": "if Multi Room button is pressed or [Radio is on and Media Center Wohnzimmer is present] and Mein NAS is present then turn on Radio and turn on Kodi Media Center and after 10 seconds execute \"expect -f /root/programme/multiroom.expect\" and set $ambient to \"Multiroom\"", "active": true, "logging": false } ],
this is the rule wich wouldnt work.
{ "id": "autoplay-1live-kuche", "name": "Autoplay 1Live Küche", "rule": "if Multiroom Server is present and Radio button is pressed then execute \"expect -f /root/programme/autoplay.expect\" and log \"klappt\"", "active": true, "logging": true },
with ping device it works.
and with switch instead of button too. -
@p4co86 Thank you for sending me the rules set. This was very helpful and I finally I managed to reproduce the problem on my test site. Finally, I think I have solved the issue and published a new version.
Please update to pimatic-probe@0.0.7 and let me know about your results.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
after updating it works. Would it be possible to accept status codes like 404, 102… so that i never had a error when the nas is offline? Then it would be peeeeerfect!
Thanks. -
@p4co86 Glad to hear it is working fine for you known.
Regarding accepting response status codes as a “present” result you can do this as part of the device setup!
See pimatic-probe#http-response-status-codes and example below:{ "id": "probe5", "class": "HttpProbe", "name": "WebServer", "url": "http://www.local-server.tld:8080", "acceptedStatusCodes": [ 200, 102, 401, 404 ] },
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
A new version (v0.0.8) of the plugin is available:
- Added support for xAttributeOptions property as part of the device configuration
- Added
verifyPeerCert
property to HttpProbe device configuration to enable or disable certificate verification
(disabled by default). This is to replace the temporary fix for the “UNABLE_TO_VERIFY_LEAF_SIGNATURE” issue
added in v0.0.5 - Extended documentation of device configuration option
For more info see README
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig hi,
there is a solution about “Error: connect ECONNREFUSED”? -
@ridgarou said:
there is a solution about “Error: connect ECONNREFUSED”?
I am not sure what kind of solution you have in mind. The error is output to indicate that there is no service on the target port. Do you want to have error messages supressed completely?
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law