IoT Blinds Served by QNAP

I recently spent way too much time trying to enable all the supporting software components get my IoT Blinds working natively on my Qnap.  The intent of this post is to save you all that time.

The IoT Blinds instructions call for downloading openhabian (a pre-configured OpenHab designed for a Raspberry Pi or Arduino).  Instead, I wanted to get it all running on my Qnap server.  Multiple problems presented themselves.  Neither OpenHab nor an MQTT server were in the Qnap App Store.  Qnap rolled their own competitor version of OpenHab that has MQTT built-in, BUT there are zero bindings & plugins which makes it mostly useless.  I initially installed a docker image of OpenHab – running it in Virtualization Station, but that made configuration even harder since Virtualization Station uses its own port & OpenHab is behind a NAT.  I just couldn’t get MQTT & OpenHab working together in that environment.  AND I found out that upgrading OpenHab via docker (which I’d eventually have to do) requires extra steps in order to not wipe out the config files.

Ultimately, here’s what you have to do:

  1. Install Java from qnapclub.eu (OpenHab dependency)
  2. Install Mosquitto, an MQTT server from qnapclub.eu
  3. Install OpenHab from qnapclub.eu
  4. Follow Matt’s videos on how to write the IoT Blind configs.
Location of MQTT config file on an x86 QNAP via SSH is opt/Mosquitto/etc/mosquitto/mosquitto.conf
 
The only thing you have to add there is under Default Listener section,  bind_address <then the IP of your QNAP – without the “<>” carrots>

Location of the 3 OpenHab conf files we care about on QNAP via SSH are in separate folders under opt/OpenHab/config/
 
To schedule your iOT Blinds with the sunrise or sunset, install the Astro Binding.  I found this post about how to create Astro Binding offsets, but it was too complicated.  I figured out a much simpler way.  To schedule offsets based on astronomical data, change the range event channel under your particular Thing.  I created a duplicate Astro Sun Thing & modified my offsets.  To create a duplicate: go to Things in OpenHab; select the + [which adds]; select Astro Binding; select Add Manually; then finish configuring from there.
Beware – OpenHab config files are case sensitive!  I spent hours trying to figure out why I couldn’t trigger any events until I found a capital “H” when it should’ve been lower case.  Also, to get rules working with Astro, you have to reference the RANGE EVENT, not the start & stop events.
 
Example Rule in the home.rules file that works in conjunction with Astro Things:
 
//Set Blinds to close XX mins prior to Sunset
rule "Blinds close Living"
when
 Channel 'astro:sun:51270ac1:set#event' triggered START
then
      sendCommand(LivingRoomBlinds, 100)
end

Comments are closed.

Up ↑