-
11Step 11
Now you can run it and it should be ready to respond to MQTT events. The OpenHAB item and sitemap are defined as:
Switch FamilyRoomLights "Family room lights" (Lights) { mqtt=">[mymosquitto:home/familyroomlights:command:*:default]" }
andSwitch item=FamilyRoomLights label="Floor lamps"
-
12Step 12
Assuming it works, change switch.py to run on startup. You can run this by adding a line to /etc/rc.local. In my case I had to add a "sleep 10" before the command runs in order for it to work properly.
You can also set it to run as part of a startup script in /etc/init.d, something like the way HomeAutomationForGeeks.com recommends starting OpenHAB.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.