Skip to main content

Posts

Showing posts from April, 2017

Motion Lights using Philips Hue with Z-Wave Sensors

To work around the limitations of Fibaro HCL that does not allow you to use LUA scripts, Domotics fill that gap and allows you to use more than just Z-wave devices.

The major problem with using Hue with the HCL, is that the Hue API requires action via a HTTP PUT to change the state of the lights. The HCL only allows HTTP GET using the string method for Virtual Devices.

Domoticz allows you to add Hue directly as "Hardware" and automatically adds all the  bulbs and scenes as "Devices". To trigger the API to Domoticz, we use HTTP GET (yes, that is a Yay!!!).

Create a 2 button virtual device with the following string using the IP address and port of the Domoticz server

On button:

GET /json.htm?type=command&param=switchlight&idx=&switchcmd=On&level=0&passcode= HTTP/1.10x0D0x0A0x0D0x0A

Off  button:

GET /json.htm?type=command&param=switchlight&idx=&switchcmd=Off&level=0&passcode= HTTP/1.10x0D0x0A0x0D0x0A
When we create the new scene …

Alexa, Turn on Computer

There is many ways to wake your computer up and put your computer to hibernate using Alexa.

I will use:

1. computer with cygwin enabled with sshd service 2. domoticz on a raspberry pi 3. ha-bridge on raspberry pi 4. Amazon echo
I'm more of a computer user than a developer, but I find that Domoticz is great as it helps non-developers download unix commands and allow a direct call to shell scripts.

More great things about Domoticz is that it convert HTTP POST to GET methods when you are using triggers that can't do POST to Philips Hue lights (I will cover that in another post)


Step 1: Setup a dummy hardware used for virtual switches



Step 2: Create a virtual sensor as a light switch called Computer

For the On script use:
script:///home/pi/domoticz/scripts/pc-wake.sh

The bash script should contain

#!/bin/bash
wakeonlan  BC:5F:F4:88:92:B6


For the Off script use:
script:///home/pi/domoticz/scripts/pc-hibernate.sh
This bash script contents are; (Replace X with the IP address of the c…

Alexa Turn On / Off TV

I have a Samsung LED smart TV. The "smart" TV let's you turn off the TV, but it doesn't let you turn it on as the IP address is not available when it's off.

That sort of makes sense.

While it is possible to then download a command to turn off the TV. you will need to go through the TV settings to enable HDMI-CEC. This means that turning on the apple TV for example will in turn turn on the TV and set the channel to Apple TV.


What you need.

1. Domoticz
2. iSamsung command (https://www.domoticz.com/wiki/Samsung_TV)
3. atvremote command (i took this from homeassistant)


Use Domoticz to create a dummy device and add a virtual selector device.




There are 4 buttons I programmed and here are the corresponding commands.

if your TV has the IP address 192.168.1.x (Replace x with the actual IP address of the TV)

To turn the TV off
script:///usr/local/bin/iSamsungTV 192.168.1.x -KEY KEY_POWEROFF

To use Apple TV to turn on the TV to Apple TV channel
script:///srv/homeassistant/bi…