Openhab2: Difference between revisions
No edit summary |
|||
Line 20: | Line 20: | ||
* Add each thing using the naming convention : Location_Type_Target (ie. LivingRoom_Dimmer_AccentLights) | * Add each thing using the naming convention : Location_Type_Target (ie. LivingRoom_Dimmer_AccentLights) | ||
* Click each thing and add the appropriate items for each channel | * Click each thing and add the appropriate items for each channel | ||
== Rules == | |||
===Accent Lights === | |||
<pre> | |||
// turn accent lights on at dusk | |||
rule "Accent Lights on @ Sunset" | |||
when | |||
Channel 'astro:sun:local:nauticDusk#event' triggered START | |||
then | |||
logInfo("accent.rules", "Turning Lights On @ Sunset") | |||
Group_AccentLighting.sendCommand(On) | |||
end | |||
rule "Accent Lights Off @ 10" | |||
when | |||
Time cron "0 0 22 ? * *" | |||
then | |||
logInfo("accent.rules", "Turning Lights Off @ 10") | |||
Group_AccentLighting.sendCommand(OFF) | |||
end | |||
// turn accent lights on at dusk | |||
rule "Accent Lights on @ Sunset" | |||
when | |||
Channel 'astro:sun:local:morningNight#event' triggered START | |||
then | |||
logInfo("accent.rules", "Turning Lights On @ Sunset") | |||
Group_AccentLighting.sendCommand(On) | |||
end | |||
// turn accent lights on at dusk | |||
rule "Accent Lights on @ Sunset" | |||
when | |||
Channel 'astro:sun:local:daylight#event' triggered START | |||
then | |||
logInfo("accent.rules", "Turning Lights Off @ Sunrise") | |||
Group_AccentLighting.sendCommand(Off) | |||
end</pre> |
Revision as of 20:14, 23 November 2018
Install Openhab
Just do it..
Allow Openhab to access Serial Devices by Adding 'openhab' to the Dialout Group
sudo vi /etc/group dialout:x:20:openhab
Install Z Wave Bindings
PaperUI > Add Ons > Bindings > Z-wave Binding > install
Once the Binding is installed, add the Z-wave binding as a Thing and verify that the serial port is correct. If the serial port is missing or will not be accepted, make sure you added openhab to the dialup group in the previous step.
Add Items
- Within PaperUI, Things should begin showing up in the Inbox.
- Add each thing using the naming convention : Location_Type_Target (ie. LivingRoom_Dimmer_AccentLights)
- Click each thing and add the appropriate items for each channel
Rules
Accent Lights
// turn accent lights on at dusk rule "Accent Lights on @ Sunset" when Channel 'astro:sun:local:nauticDusk#event' triggered START then logInfo("accent.rules", "Turning Lights On @ Sunset") Group_AccentLighting.sendCommand(On) end rule "Accent Lights Off @ 10" when Time cron "0 0 22 ? * *" then logInfo("accent.rules", "Turning Lights Off @ 10") Group_AccentLighting.sendCommand(OFF) end // turn accent lights on at dusk rule "Accent Lights on @ Sunset" when Channel 'astro:sun:local:morningNight#event' triggered START then logInfo("accent.rules", "Turning Lights On @ Sunset") Group_AccentLighting.sendCommand(On) end // turn accent lights on at dusk rule "Accent Lights on @ Sunset" when Channel 'astro:sun:local:daylight#event' triggered START then logInfo("accent.rules", "Turning Lights Off @ Sunrise") Group_AccentLighting.sendCommand(Off) end