• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pilight 7.0
#21
Can you share those scripts?
 
Reply
#22
I upgraded from the nightly 6 to stable 7

I changed my nic about a month ago and now it regenerate the UUID
this was simple solved by a find and replace on the config.

but now one of the relay boards (or the whole pi since this is his/her only function) isn't working again.

When i switch the relay on/off:
Code:
[May 29 21:27:58:110581] pilight-daemon: DEBUG: socket recv: {"action":"control","code":{"state":"off","device":"RelayP02B01C06"}}
[May 29 21:27:58:111963] pilight-daemon: ERROR: the device "RelayP02B01C06" does not exist

however when i stop the pi01(master) and start the pi02 standalone (default empty config) and type
Code:
pilight-send -p relay -g 10 -f
then the relay wil go on (for some reason all my relay's need default state off)

strange enough are the relay's working on pi01

There was a problem with the same relay's some time ago.
http://forum.pilight.org/Thread-v6-0-v7-...9#pid12609

My config.json

.txt   config.txt (Size: 16.4 KB / Downloads: 9)
 
Reply
#23
The first script sending the message is the following:

Code:
#!/bin/bash

if [ -d "/var/www/hausautomation/lock_door" ]; then

sudo /root/tg/send_script t "Terrassentuer geoeffnet!"

sudo python /var/www/hausautomation/anwesenheit.py

fi

sudo /var/www/hausautomation/check-pilight.sh

First it checks the state of the door lock, if it is locked, it sends a telegram message via a send script (see below) telling me that the door has been opened. The python script then pings the familys phone IP adresses. If no known IP adress is present, it sends an alarm message via telegram. Finally it checks if pilight is running and restarts the service if it is down (like a watchdog). However this doesn't help since the daemon is still running.

The telegram send script is the following:

Code:
#!/bin/bash

#/root/tg/bin/telegram-cli -k /root/tg/tg-server.pub -W -e "msg $1 $2"
#/root/tg/bin/telegram-cli -k /root/tg/tg-server.pub -W -e "msg $1 $2, ok_cb, false"

if [ "$1" = 'v' ]; then #prueft, ob ein video gesendet werden soll $1 = v
   cd '/root/tg/' && (echo "contact_list"; sleep 5; echo "send_video !_Contact1 $2") | ./bin/telegram-cli -k tg-server.pub -W #Sendet ein Video mit dem per Variable uebergebenen Pfad ($2)
elif [ "$1" = 'p' ]; then #prueft, ob ein Bild gesendet werden soll $1 = p
   cd '/root/tg/' && (echo "contact_list"; sleep 5; echo "send_photo !_Contact1 $2") | ./bin/telegram-cli -k tg-server.pub -W #Sendet ein Bilde mit dem per Variable uebergebenen Pfad ($2)
elif [ "$1" = 't' ]; then #prueft, ob ein Text gesendet werden soll $1 = t
   cd '/root/tg/' && (echo "contact_list"; sleep 5; echo "msg !_Contact1 $2") | ./bin/telegram-cli -k tg-server.pub -W #Sendet eine Textnachricht mit dem per Variable uebergebenen Inhalt ($2)
elif [ "$1" = 'j' ]; then #prueft, ob ein Text an Contact2 gesendet werden soll $1 = j
   cd '/root/tg/' && (echo "contact_list"; sleep 5; echo "msg Contact2 $2") | ./bin/telegram-cli -k tg-server.pub -W #Sendet eine Textnachricht mit dem per Variable uebergebenen Inhalt ($2)
fi


screen -ls | grep Detached | cut -d. -f1 | awk '{print $1}' | xargs kill #loescht die blockierte telegram session
screen -dmS TelegramCLI ~/tg/bin/telegram-cli -s ~/tg/test.lua -k ~/tg/tg-server.pub  #schaltet den service wieder ein
 
Reply
#24
@Koos147, did you upgrade both pi's?
@teddy, when pilight "hangs", do you still see the scripts in the 'ps aux' output?
 
Reply
#25
(05-30-2015, 01:01 AM)curlymo Wrote: @Koos147, did you upgrade both pi's?

Yes i only make that mistake once Wink
I upgraded by apt by the stable repository at the same time
 
Reply
#26
Hi, already updated to v7 and everything is running smoothly. While installing new contact sensors, I've come across an idea. It would be very beneficial to filter the output of pilight-receive for a certain protocol. Reason is, because of datetime and lots of other (possible) stuff it is kind of hard to find the ones that are desired. I currently use a workaround to dump the output to a file and then look through it, but if this is something that can be quickly and easily implemented...
(Actually, the most useful would be automatically adding unknown devices to a separate log file ...)
 
Reply
#27
Yes, this would be very helpful. Not sure how it would be implemented, i.e. the users would choose the protocol that they want to find.
I wrote a python script for filtering out data from certain protocols using the API a while ago, but it would be easier to do this in pilight.
 
Reply
#28
This should be in the feature request area.
 
Reply
#29
(05-30-2015, 01:50 PM)curlymo Wrote: This should be in the feature request area.

I will move it there - written here just to make the idea public Smile

EDIT: http://forum.pilight.org/Thread-Logging-...wn-devices
 
Reply
#30
@koos147, I just tested this locally between a Raspberry Pi 2 and a Hummingboard and found no issues.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
Tongue pilight 8.1.5-1-gc0a175e0 Chrashes fleisch 4 18 1 hour ago
Last Post: curlymo
  pilight for Raspbian Buster (raspberry pi 4) ? starob 29 1,332 07-15-2019, 08:45 PM
Last Post: curlymo
  pilight-receive Filteroption not working Alex 2 311 07-14-2019, 08:35 AM
Last Post: Alex
  pilight usb nano format conversion ettman8 2 199 07-14-2019, 08:32 AM
Last Post: curlymo
  pilight 8.1.4 crashes after some hours Ulrich.Arnold 47 1,762 06-29-2019, 08:58 PM
Last Post: curlymo
  Raspberry PI, gpio-ir-tx and pilight not starting lordslash 5 483 06-11-2019, 05:19 PM
Last Post: curlymo
  pilight fails starting on boot Alex 5 424 06-09-2019, 06:02 PM
Last Post: curlymo
  Google Assistant coupled to pilight hansrijn2 4 860 05-29-2019, 06:54 PM
Last Post: curlymo
  pilight-send does not stop (terminate) va13 3 422 05-15-2019, 06:06 PM
Last Post: curlymo
  oom_reaper: reaped process pilight-daemon va13 4 474 05-15-2019, 08:03 AM
Last Post: va13

Forum Jump:


Browsing: 1 Guest(s)