Hi All
Just a quick question really, can domoticz be set up to be controlled by a usb keyboard, so for example pressing 'a' on the keyboard would switch lights to scene 1, 'b' would switch to scene 2 etc?
Controlling Domotic by usb keyboard??
Moderators: leecollings, remb0
-
- Posts: 2
- Joined: Sunday 08 March 2015 11:22
- Target OS: -
- Domoticz version:
- Contact:
-
- Posts: 116
- Joined: Saturday 13 July 2013 13:28
- Target OS: Linux
- Domoticz version: Latest
- Location: Hilversum, The Netherlands
- Contact:
Re: Controlling Domotic by usb keyboard??
Nope
Rasp Pi 2B: 3x DS18S20 (1-wire), BME280 (i2c)
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433XL+P1, RFXtrx868, TE923 display, SolarEdge API
Cubietruck 2: Aeotec Z-Wave, Voltcraft CO-20
Cubietruck 1: Aeotec Z-Wave+, RFXtrx433XL+P1, RFXtrx868, TE923 display, SolarEdge API
Cubietruck 2: Aeotec Z-Wave, Voltcraft CO-20
-
- Posts: 115
- Joined: Sunday 11 January 2015 16:40
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Controlling Domotic by usb keyboard??
Maybe you can use some of the python code found here: http://stackoverflow.com/questions/2920 ... -in-python
-
- Posts: 2
- Joined: Sunday 08 March 2015 11:22
- Target OS: -
- Domoticz version:
- Contact:
Re: Controlling Domotic by usb keyboard??
Sadly that coding looks completely foreign to me, I not up on my coding 
Tis a pity as I was hoping this might be possible to use a flirc device which shows up as a usb keyboard and translates infrared codes to button presses... back to the drawing board it seems

Tis a pity as I was hoping this might be possible to use a flirc device which shows up as a usb keyboard and translates infrared codes to button presses... back to the drawing board it seems
-
- Posts: 1
- Joined: Thursday 07 April 2016 13:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Controlling Domotic by usb keyboard??
I had this problem as well, and figured out a way to control domoticz with a keyboard (or in my case Flirc, which acts as a keyboard). The secret is using thd, also known as triggerhappy ( more on it here http://manpages.ubuntu.com/manpages/qua ... thd.1.html )
Step 1: choose keys you won't necessarily need as they will be completely taken over. For me I used F8 to F12
To find out what keys are available type
Step 2: Write a triggerhappy conf file to run a script/command, here is my example,
This will run the following scripts when the key is pressed, when F9 is pressed it dims the livingroom lights (nothing better than dimming the lights with a tv remote control press). You can write more than one conf file as long as they don't contradict. I wrote a second one to pause and play VLC on my laptop. You could also access a domoticz switch using..
Step 3: Place the configuration files in /etc/triggerhappy/triggers.d/
Step 4: Make sure the keyboard or flirc is plugged in and run the following lines.
which parses the triggers
which restarts thd
The keys should now start the scripts.
Step 1: choose keys you won't necessarily need as they will be completely taken over. For me I used F8 to F12
To find out what keys are available type
Code: Select all
thd --listevents
Code: Select all
# /etc/triggerhappy/triggers.d/lights.conf
#
# lights control
KEY_F11 1 /home/pi/domoticz/scripts/hue_lr_on.sh
KEY_F12 1 /home/pi/domoticz/scripts/hue_lr_off.sh
KEY_F9 1 /home/pi/domoticz/scripts/hue_lr_dim.sh
Code: Select all
# /etc/triggerhappy/triggers.d/switch.conf
#
# switch 9 control
KEY_F8 1 /usr/bin/curl -s "http://192.168.0.101:8080/json.htm?
type=command¶m=switchlight&idx=9&switchcmd=Toggle"
Step 4: Make sure the keyboard or flirc is plugged in and run the following lines.
Code: Select all
thd --triggers /etc/triggerhappy/triggers.d/ /dev/input/event*
Code: Select all
sudo /etc/init.d/triggerhappy reload
The keys should now start the scripts.
Who is online
Users browsing this forum: No registered users and 1 guest