Navigation

    Discussion Forum to share and further the development of home control and automation, independent of platforms.

    SmartHome Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. parkerc
    For those who registered but didn't received the confirmation email, please send an email to support@smarthome.community with the email you used
    • Multi-System Reactor Developer Preview AVAILABLE

      toggledbits

      OK, people, here we go! At long last, Multi-System Reactor developer preview is available!

      The package can be downloaded from the Reactor bug tracker, a MantisBT system (at https://reactor.toggledbits.com/mantisbt/). There is a download button in the left margin, as well as links to the documentation, which you will need for installation.

      UPDATE 2021-02-24 -- To keep spammers off, I've locked down registration on the Bug Tracker. To get access to the Bug Tracker and preview downloads, please PM me (not reply here) your full name and email address and I will set up an account for you.

      This version of MSR will run on Linux systems, including RPi's under Raspios Buster, running node.js version 12.10 or higher (v14.15.1). For RPi users, there is an installation script that will install a local copy of node.js (for the logged-in user).

      Bugs reports will be handled through the bug tracker only. Discussion and questions in this forum are fine, though (if that leads to a bug report, we'll transition).

      This version supports Vera and openLuup, Hubitat, and Home Assistant. Some of the device support on the H platforms is still a bit basic, but it is largely controlled by configuration and progress can be made quickly.

      The documentation beyond installation is a mess. Of course, I started with the existing documentation and have been massaging into MSR's particulars, but it still has a long way to go on the detail.

      I know I don't have to say this, but I will anyway... let me know how it goes!

      Multi-System Reactor
    • Vera account suspended for a 1000 years

      S

      So, after more than 10 years and 4 Vera's, my vera forum account is suspended.

      I think the monkey of the company, called melih is not man enough te have any critic. In the topic about the "great to come app" I responded to the topic (not off topic!) that a subscription can also be seen (financially) as buying a box, run it for 2 years and come to market with a better one (in better wordings).
      That means that if you as a company hast a box of 50USD cost, sell it at 250USD would give him a monthly subscription of 200/24=8.33 USD... Users that would last 5 years would pay a monthly of 3.33USD.

      But... the monkey on the rock has bolded his fists and said: ban him! He just can't take any criticism.

      To be honest! I am not even sad! It was a very rough journey with Vera. The journey stopped when Ezlo and the monkey took over the name.

      After that it quickly went downhill...

      Goodluck all! (except the monkey).

      Edit:
      The topic:

      Aug 16, 2020 MiOS Application - early Beta enrollment MiOS Application - early Beta enrollment

      are you serious? would I become a cost? that is, customers who periodically replace the control unit and are happy with the service praise the Vera system and therefore also free advertising but, the new “company” decides to charge less to bind the customer with a subscription … But the genius...

      The post:
      The point you are missing is:

      If the hardware would “cost” around 50USD, and you sold it for 250USD, an average life span of 5 years would mean 200/(5×12)=3.33USD per month. Thats how Vera used to do it.

      Then release a faster/better “beast” every 2 years gives you 200/(2×12)=8.33USD per month. That’s how vera used to do it.

      And that’s how I did it for around 8 years and 4 veras with them untill you bought the company.

      This is just a matter of how you look at it and explain it.

      I dont frikking care how you do the maths, I only liked a working product and a close user community (like it was).

      Now all I see on this forum is a lot of “we are going to” and “we are working on”, “keep them coming guys”. But the reason for ever considering to buy a new vera every 2 years is gone…

      No clear migration path, no clear compatibility path and no clear integration path…

      That’s why I started to look for alternatives…

      Vera
    • Support for 3rd party Vera plugins ?

      cw-kid

      Hi

      Does the Reactor plugin for Vera support some 3rd party Vera plugins such as the Logitech Harmony plugin for example ?

      In PLEG I am able to select a Harmony hub device and create some logic based on its various states.

      2ecefb43-5b2d-4505-aef1-dd0c5b09dc3f-image.png

      Other plugin examples might be the RGB Controller plugin which I am using with Fibaro RGBW modules, I can start the various light animations on the Fibaro RGBW module.

      19962434-a707-4301-b168-00787fea16ed-image.png

      8a629a9c-1968-40d8-a7c2-129bfebc9ac2-image.png

      Or the AltHue plugin which exposes aspects of the Hue Bridge like ColorLoop or to be able to start Hue Scenes etc.

      a8a67942-b862-4c3e-871f-f41081b20e8c-image.png

      With MSR all this type of functionality is currently lost.

      Obviously a work around would be to create Vera scenes instead and have those use these types of 3rd party plugins features and have MSR call those scenes. Don't think that would work for the Harmony plugin though where you are wanting to query states of the hub in your logic.

      I am just wondering how Reactor plugin for Vera currently works in this respect and what any plans for MSR might be ?

      Thank you.

      Multi-System Reactor
    • ALTHUE and Harmony mappings

      toggledbits

      Go ahead and open a PR for it, and we'll use that to track it.

      Multi-System Reactor
    • Installing MSR on Windows

      A

      @toggledbits said in Multi-System Reactor Developer Preview AVAILABLE:

      Version 21054 now available.
      ...
      2. This version runs on Windows, and there are draft instructions for how to get it installed.

      I am so excited!

      Sorry that I need to bother with a noob question at the first step😂
      Does this box need to be checked for MSR to run nicley?
      7bc519af-f0e4-46af-a040-0ce261d08a8f-image.png

      Multi-System Reactor
    • Setting RGB colour values

      cw-kid

      "You need to use 0.0 to 1.0, not 0 to 255 (just like dimming values)."

      How would I set the colour Purple as an example ?

      Its RGB value is: 128, 0, 128

      Thanks

      Multi-System Reactor
    • Still unable to set Thermostat setpoint

      J

      Just to let you know that I've updated to version 21054, but the added basic support for generic thermostats still does not allow me to set the current setpoint for either my Horstmann Thermostat or the Auto Virtual Thermostat.

      Multi-System Reactor
    • States 21053 but running 21054

      M

      Having updated to 21054 it still states 21053 in MSR although hard refresh in Chromium (Ctrl-F5) and even re-boot. Reading the startup log it runs 21054:

      2021-02-24T06:30:51.773Z app:null Reactor application v21054 starting on v14.15.4
      2021-02-24T06:30:51.779Z app:INFO Process ID 1801; platform linux/arm #1402 SMP Tue Feb 16 14:12:18 GMT 2021
      2021-02-24T06:30:51.818Z default:INFO Module Entity v21025
      2021-02-24T06:30:51.825Z Controller:null Module Controller v21054
      2021-02-24T06:30:51.827Z default:null Module Structure v21050
      2021-02-24T06:30:51.843Z default:null Module Ruleset v21041
      2021-02-24T06:30:51.844Z default:null Module Rulesets v21041
      2021-02-24T06:30:51.874Z default:null Module Rule v21051
      2021-02-24T06:30:51.882Z default:null Module Engine v21054
      2021-02-24T06:30:51.884Z default:null Module httpapi v21041
      2021-02-24T06:30:51.891Z default:null Module httpproxy v21054
      2021-02-24T06:30:51.945Z default:null Module wsapi v21053
      ...

      Probably something I am missing but can not figure out why

      Multi-System Reactor
    • Cant se Hubitat modes entity in msr

      M

      I have entered in Maker API that allow endpoint to control Modes. But in MSR I cant find modes entity for hubitat. The vera plus has it.

      Is it not just mapped in MSR?
      /Mattias

      Multi-System Reactor
    • IF Else without LUA Code ?

      cw-kid

      I guess there is no way to do IF Else statements without using LUA code ?

      This is a small portion of code, I've just copied out of one of my PLEG actions run LUA Code.

      The code checks a WOL with Ping switch in Vera, if its ON, it then sends a particular HTTP request to that Kodi HTPC to bring an IP Camera image on screen

      It then does the same check for the next WOL with Ping switch / Kodi HTPC and so on etc.

      Also the code checks Harmony activities to see if I'm currently in a FireTV activity instead? and if so sends a particular HTTP request to do Picture in Picture on the FireTV stick.

      local status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", 38) --Check Status of KODI01 WOL switch if status == "1" then --If on then send command to show Security Cam os.execute('curl -X POST -H "content-type:application/json" http://kodi:kodi@192.168.1.101:8080/jsonrpc -d \'{"jsonrpc":"2.0","id":1,"method":"Addons.ExecuteAddon","params":{"addonid":"script.frontgardencam"},"id":"1"}\'') else end local status = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", 39) --Check Status of KODI02 WOL switch if status == "1" then --If on then send command to show Security Cam os.execute('curl -X POST -H "content-type:application/json" http://kodi:kodi@192.168.1.102:8080/jsonrpc -d \'{"jsonrpc":"2.0","id":1,"method":"Addons.ExecuteAddon","params":{"addonid":"script.frontgardencam"},"id":"1"}\'') else end

      I can't see that this would be possible using just an MSR rule ?

      Thanks

      Multi-System Reactor
    • Can't see VeraPlus and Hubitat (config question)

      M

      Him ... Got The reactor up and running but I can't see my Vera Plus and Hubitat.

      I have restarted the reactor after doing necessary input in the reactor.yaml file.reactor:

      What could I be doing wrong? Runs on a RPI

      Is it correct ?

      baseurl - The base URL to access the Reactor system.

      baseurl: "http://192.168**.***:8111"

      units - imperial or metric

      units: metric
      location:node app js
      city: "Stockholm City"
      # Non-US users please use "province"
      state: "GA"
      #province: "Akersberga"
      postal: "18494"
      # Must be ISO two-character country code (i.e. the ISO 3166-1 Alpha 2 code)
      country: "SE"
      # Must be properly set for sunset/sunrise calculation.
      latitude: 59.26465
      longitude: -18.14490
      # Units of elevation are meters (multiply feet by 0.3408 to get meters)
      elevation: 0

      controllers:

      id: vera
      enabled: true
      implementation: VeraController
      name: Penthouse 🙂
      config:
      source: 'http://192.168..*_3480'

      id: hass
      enabled: false
      implementation: HassController
      name: A Home Assistant system
      config:
      source: 'http://192.168.0.7:8123'
      access_token: "place long-lived access token within"

      id: hubitat
      enabled: true
      implementation: HubitatController
      name: Penthouse
      config:
      source: 'http://192.168..'
      access_token: '*************************************'

      Multi-System Reactor
    • Running Lua Code ? And watching device properties?

      cw-kid

      Hi

      In some of my PLEG actions I run Lua code.

      I guess I can't do that now with MSR. Assume I have to create a Vera scene with that same LUA code and have the MSR action call that scene etc.

      What about the people who were using Reactor plugin for Vera? I assume they can run Lua code.

      But won't be able to when using MSR on a separate box to Vera.

      I am also seeing other things I am doing in PLEG but don't think I will be able to on MSR? Like monitoring devices for certain things.

      For example I use PLEG with Fibaro Dimmer 2 modules to enable me to use the Scene Activation for double and triple clicks on the actual wall switches, PLEG sees this happening and then my action can run a Vera scene or whatever else I want.

      I have three "Device Properties" setup in PLEG to monitor those aspects of the Fibaro Dimmer 2 device.

      078cad4f-ebee-4951-a631-304da033d60f-image.png

      Then this condition in PLEG:

      (LoungeSceneActivated;LoungeLastSceneTime) and (LoungeLastSceneID == 15)

      Runs an action when I double click the Lounge Light wall switch.

      Thanks

      Multi-System Reactor
    • Updated to 0.1.21054 but it still says 0.1.21053

      cw-kid

      As per the title, I tried the update process twice.

      Multi-System Reactor
    • Will MSR have its own Http API? (Luup Requests)

      cw-kid

      If my longer term goal is to just use Vera as a Z-Wave radio only.

      Or to maybe even replace Vera and Ezlo altogether with another Z-Wave hub like Hubitat or perhaps even a USB stick Z-Wave.me Z-Way or something (Assuming MSR supports that platform you plan to move to etc) .

      Then all my "Scenes" might end up being rules in MSR.

      These rules in MSR may have triggers that are automated as I'm setting up right now, or they may not have any triggers at all, other than being manual, like you can setup a manual scene in Vera.

      I'd then want to be able to initiate some of those "scenes" by sending http requests to MSR from other devices and apps on my LAN.

      Presumably for controlling Z-Wave devices directly on / off / dim etc, I'd been sending http requests to whatever the new Z-Wave hub might be? Hubitat or whatever.

      Just thinking how you'd fully move away from Vera and any Vera scenes.

      Or is this more the realm of OpenLuup? With using Vera still as the Z-Wave radio or a Z-Wave USB stick, which do they support?

      In short I'd like to be able to send a simple one line HTTP request to MSR to have it run a particular "Set Reaction" action(s).

      Multi-System Reactor
    • Would you use a self-hosted geofencing solution?

      toggledbits

      Some of you may know that I took at shot at building an alternate geofencing solution for Vera. The core of it was system agnostic, using the OwnTracks application and AWS lambdas to track devices and keep a central data, then disseminate that to the Vera via a websocket-based plugin. It worked with other apps as well, including Tasker and GPSLogger, but of the dozen people that were testing it, most used OwnTracks.

      A lot was learned in the process, not the least of which is that the success of any such solution is highly dependent on the phone and its settings. Phone manufacturers love to set things up for the longest battery life, of course, but that's usually very anti-geofencing behavior. In the case of at least one brand, it was unusable and the settings could not be modified. It was also cost-prohibitive to maintain on Amazon, as AWS grabs a dime here and a dollar there and before you know it, it added $100/month to my AWS bill, which my wife deducted from my Scotch budget. Unacceptable.

      But it's quite reasonable to use OwnTracks to a local endpoint, and I could pretty easily replicate the functionality as a local application, or maybe even as an additional endpoint built into MSR's API (still separate port and process, but in the package).

      So the question really is... would you do it, or would you be too concerned about the security risks associated (e.g., dynamic DNS and NAT mapping in the firewall necessary for the phone to contact the service when not on LAN)?

      General Discussion
    • SiteSensor triggered my both sirens

      S

      Installed Sitesensor yesterday. Defined a http request towards yr.no for the weather.
      Default it only sends requests when the device is armed. When I armed the sensor both of my sirens started bleeping. Not funny with at night with two kids asleep.

      Simultaneous with arming the device, the first http request probably is send and my first http request did not have the Useragent http header so the result was a 403; this probably made the sitesensor device being triggered.

      I unchecked the box "only send requests when armed" and disarmed the sitesensor. This works ok but only one slight mistake with thick fingers and I have armed it again.

      I see the sitesensor device is being configured as a SecuritySensor (as it implements the securitysensor serivce?). This makes that sirens react when the sitesensor trips. I have a leakage sensor as well and I know this one triggers the sirens as well. Do not have any doorsensors right now but hope these will not trigger sirens as well.

      Is there a way to tell Sirens to ignore Sitesensor and/or other specific devices. Or should sitesensor not be configured as a security device?
      Is there an easy solution?

      Grtz Swiddy

      Some details:
      -Vera Secure box with built in siren (siren is a separate device)
      -POPP Smokedetector with siren
      -Upto-date with Vera firmware and Not on Openluup yet but don't think this would make a difference here

      General Discussion
    • Another transition from Vera to OpenLuup - PerH

      PerH

      So cool to find the forum of all the banned vera gurus!

      I've had a Vera Plus for about 6 years now, and have had a fairly problem free time with it compared to many other stories. The last years have however been lacking in progression in many fields i'd like to explore, so now i'm looking closely at Openluup.
      Other systems have been tested as well, but i find that the community and plugins made for vera is kind of special, and something i'd like to contribute to as well. (getting older and not wanting to change to new stuff probably plays a part too!)

      So, my stab at opeluup starts with an HP Chromebox 1 i got for free. Its a fairly powerfull thing, but as google wants to sell new ones, its now EOL.
      I wiped it clean and installed debian, as it seems to be the closest thing to raspberry which many use for openluup.

      Openluup installed fine, and i got the vera bridge working fairly well by bothering ppl at the vera forum with questions. Its now running OK, but there seems to be an issue with Icons?

      f0e29622-0397-4b84-819c-f1b632daab41-image.png

      Also at the devices tab:
      2892faff-a3ee-4f21-9db8-2a03f604fc74-image.png

      I did the "GetFiles", and I see the /icons/ is populated, but no icons. In the luup log says that its trying to GET the icon, but returns no packages.

      2020-09-15 17:04:30.818 openLuup.server:: GET /cmh/skins/default/img/devices/device_states/dimmable_light_off.png HTTP/1.1 tcp{client}: 0x55eca8d90cb8 2020-09-15 17:04:30.819 openLuup.server:: request completed (0 bytes, 0 chunks, 0 ms) tcp{client}: 0x55eca8d90cb8

      I do have a UZB stick on the way, but before i go down that road i'd like to be sure that the installation is stable and sound.. Do I have all the nessecary packages/background processes? I did install cjson which helped on some things..

      Also fairly new at linux in general, so bear with me. 😉

      Roadmap:

      Get the openluup/AltUI running smoothly
      Transfer Z-wave devices
      Transfer 433 devices (RFXtrx plugin)
      Transfer Zigbee devices (Vera or mabye ezlo plus? zigbee stick?)

      more questions will follow!

      Blogs
    • Does this rule look correct ?

      cw-kid

      Schedule to turn on two side table lamps, 40 minutes before Sunset (everyday of the week) with some Constraints (Conditions) attached.

      Condition 1 = Both lamps have to be off in the first place

      AND

      Condition 2 = A virtual switch called “Dark Mode” should be off

      AND

      Condition 3 = Vera is NOT in either house mode “away” OR “vacation”

      I hope the screen shot is readable.

      1de0e3ca-0104-40b6-a3f3-0fbf2b33ea87-image.png

      I am a Reactor luddite and just want to make sure I am getting things in the right order / areas of the rule.

      Thanks

      Multi-System Reactor
    • Odd console display for triggers

      rafale77

      Screen Shot 2021-02-23 at 07.14.43.png

      @akbooer , I just noticed these last 3 watches which have a serviceID appended behind them in the console. It is only the last 3 and I can't figure out why. Any idea?

      openLuup
    • Profile
    • Following 0
    • Followers 0
    • Topics 6
    • Posts 61
    • Best 3
    • Groups 0

    parkerc

    @parkerc

    7
    Reputation
    34
    Profile views
    61
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    parkerc Follow

    Best posts made by parkerc

    • Lua: Report - Last Trip

      I’m sure there is a better/more polished way to do this, but this remains one of my go to report urls on Vera.

      
      -- http://forum.micasaverde.com/index.php?topic=52025.msg334246#msg334246
      
      local d, n
      local file = io.open("/www/sb.html", "w")
         file:write("<head> <meta http-equiv='refresh' content='30' /> </head>\n")
         file:write("<style>.custom { font-size: 1em; font-family: Gill Sans Extrabold, sans-serif; padding:5px; border-collapse: collapse; border: 1px solid black; }</style><table class=custom><tr class=custom><th class=custom>Security Sensor</th><th class=custom>Last Tripped</th></tr>\n")
      
      local tt = {}
      for n,d in pairs(luup.devices) do
      
          if d.category_num == 4 then
          -- local lasttrip = tonumber(luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1", "LastTrip", n) or 0,10)
          local lasttrip = tonumber(luup.variable_get ("urn:micasaverde-com:serviceId:SecuritySensor1", "LastTrip", n) or os.time())
          local timeString = os.date(" %Y/%m/%d - %X", lasttrip)
          
          if lasttrip > 0 then
              table.insert(tt, { devnum=n, last=lasttrip, ltime=timeString })
          end
        end
      end
      
      table.sort(tt, function(a,b) return a.last > b.last end) -- sort highest to lowest
      
      for n,d in ipairs(tt) do
          
         file:write("<tr class=custom><td class=custom>" .. luup.devices[d.devnum].description .. "</td><td class=custom>".. d.ltime .. "</td></tr>\n")
      
          print (
          d.ltime ..
         ' : ' .. luup.devices[d.devnum].description .. " Sensor was last tripped")
      end
      file:write("</table>\n")
      file:close()
      
      
      posted in Code/Snippet library
      parkerc
      parkerc
    • RE: Discover IR codes for lost remote

      There is a great community/code bank on GitHub.

      probonopd/irdb

      probonopd/irdb

      One of the largest crowd-sourced, manufacturer-independent databases of infrared remote control codes on the web, and aspiring to become the most comprehensive and most accurate one - probonopd/irdb

      Index of codes is here - https://github.com/probonopd/irdb/blob/master/index

      With their API - http://irdb.tk/api

      And you can retrieve a .csv set for anyone via https://cdn.jsdelivr.net/gh/probonopd/irdb@master/codes/Samsung/TV/7,7.csv

      posted in General Discussion
      parkerc
      parkerc
    • RE: Happy Birthday openLuup!

      Happy Birthday!

      posted in openLuup
      parkerc
      parkerc

    Latest posts made by parkerc

    • RE: Recover an ‘assumed bricked’ Vera Secure

      Looks a nice set up..

      Oh, you’ve just reminded me, I use my QNAP as a NVR too (6 cameras), plus I also have ‘ sonos-http-api’ running (using Joanna), and PiHole’ too.

      Connectivity wise, I use my UniFi home set up for VPN, and it has 3 networks, (I) Private LAN, (ii) Guest (Internet Only) for visitors & IoT devices (Alexa/Ring etc) and (iii) Video (IP TV) - I’d really like to embed my UniFi controller into my HA much more, as it has a lot of useful info, energy usage (via PoE), presence awareness via access points. Currently I just do some json calls here and there.

      posted in General Discussion
      parkerc
      parkerc
    • RE: Recover an ‘assumed bricked’ Vera Secure

      Interesting set up - I’ve lost count of the different setups I’ve tried over the years, from mini pcs, rPis, VM, Dockers etc. all of which had their merits, but I often found myself back under the hood of my Vera trying to make something work.

      It was evident early on that Vera was never going to do everything - hence looking back (7 years ago) I was trying to work out what ‘combo’ would be best - https://community.getvera.com/t/the-ultimate-partner-for-vera/175184 - and that journey continues.

      Today it’s

      2 x VeraPlus,
      2 x Raspberry Pi 3 B+ (Lua, z-way, Node-Red, USB/Serial Bridges for RFXTRX433, DSC Alarm, CurrentCost Energy)
      2 x QNAP NAS (Running 1 x Homebridge (Docker) , 1 x Openluup ** (Docker) and is the SMB/CIFS target for any/all storage needs

      ** - more for interest/fun as the UI is terrible on my iPad (which is my primary device)

      But.. no matter what I do, my Vera and it’s UI continues to remain my focal point (primary controller) ..

      posted in General Discussion
      parkerc
      parkerc
    • RE: Recover an ‘assumed bricked’ Vera Secure

      Thanks @rafale77 i totally understand 🙂

      can I ask what you’re using now that’s “ much less brick-able and as I found out more flexible, cheaper and more power efficient ‘ -

      that sounds like the holy grail !!

      posted in General Discussion
      parkerc
      parkerc
    • RE: Recover an ‘assumed bricked’ Vera Secure

      Hi @rafale77 -

      Hope all is well and that you had a good Xmas etc..

      I’m resurrecting an old post to see if I can give things another go, but so as I’ve not been able to get the VeraSecure to show very much (if any life) to connect to the network.

      With that in mind, have you tried any of the following ‘debricking’ techniques?

      OpenWrt Debricking Guide
      Recover from a bad flash - DD-WRT Wiki
      posted in General Discussion
      parkerc
      parkerc
    • RE: Discover IR codes for lost remote

      Well, they say in life "nothing ventured, nothing gained" and thanks to this forum and stackoverflow, I’ve got a working solution.

      Code is below, any feedback on optimisation is always appreciated.

      local lfs = require "lfs"
      local read_file_path = "/mnt/nas/vera/text1.txt" -- # path to your file here
      local write_file_path = "/mnt/nas/vera/text2.txt" -- # path to your file here
      local pattern1 = "^.*Power.*$" -- # your pattern to find
      local pattern2 = "^.*0000.*$" -- # your pattern to find
      
      io.open("/mnt/nas/vera/text5.txt", 'a'):close()
      --local logFile = io.open(write_file_path, 'w')
      local logs = {} -- We will use this to log the messages to log.txt later 
      
      local i = 1;for line in io.lines(read_file_path) do
      if (line:find(pattern1) or not line:find('%A')) and line:len() > 1 then
      	local powerref = line
      	logs[#logs+ 1] = 'Command: ' .. powerref
        elseif line:find(pattern2) then
      	  local prontoCode = line
      	  local x = 1 do
      	  x = x + 1
      	  local pause = os.clock()
      	  print('"' ..prontoCode..'"')
      	  luup.call_action('urn:a-lurker-com:serviceId:IrTransmitter1', 'SendProntoCode', {ProntoCode = prontoCode}, 49)
      
           --  x = x + 1
           --  local pause = os.clock()
            repeat until os.clock() > pause + 3
      	local time = os.date("%Y-%m-%d %H:%M:%S")
      	  local xfile = io.open("/mnt/nas/vera/text5.txt", 'a')
      		xfile:write(time .. " - " .. prontoCode .. "\n")
      		xfile:close()
        end
      		 logs[#logs + 1] = 'Sequence: ' .. line
        end; i = i + 1 -- Raise the line number
      end
      local logFile = io.open(write_file_path, 'w')
      logFile:write(table.concat(logs, '\n'))
      logFile:flush()
      
      posted in General Discussion
      parkerc
      parkerc
    • RE: Discover IR codes for lost remote

      I fear, I may have hit my Vera/Lua wall.

      I seem to have been able to partially rework the output from IrScrutinizer, but I can’t seem to get it into an appropriate format for @a-lurker’s code to then run through them all in sequence..

      Input file (text1.txt) from IrScrutinizer

      Power
      0000 0070 0000 0032 0080 0040 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0030 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0010 0010 0030 0010 0030 0010 0030 0010 0ACD
      
      Power$1
      0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 05F7 015B 0057 0016 0E6C
      
      Power$2
      
      0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0019 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0041 0016 0019 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 05F7 015B 0057 0016 0E6C
      
      

      Current Output file (text2.txt)

      The ‘print’ looks positive, however I can’t seem to get each line in the correct format in the text2.txt file, it always spans 2 lines.

      local Power
       = "0000 0070 0000 0032 0080 0040 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0030 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0010 0010 0030 0010 0030 0010 0030 0010 0ACD
      "
      local Power$1
       = "0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 05F7 015B 0057 0016 0E6C
      "
      local Power$2
       = "0000 0068 0000 0022 0169 00B4 0017 0044 0017 0044 0017 0017 0017 0017 0017 0017 0017 0044 0017 0017 0017 0044 0017 0017 0017 0017 0017 0044 0017 0044 0017 0044 0017 0017 0017 0044 0017 0017 0017 0044 0017 0017 0017 0017 0017 0044 0017 0044 0017 0017 0017 0017 0017 0044 0017 0017 0017 0044 0017 0044 0017 0017 0017 0017 0017 0044 0017 0044 0017 0017 0017 0636
      "
      local Power$3
       = "0000 006D 0011 000E 0013 005F 0013 0026 0026 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0227 0013 005F 0013 0026 0013 0013 0026 0013 0013 0026 0013 0013 0013 0013 0013 0013 0013 0013 0026 0026 0026 0026 0013 0013 0026 0026 0013 1054
      "
      
      

      Latest code is below.. All ideas/suggestions welcome

      -- https://oc.cil.li/topic/1524-how-can-i-store-each-line-of-a-file-in-an-array-in-lua/#comment-6763
      -- CP: does not Work
      -- v0.9
      
      function sendProntoCodeToBroadLinkDevice(prontoCode)
         local BROADLINK_DEVICE_ID = 49
         luup.call_action('urn:a-lurker-com:serviceId:IrTransmitter1', 'SendProntoCode', {ProntoCode = prontoCode}, BROADLINK_DEVICE_ID)
      end
      
      local write_file_path = "/mnt/nas/vera/text2.txt" -- # path to your file here
      local read_file_path = "/mnt/nas/vera/text1.txt" -- # path to your file here
      local pattern1 = "^.*Power.*$" -- # your pattern to find
      local pattern2 = "^.*0000.*$" -- # your pattern to find
      local matches = {}
      io.open(write_file_path,"w+"):close()
      
      local function contains(str, pattern)
        return string.match(str, pattern) and true or false
      end
      
      for line in io.lines(read_file_path) do
        if contains(line, pattern1) then
      	  command = (line)
      	-- table.insert(matches, line1)
      end
      	if contains(line, pattern2) then
      		ProntoCode = (line)		  
      	-- table.insert(matches, line1, line2)
      
      	local irstr = command .. "" .. ProntoCode
      	--print(irstr)
      	print(string.format('local %s = "%s"\n',command,ProntoCode))
      	local file = io.open(write_file_path, 'a')
      	-- file:write(command .. "" .. ProntoCode .. "\n")
      	-- file:write(irstr .. "\n")
      	file:write(string.format('local %s = "%s"\n',command,ProntoCode))
      	file:close()
      	end
      end
      
      local INTERVAL_SECS = 2
      luup.call_delay('sendProntoCodeToBroadLinkDevice', INTERVAL_SECS, prontoCode)
      
      posted in General Discussion
      parkerc
      parkerc
    • RE: Discover IR codes for lost remote

      Thanks @htchemg - I’ve actually already tried that route, I had a GC-100 for years, but sadly they do not have the manufacturer and/or model I need listed. Hence I’m sadly trying this long winded route to discover what it is 😢

      posted in General Discussion
      parkerc
      parkerc
    • RE: Discover IR codes for lost remote

      I had been working on something like this, is it close?

      local ircodearray =  {}
      
      local rfile = io.open("mnt/nas/vera/text1.txt", "r")
      
      for line in rfile:lines() do
          local commandname = line:match("^Powe.*")
      	local prontocode = line:match("^0000.*")
          local ircodearray = {"local = " .. commandname, prontocode}
      end
      
      print(ircodearray)
      
      posted in General Discussion
      parkerc
      parkerc
    • RE: Discover IR codes for lost remote

      Thanks @akbooer, although I’m ideally trying to get the output of that array to be something like this..

      Power = "0000 0070 0000 0032 0080 0040 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0030 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0010 0010 0030 0010 0030 0010 0030 0010 0ACD"
      Power$1 = "0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 05F7 015B 0057 0016 0E6C"
      Power$2 = "0000 0068 0000 0022 0169 00B4 0017 0044 0017 0044 0017 0017 0017 0017 0017 0017 0017 0044 0017 0017 0017 0044 0017 0017 0017 0017 0017 0044 0017 0044 0017 0044 0017 0017 0017 0044 0017 0017 0017 0044 0017 0017 0017 0017 0017 0044 0017 0044 0017 0017 0017 0017 0017 0044 0017 0017 0017 0044 0017 0044 0017 0017 0017 0017 0017 0044 0017 0044 0017 0017 0017 0636’
      

      Running the script you chafed above retuned this...

      LuaTest 1.7
      
      Lua file: /etc/cmh-ludl/luatest.lua
      
      Results
      No errors
      Runtime: 55.4 ms
      Code returned: nil
      
      Print output
      { [1]=0, [2]=112, [3]=0, [4]=50, [5]=128, [6]=64, [7]=16, [8]=16, [9]=16, [10]=48, [11]=16, [12]=16, [13]=16, [14]=16, [15]=16, [16]=16, [17]=16, [18]=16, [19]=16, [20]=16, [21]=16, [22]=16, [23]=16, [24]=16, [25]=16, [26]=16, [27]=16, [28]=16, [29]=16, [30]=16, [31]=16, [32]=16, [33]=16, [34]=48, [35]=16, [36]=16, [37]=16, [38]=16, [39]=16, [40]=16, [41]=16, [42]=16, [43]=16, [44]=16, [45]=16, [46]=16, [47]=16, [48]=48, [49]=16, [50]=16, [51]=16, [52]=16, [53]=16, [54]=48, [55]=16, [56]=16, [57]=16, [58]=16, [59]=16, [60]=16, [61]=16, [62]=16, [63]=16, [64]=16, [65]=16, [66]=16, [67]=16, [68]=48, [69]=16, [70]=16, [71]=16, [72]=48, [73]=16, [74]=16, [75]=16, [76]=48, [77]=16, [78]=48, [79]=16, [80]=48, [81]=16, [82]=48, [83]=16, [84]=16, [85]=16, [86]=16, [87]=16, [88]=48, [89]=16, [90]=16, [91]=16, [92]=48, [93]=16, [94]=48, [95]=16, [96]=16, [97]=16, [98]=48, [99]=16, [100]=48, [101]=16, [102]=48, [103]=16, [104]=2765 }     
      { [1]=0, [2]=108, [3]=34, [4]=2, [5]=347, [6]=173, [7]=22, [8]=22, [9]=22, [10]=22, [11]=22, [12]=22, [13]=22, [14]=22, [15]=22, [16]=22, [17]=22, [18]=22, [19]=22, [20]=65, [21]=22, [22]=22, [23]=22, [24]=65, [25]=22, [26]=65, [27]=22, [28]=65, [29]=22, [30]=65, [31]=22, [32]=65, [33]=22, [34]=22, [35]=22, [36]=65, [37]=22, [38]=65, [39]=22, [40]=22, [41]=22, [42]=65, [43]=22, [44]=22, [45]=22, [46]=22, [47]=22, [48]=65, [49]=22, [50]=22, [51]=22, [52]=22, [53]=22, [54]=22, [55]=22, [56]=65, [57]=22, [58]=22, [59]=22, [60]=65, [61]=22, [62]=65, [63]=22, [64]=22, [65]=22, [66]=65, [67]=22, [68]=65, [69]=22, [70]=65, [71]=22, [72]=1527, [73]=347, [74]=87, [75]=22, [76]=3692 }     
      { [1]=0, [2]=104, [3]=0, [4]=34, [5]=361, [6]=180, [7]=23, [8]=68, [9]=23, [10]=68, [11]=23, [12]=23, [13]=23, [14]=23, [15]=23, [16]=23, [17]=23, [18]=68, [19]=23, [20]=23, [21]=23, [22]=68, [23]=23, [24]=23, [25]=23, [26]=23, [27]=23, [28]=68, [29]=23, [30]=68, [31]=23, [32]=68, [33]=23, [34]=23, [35]=23, [36]=68, [37]=23, [38]=23, [39]=23, [40]=68, [41]=23, [42]=23, [43]=23, [44]=23, [45]=23, [46]=68, [47]=23, [48]=68, [49]=23, [50]=23, [51]=23, [52]=23, [53]=23, [54]=68, [55]=23, [56]=23, [57]=23, [58]=68, [59]=23, [60]=68, [61]=23, [62]=23, [63]=23, [64]=23, [65]=23, [66]=68, [67]=23, [68]=68, [69]=23, [70]=23, [71]=23, [72]=1590 }
      

      Sorry to ask this, but how can that be achieved?

      posted in General Discussion
      parkerc
      parkerc
    • RE: Discover IR codes for lost remote

      Thanks again @akbooer 🤩

      Last ask 🤞- how would you convert the IrScrutinizer created file (the one with all the converted ProntoCodes posted above) into a list/table/array/.csv - that I can then use with @alurker’s original post for his Broadlink irsender ?

      posted in General Discussion
      parkerc
      parkerc