Big Ass Fans - Haiku - SenseMe plugin for VeraLite

For Discussions regarding developmnent of a vera plugin for Big Ass Fans

starting development of a vera plugin for SenseMe. work in progress at luup/plugin at master · emetens/luup · GitHub

First version is up

still need to complete install instructions

That’s awesome, been wanting to buy one of these fans and was waiting for someone to write a plugin. Karma for creating this and for making it available from Github for those of us that use openLuup in lieu of Vera.

You are welcome. Implemented this on my vera; happy to make any adjustment that might be needed for openLuup.

And yes, these fans are amazing :slight_smile:

I’ll give this a go on one of my openLuup test boxes and report back. Of course, not having the fan just yet does pose operability issues. Nonetheless, I should know if any issues arise regardless.

[quote=“emetens, post:5, topic:193882”]You are welcome. Implemented this on my vera; happy to make any adjustment that might be needed for openLuup.

And yes, these fans are amazing :)[/quote]

Awesome. Hopefully I’ll have time to complete the install instructions soon.

[quote=“CudaNet, post:6, topic:193882”]I’ll give this a go on one of my openLuup test boxes and report back. Of course, not having the fan just yet does pose operability issues. Nonetheless, I should know if any issues arise regardless.

[quote=“emetens, post:5, topic:193882”]You are welcome. Implemented this on my vera; happy to make any adjustment that might be needed for openLuup.

And yes, these fans are amazing :)[/quote][/quote]

just pushed the install instructions

I’ll give this a read and install on my virtual openLuup instance at the office…

Almost there…

Just glancing at the Lua code, it looks like some snippets of code originated from Cybrmage. I recognized this because I use Cybr’s Ademco code in openLuup and it attempts to check the openLuup ‘revisionDate’ to determine the path of the icon directory. I brought this up with Akbooer and ‘revisionDate’ is no longer used. I addressed this with Cybr’s code but will allow you to determine how you want to handle this since this is your code. Icons are respectively located in /etc/cmh-ludl/icons…

local ABOUT = {
  NAME          = "openLuup.init",
  VERSION       = "2016.06.21",
  DESCRIPTION   = "initialize Luup engine with user_data, run startup code, start scheduler",
  AUTHOR        = "@akbooer",
  COPYRIGHT     = "(c) 2013-2016 AKBooer",
  DOCUMENTATION = "https://github.com/akbooer/openLuup/tree/master/Documentation",
}
2016-10-21 14:09:54.664   openLuup.scheduler:: [5] device startup
2016-10-21 14:09:54.664   luup_log:5: (SenseMe Gateway::Startup): ************** STARTING SENSEME GATEWAY **************
2016-10-21 14:09:54.664   luup_log:5: (SenseMe Gateway::UTILITIES::setVariable) SID [urn:micasaverde-com:serviceId:SenseMe1] variable [GATEWAY_STATUS] value [Loading Options...] device [5].
2016-10-21 14:09:54.664   luup_log:5: (SenseMe Gateway::UTILITIES::getMiosVersion): vera_model [Not a Vera] mios_branch [1] mios_major [7] mios_minor [0].
2016-10-21 14:09:54.664   luup_log:5: (SenseMe Gateway::getMiosVersion): PLUGIN is running under openluup.
2016-10-21 14:09:54.669   openLuup.context_switch::  ERROR: [string "[5] I_SenseMe.xml"]:213: attempt to perform arithmetic on global 'init_year' (a nil value)
2016-10-21 14:09:54.669   openLuup.scheduler:: job aborted : [string "[5] I_SenseMe.xml"]:213: attempt to perform arithmetic on global 'init_year' (a nil value)

As a test, I modified your lua file to look for Version and we have success… Sweet !!!

ha. awesome!!

what change did you make to the lua file? i’d be happy to integrate it.

I’d steer clear of this method long term. I totally understand why Cybr did it at the time … My hack simply changed from checking ‘revisionDate’ to ‘VERSION’. Most all users of openLuup are/should be using the latest master release of code and utilizing ‘/etc/cmh-ludl/icons’.

