W pliku config.php podmieniłem jedynie id kanałów
tak na próbę
$outsideDS18B20 = 28429;
$insideDHT22 = 28424;
$sampleBulb = 28427;
$garageGateSensor = 29071;
$garageGate = 29069;
czy to wystarczy ?
w przeglądarce dostaję
4
Teraz wystartowało
a w logu z Automate :
ten błąd się powtarza
2017-06-04 17:59:16.464 FAIL 45@14: com.llamalab.json.MalformedJsonException: Illegal character 'A' at line 1
2017-06-04 14:09:47.621 INFO 43@1: Flow beginning
2017-06-04 14:09:47.624 INFO 43@46: Failure catch
2017-06-04 14:09:47.625 INFO 43@39: File exists?
2017-06-04 14:09:47.658 INFO 43@40: File read text
2017-06-04 14:09:47.676 INFO 43@20: Variable set
2017-06-04 14:09:47.677 INFO 43@2: HTTP request
2017-06-04 14:09:48.085 USER 43@6: Configured notifications: 4
2017-06-04 14:09:48.086 INFO 43@43: Variable set
2017-06-04 14:09:48.087 INFO 43@3: For each
2017-06-04 14:09:48.090 INFO 43@7: Fork
2017-06-04 14:09:48.118 INFO 43@5: Delay
2017-06-04 14:09:48.130 INFO 44@33: Failure catch
2017-06-04 14:09:48.131 INFO 44@8: HTTP request
2017-06-04 14:09:48.330 USER 44@10: Notification #0 response:Authentication required.
2017-06-04 14:09:48.331 INFO 44@11: Expression true?
2017-06-04 14:09:48.333 INFO 44@14: Variable set
2017-06-04 14:09:48.336 FAIL 44@14: com.llamalab.json.MalformedJsonException: Illegal character 'A' at line 1
2017-06-04 14:09:48.344 USER 44@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-04 14:09:48.347 INFO 44@29: Delay
2017-06-04 14:09:50.170 INFO 43@3: For each
2017-06-04 14:09:50.173 INFO 43@7: Fork
2017-06-04 14:09:50.213 INFO 43@5: Delay
2017-06-04 14:09:50.228 INFO 45@33: Failure catch
2017-06-04 14:09:50.231 INFO 45@8: HTTP request
2017-06-04 14:09:50.429 USER 45@10: Notification #1 response:Authentication required.
2017-06-04 14:09:50.430 INFO 45@11: Expression true?
2017-06-04 14:09:50.430 INFO 45@14: Variable set
2017-06-04 14:09:50.431 FAIL 45@14: com.llamalab.json.MalformedJsonException: Illegal character 'A' at line 1
2017-06-04 14:09:50.436 USER 45@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-04 14:09:50.437 INFO 45@29: Delay
2017-06-04 14:09:52.281 INFO 43@3: For each
2017-06-04 14:09:52.282 INFO 43@7: Fork
2017-06-04 14:09:52.316 INFO 43@5: Delay
2017-06-04 14:09:52.334 INFO 46@33: Failure catch
2017-06-04 14:09:52.335 INFO 46@8: HTTP request
2017-06-04 14:09:52.546 USER 46@10: Notification #2 response:Authentication required.
2017-06-04 14:09:52.546 INFO 46@11: Expression true?
2017-06-04 14:09:52.547 INFO 46@14: Variable set
2017-06-04 14:09:52.548 FAIL 46@14: com.llamalab.json.MalformedJsonException: Illegal character 'A' at line 1
2017-06-04 14:09:52.555 USER 46@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-04 14:09:52.555 INFO 46@29: Delay
2017-06-04 14:09:54.364 INFO 43@3: For each
2017-06-04 14:09:54.365 INFO 43@7: Fork
2017-06-04 14:09:54.405 INFO 43@5: Delay
2017-06-04 14:09:54.419 INFO 47@33: Failure catch
2017-06-04 14:09:54.421 INFO 47@8: HTTP request
2017-06-04 14:09:54.626 USER 47@10: Notification #3 response:Authentication required.
2017-06-04 14:09:54.628 INFO 47@11: Expression true?
2017-06-04 14:09:54.628 INFO 47@14: Variable set
2017-06-04 14:09:54.629 FAIL 47@14: com.llamalab.json.MalformedJsonException: Illegal character 'A' at line 1
2017-06-04 14:09:54.636 USER 47@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-04 14:09:54.637 INFO 47@29: Delay
2017-06-04 14:09:56.447 INFO 43@3: For each
2017-06-04 14:09:56.450 INFO 43@37: Expression true?
2017-06-04 14:09:56.451 USER 43@34: All notifications initialized
2017-06-04 14:09:56.451 INFO 43@36: Variables take
Powiadomienia za pomocą API
Dodałem ponownie login i hasło i mam cały czas
2017-06-04 23:02:16.408 USER 46@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-04 23:07:17.017 USER 45@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-04 23:07:17.027 USER 44@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-04 23:07:17.034 USER 47@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-04 23:07:17.098 USER 46@30: Scripts unreachable or not working. Will retry in 5 minutes.
a na telefonie żadnych powiadomień
2017-06-04 23:02:16.408 USER 46@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-04 23:07:17.017 USER 45@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-04 23:07:17.027 USER 44@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-04 23:07:17.034 USER 47@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-04 23:07:17.098 USER 46@30: Scripts unreachable or not working. Will retry in 5 minutes.
a na telefonie żadnych powiadomień
Na adres /notifications/0 mam {"nextRunTimestamp":1496659586,"awake":false}
Usunąłem flow w telefonie , importowałem ponownie , wpisałem dane logowania w szóstym bloku od góry "HTTP Request"
zresetowałem telefon i w logowaniu mam :
2017-06-05 10:52:49.897 INFO 183@8: HTTP request
2017-06-05 10:52:49.914 INFO 182@8: HTTP request
2017-06-05 10:52:49.933 INFO 181@8: HTTP request
2017-06-05 10:52:49.950 INFO 180@8: HTTP request
2017-06-05 10:52:50.163 USER 183@10: Notification #3 response:
2017-06-05 10:52:50.165 INFO 183@11: Expression true?
2017-06-05 10:52:50.166 USER 183@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-05 10:52:50.167 INFO 183@29: Delay
2017-06-05 10:52:50.194 USER 181@10: Notification #1 response:
2017-06-05 10:52:50.197 INFO 181@11: Expression true?
2017-06-05 10:52:50.200 USER 181@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-05 10:52:50.202 INFO 181@29: Delay
2017-06-05 10:52:50.221 USER 182@10: Notification #2 response:
2017-06-05 10:52:50.222 INFO 182@11: Expression true?
2017-06-05 10:52:50.223 USER 182@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-05 10:52:50.225 INFO 182@29: Delay
2017-06-05 10:52:52.908 USER 180@10: Notification #0 response:
2017-06-05 10:52:52.910 INFO 180@11: Expression true?
2017-06-05 10:52:52.911 USER 180@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-05 10:52:52.913 INFO 180@29: Delay
a tu jest zmiana
2017-06-05 12:52:35.557 USER 180@10: Notification #0 response:{"nextRunTimestamp":1496659983,"awake":false}
2017-06-05 12:52:35.557 INFO 180@11: Expression true?
2017-06-05 12:52:35.558 INFO 180@14: Variable set
2017-06-05 12:52:35.559 USER 180@27: Next notification #0 check time: pon. 05.06.2017 12:53:03
2017-06-05 12:52:35.560 INFO 180@23: Expression true?
2017-06-05 12:52:35.560 INFO 180@17: Notification hide
2017-06-05 12:52:35.561 INFO 180@31: Delay
czy gdzieś jeszcze trzeba wpisać login i hasło ? w innych blokach ?
Usunąłem flow w telefonie , importowałem ponownie , wpisałem dane logowania w szóstym bloku od góry "HTTP Request"
zresetowałem telefon i w logowaniu mam :
2017-06-05 10:52:49.897 INFO 183@8: HTTP request
2017-06-05 10:52:49.914 INFO 182@8: HTTP request
2017-06-05 10:52:49.933 INFO 181@8: HTTP request
2017-06-05 10:52:49.950 INFO 180@8: HTTP request
2017-06-05 10:52:50.163 USER 183@10: Notification #3 response:
2017-06-05 10:52:50.165 INFO 183@11: Expression true?
2017-06-05 10:52:50.166 USER 183@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-05 10:52:50.167 INFO 183@29: Delay
2017-06-05 10:52:50.194 USER 181@10: Notification #1 response:
2017-06-05 10:52:50.197 INFO 181@11: Expression true?
2017-06-05 10:52:50.200 USER 181@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-05 10:52:50.202 INFO 181@29: Delay
2017-06-05 10:52:50.221 USER 182@10: Notification #2 response:
2017-06-05 10:52:50.222 INFO 182@11: Expression true?
2017-06-05 10:52:50.223 USER 182@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-05 10:52:50.225 INFO 182@29: Delay
2017-06-05 10:52:52.908 USER 180@10: Notification #0 response:
2017-06-05 10:52:52.910 INFO 180@11: Expression true?
2017-06-05 10:52:52.911 USER 180@30: Scripts unreachable or not working. Will retry in 5 minutes.
2017-06-05 10:52:52.913 INFO 180@29: Delay
a tu jest zmiana
2017-06-05 12:52:35.557 USER 180@10: Notification #0 response:{"nextRunTimestamp":1496659983,"awake":false}
2017-06-05 12:52:35.557 INFO 180@11: Expression true?
2017-06-05 12:52:35.558 INFO 180@14: Variable set
2017-06-05 12:52:35.559 USER 180@27: Next notification #0 check time: pon. 05.06.2017 12:53:03
2017-06-05 12:52:35.560 INFO 180@23: Expression true?
2017-06-05 12:52:35.560 INFO 180@17: Notification hide
2017-06-05 12:52:35.561 INFO 180@31: Delay
czy gdzieś jeszcze trzeba wpisać login i hasło ? w innych blokach ?
Nie, wystarczy w jednym wpisać i to się propaguje na wszystkie inne.
Z tego końcowego logu wynika że powiadomienie #0 (czyli to które jest zdefiniowane jako pierwsze w configu) działa, ale się nie pokazało bo warunek powiadomienia nie został spełniony.
Kolejne faktycznie zdają się nie działać... Jesteś pewny że telefon ma dostęp do skryptów? Jak wejdziesz w przegląrce na telefonie to dostajesz odpowiedź podobną do tej co przysłałeś?
Spróbuj:
/notifications/0
/notifications/1
/notifications/2
/notifications/3
Z tego końcowego logu wynika że powiadomienie #0 (czyli to które jest zdefiniowane jako pierwsze w configu) działa, ale się nie pokazało bo warunek powiadomienia nie został spełniony.
Kolejne faktycznie zdają się nie działać... Jesteś pewny że telefon ma dostęp do skryptów? Jak wejdziesz w przegląrce na telefonie to dostajesz odpowiedź podobną do tej co przysłałeś?
Spróbuj:
/notifications/0
/notifications/1
/notifications/2
/notifications/3
Seba5120 pisze: ↑czw cze 29, 2017 12:35 pm Jak w powiadomieniach ustawić taką regułę:
Powiadomienie o otwartej bramie, sprawdzaj i powiadamiaj co 5 minut między 22:00 a 6:00
Ustawiam kanał w zmiennej: $garageGateSensor = 123;
i co dalej?
A co w przypadku gdy są dwie bramy?
$garageGateSensor1 = 123;
$garageGateSensor2 = 456;
Kod: Zaznacz cały
[
'condition' => Conditions::isOpened(123),
'interval' => ['*/5 22-6 * * *'],
'retryInterval' => 60,
'notification' => [
'title' => 'Brama jest otwarta!',
'icon' => AutomateIcons::LOCK_OPENED,
'cancellable' => true,
'sound' => true,
],
'actions' => [
['label' => 'Zamknij', 'icon' => AutomateIcons::LOCK_CLOSED, 'command' => "openClose,123"],
['label' => 'Sprawdź teraz', 'icon' => AutomateIcons::REFRESH, 'command' => 'postpone,1'],
['label' => 'Sprawdź za godzinę', 'icon' => AutomateIcons::CLOCK, 'command' => 'postpone,3600'],
]
]
Można też zrobić jedno powiadomienie dla obydwu bram, jakoś tak:
Kod: Zaznacz cały
[
'condition' => Conditions::anyOf(Conditions::isOpened(123), Conditions::isOpened(234)),
'interval' => ['*/5 22-6 * * *'],
'retryInterval' => 60,
'notification' => [
'title' => 'Jakaś brama jest otwarta!',
'icon' => AutomateIcons::LOCK_OPENED,
'cancellable' => true,
'sound' => true,
],
'actions' => [
['label' => 'Zamknij pierwszą', 'icon' => AutomateIcons::LOCK_CLOSED, 'command' => "openClose,123"],
['label' => 'Zamknij drugą', 'icon' => AutomateIcons::LOCK_CLOSED, 'command' => "openClose,234"],
['label' => 'Sprawdź teraz', 'icon' => AutomateIcons::REFRESH, 'command' => 'postpone,1'],
]
],