Hi, the installation of my raspberry pi + openhab was a success
Now I am searching for hours and cant find the next step.
could someone please help me with this first project:
-Opening/closing the roll-down-curtains for ‘at-home’-simulation when away-
I installed openhab and habmin and the bindings
-network health
-gpio
-astro
fyi: The rolldowncurtain is now installed on a Eltako EGS12Z-UC
(which is working with a double switch, one up/second down)
I want to give a short pulse on a gpio pin (gpio binding) of the raspberry pi if its dark outside (astro binding) and none of the phones are in the house (nethwork health)
And a second gpio pin should be triggered if its getting light outside and no phones are in the home.
I found this script for detecting the phones: github link
but where do I write this code?
and how do I use habmin for setting this complete rule,
or do you guys advice not to use habmin?
I recommend reviewing the wiki pages to understand how Items, Rules, and the Sitemap work together. As the example describes, the first code block goes in an Items file and the second block goes in a rules file.
Hi,
I could only try to help you with your setup if you use an editor to write/mofify your items-, rules- and sitemap files.
That is:
create a file “your.items” in the openhab directory “…/openhab/configurations/items” and
paste the text segment from the wiki in such that it looks like this:
create a file “your.rules” in the openhab directory “…/openhab/configurations/rules” and
paste the text segment from the wiki in such that it looks like this:
rule "Periodically check presence"
when
Time cron "0 */5 * * * ?"
then
if (Presence.state == ON)
{
.
.
.
eck", “Somebody is home”)
sendCommand(Presence, ON)
}
}
end
create a file “your.sitemap” in the openhab directory “…/openhab/configurations/sitemaps” and
write the following text such that it looks like this:
Then check with the UI and the logs if everything is working. Switch is changing depending if your phone is logged in via wifi or not (I used the flight-mode in my phone to check).
Cheers
Björn
PS: Don’t forget to configure your openhab.cfg and to add the addons in the addons folder.
Try
"Switch phone1 (gMobiles) {nh=“192.168.1.xxx”}"
Replace 192.168.1.xxx with the IP of your device (you need to make it static).
Check.
Do you see any errors in your log?