Old method:

    if ((self:file_exists("/mios/usr/bin/cmh_Reset.sh") == false) and (self:file_exists("/etc/cmh-ludl/openLuup/init.lua") == true)) then
      log("(" .. PLUGIN.NAME .. "::getMiosVersion): PLUGIN is running under openluup.", 2)
      PLUGIN.OPENLUUP = true
      -- verify the openluup.io version and enable LIP if newer that 2016.01.26
      INITversion = self:shellExecute('head -n 3 /etc/cmh-ludl/openLuup/init.lua |grep -e "revisionDate ="')
      _, _, init_year, init_month, init_day = INITversion:find("(%d+)\.(%d+)\.(%d+)")
      init_datestamp = (init_year * 372) + ((init_month - 1) * 31) + init_day
      IOversion = self:shellExecute('head -n 3 /etc/cmh-ludl/openLuup/io.lua |grep -e "revisionDate ="')
      _, _, io_year, io_month, io_day = IOversion:find("(%d+)\.(%d+)\.(%d+)")
      io_datestamp = (io_year * 372) + ((io_month - 1) * 31) + io_day
      log("(" .. PLUGIN.NAME .. "::getMiosVersion): openluup.io datestamp [" .. (io_year or "NIL") .. "." .. (io_month or "NIL") .. "." .. (io_day or "NIL") .. "] [" .. (io_datestamp or "NIL") .. "]", 2)
      if (io_datestamp < 749978) then
        log("(" .. PLUGIN.NAME .. "::getMiosVersion): LIP mode is disabled.", 2)
        PLUGIN.DISABLE_LIP = true
      end
      if (init_datestamp > 750007) then
        log("(" .. PLUGIN.NAME .. "::getMiosVersion): OpenLuup v7 Icon fix enabled.", 2)
        PLUGIN.OPENLUUP_ICONFIX = true
      end
    end

Hack-a-doodle’d method.

    if ((self:file_exists("/mios/usr/bin/cmh_Reset.sh") == false) and (self:file_exists("/etc/cmh-ludl/openLuup/init.lua") == true)) then
      log("(" .. PLUGIN.NAME .. "::getMiosVersion): PLUGIN is running under openluup.", 2)
      PLUGIN.OPENLUUP = true
      -- verify the openluup.io version and enable LIP if newer that 2016.01.26
      INITversion = self:shellExecute('head -n 3 /etc/cmh-ludl/openLuup/init.lua |grep -e "VERSION       ="')
      _, _, init_year, init_month, init_day = INITversion:find("(%d+)\.(%d+)\.(%d+)")
      init_datestamp = (init_year * 372) + ((init_month - 1) * 31) + init_day
      IOversion = self:shellExecute('head -n 3 /etc/cmh-ludl/openLuup/io.lua |grep -e "VERSION       ="')
      _, _, io_year, io_month, io_day = IOversion:find("(%d+)\.(%d+)\.(%d+)")
      io_datestamp = (io_year * 372) + ((io_month - 1) * 31) + io_day
      log("(" .. PLUGIN.NAME .. "::getMiosVersion): openluup.io datestamp [" .. (io_year or "NIL") .. "." .. (io_month or "NIL") .. "." .. (io_day or "NIL") .. "] [" .. (io_datestamp or "NIL") .. "]", 2)
      if (io_datestamp < 749978) then
        log("(" .. PLUGIN.NAME .. "::getMiosVersion): LIP mode is disabled.", 2)
        PLUGIN.DISABLE_LIP = true
      end
      if (init_datestamp > 750007) then
        log("(" .. PLUGIN.NAME .. "::getMiosVersion): OpenLuup v7 Icon fix enabled.", 2)
        PLUGIN.OPENLUUP_ICONFIX = true
      end
    end

Perfect; I’ll integrate; it is a good start.

Do you mind if i add your screenshot to the github repo?

btw do you have a github account?

Feel free to use the screen shot. The UI is courtesy of AltUI (developer) and openLuup is courtesy of Akbooer (developer)… I do have a Git account only for notifications for updates.

[quote=“emetens, post:14, topic:193882”]Perfect; I’ll integrate; it is a good start.

Do you mind if i add your screenshot to the github repo?

btw do you have a github account?[/quote]

Forgot to mention this, looks like a tweak needed for the control rendering.

Cool. Code integrated; I also added a few lines of credits / references. If there is a landing page you want me to use for your name; github or otherwise let me know; happy to link to it!

huh. looks like all controls are on top of each other…

Appreciate it but not necessary…

Yes, might be something you can reach out to Amg0 about as I know next (ok, nothing) nothing about it… Once I’m done with our bath renovation(huge pain) I’ll order a Haiku, now I have a reason …

–Cuda

[quote=“emetens, post:18, topic:193882”]huh. looks like all controls are on top of each other…