I tried to get the following script working on my rpi:
https://www.domoticz.com/wiki/Device_blink
Where is the part my dymmy switch puts the blink.py script on? It feels like somethings missing? nothing happens when the dunny switch is on...
I want to blink not 1 device, but 3, is that possible? I want al the lights in the room blink when alarm is ringing.
Blink device script
Moderator: leecollings
- groetg
- Posts: 39
- Joined: Tuesday 06 January 2015 20:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2.4025
- Location: Heerhugowaard, Holland
- Contact:
Blink device script
Master: RPI Model 2B
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
- groetg
- Posts: 39
- Joined: Tuesday 06 January 2015 20:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2.4025
- Location: Heerhugowaard, Holland
- Contact:
Re: Blink device script
I got it so far the blink.py script runs when I SSH sudo python blink.py. So the script works, but now I try to copy i to a switch:
I did:
In the virtual switch set the on command to script:///home/pi/domoticz/scripts/blink.py
nothing happens when I press the device on.
changed the command to: script://home/pi/domoticz/scripts/blink.py (one / less)
still nothing happens
What am I doing wrong?
I did:
In the virtual switch set the on command to script:///home/pi/domoticz/scripts/blink.py
nothing happens when I press the device on.
changed the command to: script://home/pi/domoticz/scripts/blink.py (one / less)
still nothing happens
What am I doing wrong?
Master: RPI Model 2B
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
Re: Blink device script
This has been answered many times on the forum.
chmod +x /home/pi/domoticz/scripts/blink.py
Aan actie:
script:///home/pi/domoticz/scripts/blink.py
chmod +x /home/pi/domoticz/scripts/blink.py
Aan actie:
script:///home/pi/domoticz/scripts/blink.py
- groetg
- Posts: 39
- Joined: Tuesday 06 January 2015 20:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2.4025
- Location: Heerhugowaard, Holland
- Contact:
Re: Blink device script
Sorry, this is my first script.
I got the script running, but in the log I see:
Error: Error executing script command (/home/pi/domoticz/scripts/blink.py). returned: 512
Through SSH the scripts is running, so my conclusion is that the script is allright.
I got the script running, but in the log I see:
Error: Error executing script command (/home/pi/domoticz/scripts/blink.py). returned: 512
Through SSH the scripts is running, so my conclusion is that the script is allright.
Master: RPI Model 2B
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
- jvdz
- Posts: 2334
- Joined: Tuesday 30 December 2014 19:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.107
- Location: Netherlands
- Contact:
Re: Blink device script
It likely needs 3 slashes (/) not 2 after script:.
Jos
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Re: Blink device script
Create file "blink.sh" with content:
#!/bin/bash
/home/pi/domoticz/scripts/blink.py&
chmod +x blink.sh
Aan actie:
script:///home/pi/domoticz/scripts/blink.sh
This works for me
#!/bin/bash
/home/pi/domoticz/scripts/blink.py&
chmod +x blink.sh
Aan actie:
script:///home/pi/domoticz/scripts/blink.sh
This works for me
- Westcott
- Posts: 423
- Joined: Tuesday 09 December 2014 17:04
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: UK - Glos
- Contact:
Re: Blink device script
The script has Windows newlines, not Unix style.
The last line needs to be terminated.
Perhaps remove indentation of first line.
See -
viewtopic.php?t=5315
Unfortunately my TKB TZ68 switch, or my Zwave network, doesn't respond quickly enough to create regular flashes.
It also fills the log up!
The last line needs to be terminated.
Perhaps remove indentation of first line.
See -
viewtopic.php?t=5315
Unfortunately my TKB TZ68 switch, or my Zwave network, doesn't respond quickly enough to create regular flashes.
It also fills the log up!
Zwave - Sigma Z+ stick, Fibaro, Horstmann, Neo Coolcam, EUROtronic
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
RFlink - IR detectors and temperatures
Wifi - YeeLights, ESP32s, Anoop sockets
Zigbee - lots with zigbee2mqtt and ZbBridge
- groetg
- Posts: 39
- Joined: Tuesday 06 January 2015 20:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2.4025
- Location: Heerhugowaard, Holland
- Contact:
Re: Blink device script
@Sweetpants: Did what you said, nothing happens. Run the blink.sh script in Putty gives:
blink.sh is:
Again: running /home/pi/domoticz/scripts/blink.py straight in putty gives flashing light, zo blink.py works, only to get it run in Domoticz seems to be the problem.
Code: Select all
pi@raspberrypi ~/domoticz/scripts $ /home/pi/domoticz/scripts/blink.py: line 2: import: command not found
/home/pi/domoticz/scripts/blink.py: line 3: import: command not found
/home/pi/domoticz/scripts/blink.py: line 4: import: command not found
/home/pi/domoticz/scripts/blink.py: line 5: import: command not found
/home/pi/domoticz/scripts/blink.py: line 6: import: command not found
/home/pi/domoticz/scripts/blink.py: line 7: import: command not found
/home/pi/domoticz/scripts/blink.py: line 8: import: command not found
/home/pi/domoticz/scripts/blink.py: line 10: syntax error near unexpected token `('
/home/pi/domoticz/scripts/blink.py: line 10: `def open_port():'
Code: Select all
#!/bin/bash
/home/pi/domoticz/scripts/blink.py&
Master: RPI Model 2B
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
- groetg
- Posts: 39
- Joined: Tuesday 06 January 2015 20:41
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V2.4025
- Location: Heerhugowaard, Holland
- Contact:
Re: Blink device script
I changed some things in notepath and now I got it running even in Domoticz. Thanx for the help, something with open en save in notepath did the trick...
Master: RPI Model 2B
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
Sub 1: RPI Model 2B
RFX transmitter/receiver 433 Mhz
13 KAKU units (3 window sensors, 1 door sensor, 7 light switches, 1 dusk sensor, 1 motion sensor)
4 IP cam
Meteostick
OTGW
P1 cable
Davis Vantage Pro weatherstation (incl. solar/UV)
Who is online
Users browsing this forum: No registered users and 1 guest