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
    • Unsolved
    (Last Updated: October 26, 2020)
    • Status of SMARTHOME and SwitchLinc products

      D

      Is the Smarthome company still existent? If so, are SwitchLinc switched still available?

      General Discussion
    • Smart door lock

      D

      Hi! I want to install a smart lock on my front door, but I don't know which one to choose. There are many different models available on the market. Do you have a reliable model to recommend?

      General Discussion
    • Lua - Code to encrypt / decrypt with AES 128 CBC

      parkerc

      Hi

      I’m looking to rework some code I found online so I can use it on Vera, and while I’ve managed to translate / convert a number of things, I’ve got stuck on a few things it does, around encryption/decryption etc.

      All the original Lua code is here - > (https://forum.logicmachine.net/showthread.php?tid=232&pid=16580#pid16580 )

      Plus there looks to be a python version too here - > (https://github.com/florianholzapfel/panasonic-viera/issues/9#issuecomment-476919658)

      Here’s an extract of the code where AES 128 CBC is required?

      function encrypt_soap_payload(data, key, hmac_key, iv) payload = '000000000000' n = #data payload = payload .. string.char(bit.band(bit.rshift(n, 24), 0xFF)) payload = payload .. string.char(bit.band(bit.rshift(n, 16), 0xFF)) payload = payload .. string.char(bit.band(bit.rshift(n, 8), 0xFF)) payload = payload .. string.char(bit.band(n, 0xFF)) payload = payload .. data aes_cbc, err = aes:new(key, nil, aes.cipher(128, 'cbc'), { iv = iv }, nil, 1) ciphertext = aes_cbc:encrypt(payload) sig = encdec.hmacsha256(ciphertext, hmac_key, true) encrypted_payload = encdec.base64enc(ciphertext .. sig) return encrypted_payload end function decrypt_soap_payload(data, key, hmac_key, iv) aes_cbc, err = aes:new(key, nil, aes.cipher(128, 'cbc'), { iv = iv }, nil, 0) decrypted = aes_cbc:decrypt(encdec.base64dec(data)) decrypted = string.gsub(string.sub(lmcore.strtohex(decrypted), 33), '%x%x', function(value) return string.char(tonumber(value, 16)) end) return decrypted end

      I can get to the point where I can create the parameters for the payload encrypt request (example below), it’s just the encryption/decryption I cant do..

      data="1234" key="\\S„ßÍ}/Ìa5!" hmac_key="¹jz¹2¸F\r}òcžÎ„ 臧.ª˜¹=¤µæŸ" iv=" {¬£áæ‚2žâ3ÐÞË€ú "

      I’ve found this aes.lua (https://github.com/openresty/lua-resty-string/blob/master/lib/resty/aes.lua ) module online, but that requires loads of others modules too, most notably ffi.lua. Which I’d ideally like to avoid.

      I also came across this aes128.lua (https://github.com/somesocks/lua-lockbox/blob/master/lockbox/cipher/aes128.lua ) but i’m not sure how that handles all the other parameters e.g specify the cbc aspect etc.

      Finally there’s this aes256ecb.lua script (https://github.com/idiomic/Lua_AES/blob/master/AES.lua) , could that be converted to aes 128 cbc and then used in the above?

      Any help/advice on this would be appreciated..

      General Discussion
    • Seeking experts for implementing Modbus TCP

      Crille

      I just upgraded the firmware for the inverter for my solar panels and that made it possible to enable Modbus TCP.
      At a glance that would be perfect for live production data fed into my home automation environment but my lack of knowledge about the protocol and how to put the data where I want it failed me.

      What I have:

      MSR
      openLuup
      Vera Secure
      Ezlo Plus
      Mosquitto
      Homebridge
      Windows Server
      Ubuntu Server
      Quite decent PowerShell skills
      Enough Lua knowledge to write my own functions and handlers
      The inverters Modbus interface definitions

      What I want to achive:

      Something that can be run by systemd och anything else monitoring the status and keeping the Modbus connection alive.
      Publish readings over MQTT or whatever fits my setup, the goal is to feed the data into openLuup in someway so Historian can log the data for Grafana and display current production to HomeKit (as a mqttthing light sensor, since there is no other accessory suitable at the moment).

      Anyone implemented Modbus TCP in similar projects or have any guidance on how to reach my goal?

      Open for alternative solutions as well, all suggestions are appreciated!

      General Discussion
    • http relay activate with username and password authentication

      D

      Hi to all,
      I am user of vera controller. I have a dahua door intercom with relay. Relay activates with username and password authentication. I can activate the relay http://admin:a1234567@192.168.1.111/cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=101&Type=Remote

      As you can see intercom username admin and password is a1234567 I build a scene with luup code luup.inet.wget( "http://admin:a1234567@192.168.1.111/cgi-bin/accessControl.cgi?action=openDoor&channel=1&UserID=101&Type=Remote" ) But can not activate relay. Is there any idea?

      General Discussion
    • Vera Secure usage without mios

      D

      Hi to all, I have a bricked vera secure that is replaced with new one. Old vera secure serial numbers are deleted from vera servers so I cannot use it. Vera secure's are orginally Sercomm's NA502 model devices. Recently I install openwrt to the old vera secure unit without problem. Is there any way to use it any automation system with internal z-wave. I install domoticz but I cannot setup internal z-wave unit, it only accept usb zwave radios. Is there any ideas?

      General Discussion
    • An electricians or wiring experts here?

      cw-kid

      I ordered a Fibaro Dimmer 2 and Bypass device for my upstairs landing / hallway lights.

      I have 2 light switches one at the bottom of the stairs and another one upstairs on the landing.

      But I am struggling to make sense of my current wiring, more details / photos on the Vera forum.

      Jan 27 Anyone good at electrical wiring for light switches? Anyone good at electrical wiring for light switches?

      Hi I ordered a Fibaro Dimmer 2 and Bypass device for my upstairs landing / hallway lights. I have 2 light switches one at the bottom of the stairs and another one upstairs on the landing. I have no neutral wires in the house behind the light switches. These are photos of the light switch...

      Thanks

      General Discussion
    • Looking for ideas on how to implement an automation.

      R

      Hello,
      Looking to all the dev's and tinkerers on this community for ideas on how to implement a solution to my problem. Kind of a long intro, sorry.

      Problem statement:
      I have a geothermal heat pump that has a loop that is slightly undersized. During the cold weather months in the Pacific Northwest (one or two months of the year), the loop can get below 32 degrees. If it goes on for a few days, it can generate significant frost heaving in my yard and under the flagstone deck, Actually fixing the issue is cost prohibitive.

      Current mitigation:
      I have DS18B20 tied into Home Assistant and monitoring the temp of the fluid coming out of the loop and if it drops below 35 degrees, MSR triggers a Fibaro Implant to add a resister into the external temp circuit and fool the Venstar to think the outside temp is below 32 degrees and issue a Heat Pump lockout and switch to AUX heat. While this is working fine and the AUX heat is only coming on once or twice a day, I would like to simplify the setup so it runs on something other than HA and MSR. I think they are overkill for my issue. Also want this to be independent of anything else in the house so it can stay behind if I am not around to maintain.

      I only have two inputs and one output:
      Inputs: Loop temp, Furnace running
      Outputs: Switch relay to drop resistance to external thermostat connection on thermostat.
      Logic is super simple:
      If temp is below 36 degrees and furnace is running, turn on relay
      If furnace stops, turn off relay.
      I am sure even I can figure that out on Python.

      Trying to determine the best platform for a set it and forget it black box that works with as close to zero maintenance as possible.

      Options I have thought of are:

      Pi zero with a GPIO controlled relay ESPHome (Not very knowledgeable about that platform, but willing to explore) Arduino Anything anyone else suggests

      Any ideas are appreciated.

      General Discussion
    • Is Hubitat to HA Bridge possible?

      D

      Greetings,

      I’m researching a migration from Vera+ to Hubitat C7 and want to know if anyone has successfully connected the Hubitat to the “HA Bridge” for local Alexia calls.
      The HA Bridge does not callout Hubitat natively from what I see.

      Thanks for your assistance.

      General Discussion
    • New Developer - What I should know/do ? (Vera/OpenLuup)

      parkerc

      Hi all

      Having some time off i’ve been able to invest a chunk in creating some plug-ins for Vera/OpenLuup, and will do what I can to post them in GitHub and add links on the Vera Community and here, for anyone who is interested.

      But, being knew to any of this, I wanted to ask for any guidance on how and when I should share stuff ? How best do I share it ? Am I liable for anything I share? Is GitHub the best place ? What licenses should I associate with them ?

      The latter is a strange one, as I don’t see how I can have any claim over the content/code itself, as I’ve learnt and leveraged so much from others..

      To get the ball rolling I posted this on the ezlo/Vera site..

      Jan 4 Luup Plugin - Energenie PMS LAN Switch Luup Plugin - Energenie PMS LAN Switch

      Hi To ensure I give back to this community, which has been educating me in all things Lua and Luup over the years (12+) I wanted to share some of the plugins I’ve built recently to see if any are of use/interest to others. The first one is for the Energenie PMS LAN Switch where I have built two...

      General Discussion
    • New to Smart Home

      M

      Hey guys,

      I just registered here in the forum and honestly… I’m new to the whole topic. I‘m a web developer, so I‘ve quite a bit experience with java, js, sql and so on. But that may not help a lot in this new field.

      I‘m looking forward to develop my own smart home device and I‘m looking for starting point. In General the specs are like:

      The device should work with WiFi, I want to integrate it into my network I want to write an own app to control it, it may find the device in my network I want the device to be offline usable, if possible (without internet connection) I want the device to broadcast information in my network like „water is empty“, so I can use push messaging in the App it should be ready to as well work with Alexa or Apple Home Kit or Google Assistant as I Plan to develop a skill for them.

      Can someone provide me with some information I could start with? Like - are there microcontrollers I could go with or is it to complex and I need a raspy? Which frameworks / languages / libs could I use? I know how to do the things on the app side but not on the device side.

      General Discussion
    • Amazon Alexa hosts

      CatmanV2

      Vainly trying to get to the bottom of the 10 - 15 second delay for TTS with the Alexa plugin (still) anyone have a list of the possible Alexa hosts? Just wonder if the one I have (layla.amazon.co.uk) could just be slow.

      Any thoughts?

      C

      General Discussion
    • Merry Christmas/Happy Holidays

      toggledbits

      Just wanted to wish everyone a very Merry Christmas (or Happy Holidays, if that's your preferred salutation, or...?), and also a very happy, healthy and prosperous New Year 2022.

      General Discussion
    • Very newbie man looking for help

      P

      Hello. First, excuse my english, please. I bought a Vera Edge looking for some way to make a digital ambient thermostat that I could manage remotely without a phone home from the device side. I am very disappointed with that device because all the "official" help of the brand goes in the way of to sign in an account and work with their cloud. I have some computer, network and linux knowledge but all my tests with the hub and a Qubino Flush 1D Relay has been unsuccessful. I connected both and I got to make some basic functions but I see myself very far to get my target. This is my last try to get something before I log in an account in getvera.com and look if I can make some progress in my project following that way.

      Can somebody tell me some place where I can learn the basic concepts of this system? Guides, books, videos... Whatever it can help me in my project.

      Thank you.

      General Discussion
    • Help please with Node-Red "Lost connection to server"

      cw-kid

      Node-Red on my Linux Debian box seems to be having issues now. It keeps saying repeatedly "Lost connection to server, reconnecting..." in the web browser.

      I recently updated nodejs for MSR, I wonder if that might be related:

      "Bump recommended nodejs version to 16.13.0; versions 14 and 15 will continue to be supported through March 31, 2022"

      Nodejs version = v16.13.1

      I have tried updating Node-Red that is now version v2.1.4

      I also updated npm to version v8.2.0

      I am not sure how or where to look at the log file for node red?

      This is the contents of the nodered.service file in this directory:
      /etc/systemd/system/multi-user.target.wants

      # systemd service file to start Node-RED [Unit] Description=Node-RED graphical event wiring tool Wants=network.target Documentation=http://nodered.org/docs/hardware/raspberrypi.html [Service] Type=simple # Run as normal pi user - change to the user name you wish to run Node-RED as User=stuart Group=stuart WorkingDirectory=/home/stuart Environment="NODE_OPTIONS=--max_old_space_size=1024" # uncomment and edit next line if you need an http proxy #Environment="HTTP_PROXY=my.httpproxy.server.address" # uncomment the next line for a more verbose log output #Environment="NODE_RED_OPTIONS=-v" # uncomment next line if you need to wait for time sync before starting #ExecStartPre=/bin/bash -c '/bin/journalctl -b -u systemd-timesyncd | /bin/grep -q "systemd-timesyncd.* Synchronized to time server"' ExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS #ExecStart=/usr/bin/env node $NODE_OPTIONS red.js $NODE_RED_OPTIONS # Use SIGINT to stop KillSignal=SIGINT # Auto restart on crash Restart=on-failure RestartSec=20 # Tag things in the log SyslogIdentifier=Node-RED #StandardOutput=syslog [Install] WantedBy=multi-user.target

      Thanks

      General Discussion
    • Goodbye Brothers in crime!

      S

      Hi @ll, last days I migrated my last zwave device from Vera to zwave js in homeassistant. Out of 150 devices 1 did not go well initially but reinterviewing did it directly. Most work was to find the ex and inclusion procedure, 3 times, click, clack, whatever. I must admit that Vera is Lighting fast!!!!! With only 3 devices left, those were my under the floor switches I had to do last.

      Now I am totally gone from Vera, altui, luup, etc. There's nothing more left for me on this forum. And since it was one of my "routine sites" reading I will save a few minutes a day skipping it.

      I thank you all for all the kind help, warm words and laughter about the ezlo flop :-).

      I hooe you all will be safe and healthy and whish you all the best!

      I will stay on the homeassistant forum.

      Goodbye!

      General Discussion
    • Re-number on OpenLuup

      CatmanV2

      Morning all. Hope all are well. Been a bit of a trying time here, but nothing we can't deal with....
      .....apart from this!

      My coffee grinder went punk yesterday (wasn't even being used) and took out the main breakers. Once it was isolated I got everything back on line, except on TKB smart plug which was in the same double socket as the grinder.

      OpenLuup claims it's failed. Z-wave server can't see it but it responds to the button pushes physically as I'd expect. (i.e. the socket turns on and off, and the LED flashes to indicate it's in inclusion / exclusion mode)

      My plan is to see if I can exclude it then re-include it in z-wave server. If that doesn't work then I'll bin it, but if it does work can I then re-number it to match the original device ID and not have to trawl through my reactors? Any chance?
      TIA

      C

      General Discussion
    • 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
    For those who registered but didn't received the confirmation email, please send an email to support@smarthome.community with the email you used

    Discover IR codes for lost remote

    General Discussion
    5
    49
    1080
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • parkerc
      parkerc last edited by

      Hi all

      Possibly a long shot - but does anyone know of a way, (maybe you have some code or know of an app) that can help you discover the IR codes of a device when you’ve lost the remote?

      Looking online there seems to be a growing number of IR banks, yet I can’t find anything on the market that could cycle through a huge set of different codes (e.g just the power on/off) to let me know which ones are compatible ?

      When you consider so many things these days are made in the same place, and often thing can just be re/badges versions of other items - it’s likely that a sets of codes for one branded product will work in the most part with another ..

      1 Reply Last reply Reply Quote 0
      • A
        a-lurker last edited by

        Lost remote? It's probably down the back of the couch.

        While not exactly what you want but have looked at Remote Central or possibly buy a new one on ebay?

        parkerc 1 Reply Last reply Reply Quote 0
        • parkerc
          parkerc @a-lurker last edited by

          @a-lurker said in Discover IR codes for lost remote:

          Lost remote? It's probably down the back of the couch.

          Sadly not, I picked these items up 2nd hand, so they didn’t come with the original remotes.

          @a-lurker said in Discover IR codes for lost remote:

          While not exactly what you want but have looked at Remote Central or possibly buy a new one on ebay

          Yep, tried that already, along with http://irdb.tk/codes/ too - but neither of the manufacturers/ models I’m looking for are listed..

          Hence I was thinking there must be a high chance something in those code banks will work, at the very least to power on/off..

          Any ideas ?

          1 Reply Last reply Reply Quote 0
          • therealdb
            therealdb last edited by

            I'm not aware of anything like you requested. There are things that could learn codes, but they require a handheld. Have you tried calling the manufacturer? Maybe they will give you instructions about this issue.

            --
            Vera+MQTT+HomeAssistant+my own framework all orchestrated via MSR
            70+ Zwave Devices, a bunch of ZigBee light strips and a lot of code

            My Luup Plug-ins => https://github.com/dbochicchio/vera

            parkerc 1 Reply Last reply Reply Quote 0
            • parkerc
              parkerc @therealdb last edited by parkerc

              @therealdb said in Discover IR codes for lost remote:

              Have you tried calling the manufacturer?

              Yep, tried that I think I’ve tried everything, even have a saved search on eBay. Also as one of them had a RS232 connection, I explored that too, (via the Vera forum) but had to give up in the end as it wouldn’t work .

              So far one manufacturer has stated that the unit in question was discontinued and the other has yet to respond after multiple attempts. 😞 Rather that wait any long, seeing as I have a number of IR sender options, KIra, Harmony and BroadLink it made made me wonder if there was a way to retrieve codes, create a list and cycle through them.

              I mainly use @a-lurker Broadlink, and looking at the IR ‘ProntoCode’ command option, it feels possible (with help?)

              luup.call_action('urn:a-lurker-com:serviceId:IrTransmitter1', 'SendProntoCode', {ProntoCode = '0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 05F7 015B 0057 0016 0E6C'},49)
              

              it’s just the code bank connection to reduce the manual effort, and some way of recording/reporting which code was sent and if it worked or not. (Ideally all automated)

              1 Reply Last reply Reply Quote 0
              • parkerc
                parkerc last edited by parkerc

                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

                1 Reply Last reply Reply Quote 1
                • parkerc
                  parkerc last edited by parkerc

                  I’ve just got an update from the guy behind the irdb - https://github.com/probonopd/irdb/issues/37

                  He mentioned..

                  Assuming you have the irdb tree locally on $IRDB_BASE, this pseudo code should do it

                  for file in $IRDB_BASE/codes/*/*.csv:
                      for line in $file:
                          (cmd_name,protocol,D,S,F) = split $line ','
                           if match('power', $cmd_name):
                                 echo "Trying signal $protocol $D $S $F" 
                                 pronto = $(irptransmogrifier render -n D=$D,S=$D,F=$F $protocol)
                                 sendIr $pronto
                                 sleep $a_while
                         endif
                     endfor
                  endfor
                  

                  Please could someone help me to translate this into Lua and then to work with the Broadlink plug-in ?

                  akbooer 1 Reply Last reply Reply Quote 0
                  • parkerc
                    parkerc last edited by parkerc

                    I’d also appreciate any help/advice on how to maybe adjust @rigpapa’s GitHub Lua/plug-in to potentially pull into the irdb database (or would that simply be too much for Vera to take?)

                    toggledbits/GitUpdater

                    toggledbits/GitUpdater

                    A service utility to update Vera plugins from GitHub releases - toggledbits/GitUpdater

                    1 Reply Last reply Reply Quote 0
                    • parkerc
                      parkerc last edited by parkerc

                      @a-lurker - is there scope here for a possible add-on/enhancement to the Broadlink plug-in 🙏😇😁

                      1 Reply Last reply Reply Quote 0
                      • therealdb
                        therealdb last edited by

                        well, it's possible in LUA as well. I'm not that expert in the file system libs, but Google is your friend 🙂

                        How to get list of directories in Lua

                        How to get list of directories in Lua

                        I need a list of directory in LUA Suppose I have a directory path as "C:\Program Files" I need a list of all the folders in that particular path and how to search any particular folder i...

                        Just use io to open files, but I think that so many commands will probably crash your luup engine. We're potentially speaking of thousands of calls to try.

                        --
                        Vera+MQTT+HomeAssistant+my own framework all orchestrated via MSR
                        70+ Zwave Devices, a bunch of ZigBee light strips and a lot of code

                        My Luup Plug-ins => https://github.com/dbochicchio/vera

                        1 Reply Last reply Reply Quote 0
                        • akbooer
                          akbooer @parkerc last edited by

                          @parkerc said in Discover IR codes for lost remote:

                          Please could someone help me to translate this into Lua

                          for file in $IRDB_BASE/codes/*/*.csv:
                              for line in $file:
                                  (cmd_name,protocol,D,S,F) = split $line ','
                                   if match('power', $cmd_name):
                                         echo "Trying signal $protocol $D $S $F" 
                                         pronto = $(irptransmogrifier render -n D=$D,S=$D,F=$F $protocol)
                                         sendIr $pronto
                                         sleep $a_while
                                 endif
                             endfor
                          endfor
                          

                          becomes, in Lua:

                          local lfs = require "lfs"
                          local dir = "codes/"   -- make this your path to the files
                          local split = "[^,]+,[^,]+,[^,]+,[^,]+,[^,]+"  -- (cmd_name,protocol,D,S,F)
                          
                          for file in lfs.dir(dir) do
                              if file: match "%.csv$" then
                                for line in io.lines(dir .. filename)do
                                  local cmd_name,protocol,D,S,F = list: match (split)
                                  if 'power' == cmd_name then
                                    print ("$protocol $D $S $F",  protocol,D,S,F)
                                  end
                                end
                             end
                          end
                          

                          I've just replaced the IR send with a print statement for now.

                          1 Reply Last reply Reply Quote 1
                          • parkerc
                            parkerc last edited by parkerc

                            Thanks @akbooer

                            Some quick questions .

                            1. Where would be the best place to store/sync the .csv files ?
                            2. FYI to help test, here is an example/extract of the Samsung TV .csv
                            [functionname,protocol,device,subdevice,function
                            INPUT SOURCE,NECx2,7,7,1
                            POWER,NECx2,7,7,2
                            1,NECx2,7,7,4
                            2,NECx2,7,7,5
                            3,NECx2,7,7,6
                            VOLUME +,NECx2,7,7,7
                            4,NECx2,7,7,8
                            5,NECx2,7,7,9
                            6,NECx2,7,7,10
                            VOLUME -,NECx2,7,7,11
                            7,NECx2,7,7,12
                            8,NECx2,7,7,13
                            9,NECx2,7,7,14
                            MUTE,NECx2,7,7,15
                            CHANNEL -,NECx2,7,7,16
                            0,NECx2,7,7,17
                            CHANNEL +,NECx2,7,7,18
                            

                            By the looks of it to get the pronto version of the code, you would have to used the IrpTransmogrifier tool - https://github.com/bengtmartensson/IrpTransmogrifier

                            Where would be the best place to install that - is Vera a safe place or should I look elsewhere e.g a Pi ?

                            1 Reply Last reply Reply Quote 0
                            • akbooer
                              akbooer last edited by akbooer

                              What were you thinking of using to send the codes?

                              I note that luup has an ir table with a single function in it. Also, thanks to @a-lurker it's implemented in openLuup. IT mentions GC100 in the comments:

                              -- IR module
                              -- thanks to @a-lurker for this.
                              -- see: http://forum.micasaverde.com/index.php/topic,37268.0.html
                              
                              local ir = {
                                pronto_to_gc100 = function (pronto)
                                  -- replace the pronto code preamble with the GC100 preamble
                              
                              

                              ...but I have absolutely no idea about its functionality, not ever having used an IR devices at this level. I would have thought that these codes ARE the pronto codes?? (...or are they IRP notation protocols?)

                              parkerc 1 Reply Last reply Reply Quote 0
                              • parkerc
                                parkerc @akbooer last edited by parkerc

                                @akbooer said in Discover IR codes for lost remote:

                                What were you thinking of using to send the codes?

                                I was ideally looking to use my Broadlink RM-Pro device and @a-lurker ‘s Vera plugin

                                @akbooer said in Discover IR codes for lost remote:

                                I have absolutely no idea about its functionality, not ever having used an IR devices at this level. I would have thought that these codes ARE the pronto codes?? (...or are they IRP notation protocols?)

                                I’m getting a bit out of my depth here now too,..

                                which is so often the case when I embark on these kind of HA adventures 🙂 .

                                My interpretation is that when using irdb, you have to convert the code for them them to be Pronto codes. - http://irdb.tk/convert/

                                If I use my Samsung TV as an example, that seems to use the necx2:7.7 protocol - which I’ve also seen written as NECx2, device 7.7. Either way that seems to be a very common TV code set for Samsung, Akai and some other brands.

                                So, looking at their api, I assumed I could at least try to call a specific code.

                                http://irdb.tk/api/code/?brand=Samsung&devicetype=TV

                                And then..

                                http://irdb.tk/api/code/?brand=Samsung&devicetype=TV&protocol=NECx2&device=7&subdevice=7&functionname=POWER

                                but alas no ir code was returned only this json, which perhaps is not surprise... 😞

                                {
                                  "meta": {
                                    "model": "code", 
                                    "next": "", 
                                    "page": 1, 
                                    "previous": ""
                                  }, 
                                  "objects": [
                                    {
                                      "function": "2", 
                                      "protocol": "NECx2", 
                                      "subdevice": "7", 
                                      "devicetype": "TV", 
                                      "device": "7", 
                                      "functionname": "POWER"
                                    }
                                  ]
                                }
                                

                                Any ideas on their api - http://irdb.tk/api ?

                                1 Reply Last reply Reply Quote 0
                                • A
                                  a-lurker last edited by

                                  parkec

                                  You haven't told us what hardware or software (MiOS/openLuup) you are using. If you read AK's code above you would just have to point to where the files are. Presumably the file(s) could be on a USB stick. You want to get AK's coe running first, on just one file first - one step at a time.

                                  Later you need this bit:

                                  bengtmartensson commented 16 hours ago •

                                  Just install IrpTransmogrifier as shell command and call it (as shell program) using (I think) os.execute or io.popen in Lua. No need to call java from lua
                                  pronto = $(irptransmogrifier render -n D=$D,S=$D,F=$F $protocol)

                                  The database looks like it could be huge and would take a while (who knows - a day?) to cycle around all the IR codes. Are you going to sit there and watch your device all day to catch when it turns on? AK's code needs to get the pronto code and then send it. Something like this (but totally untested):

                                  -- Send an IR code every two seconds
                                  -- Function needs to be global as it's a delay timeout target
                                  function sendProntoCodeToBroadLinkDevice(prontoCode)
                                     local BROADLINK_DEVICE_ID = 49
                                     luup.call_action('urn:a-lurker-com:serviceId:IrTransmitter1', 'SendProntoCode', {ProntoCode = prontoCode}, BROADLINK_DEVICE_ID)
                                  end
                                  
                                  function scanIndexFiles ()
                                      local lfs = require "lfs"
                                      local dir = "codes/"   -- make this your path to the files
                                      local split = "[^,]+,[^,]+,[^,]+,[^,]+,[^,]+"  -- (cmd_name,protocol,D,S,F)
                                      
                                      local prontoCode = ''
                                  
                                      for file in lfs.dir(dir) do
                                          if file: match "%.csv$" then
                                            for line in io.lines(dir .. filename) do
                                              local cmd_name,protocol,D,S,F = list: match (split)
                                              if 'power' == cmd_name then
                                                print ("$protocol $D $S $F",  protocol,D,S,F)
                                  
                                                local irptransmogrifierPath = "insert path here"
                                  
                                                -- this may all need work depending on whatever "irptransmogrifier" does
                                                local command = string.format("%sirptransmogrifier render -n D=%s,S=%s,F=%s protocol",irptransmogrifierPath,D,S,F,protocol)
                                                local handle = assert(io.popen(command))
                                                local prontoCode = handle:read("*a")
                                                handle:close()
                                  
                                                local INTERVAL_SECS = 2
                                                luup.call_delay('sendProntoCodeToBroadLinkDevice', INTERVAL_SECS, prontoCode)
                                  
                                              end
                                            end
                                         end
                                      end
                                  end
                                  
                                  scanIndexFiles()
                                  
                                  

                                  Note: luup.call_delay only works in the openLuup window test window - I'm still not clear why. But the Vera and AltUI test windows won't run it correctly. You need the delay so the BroadLink device has time to send the code. (the function sleep() is not suitable)

                                  parkerc 1 Reply Last reply Reply Quote 0
                                  • parkerc
                                    parkerc @a-lurker last edited by

                                    @a-lurker said in Discover IR codes for lost remote:

                                    You haven't told us what hardware or software (MiOS/openLuup) you are using.

                                    Sorry,, I’m looking first to Vera/MIOS , with the Broadlink RM Pro4, and your plug-in.

                                    @a-lurker said in Discover IR codes for lost remote:

                                    The database looks like it could be huge and would take a while (who knows - a day?) to cycle around all the IR codes. Are you going to sit there and watch your device all day to catch when it turns on? AK's code needs to get the pronto code and then send it. Something like this (but totally untested):

                                    To avoid sitting around as the devices in question register for an IP, which I can fix, I was thinking I can watch for that variable to be updated .e.g via ping test or another option could be to place a light sensor right in front of the power LED to react when the light comes on..

                                    @a-lurker said in Discover IR codes for lost remote:

                                    You want to get AK's coe running first, on just one file first - one step at a time.

                                    Agreed, and here’s an example .csv of the Samsung TV code/set they store. /codes/

                                    
                                    functionname,protocol,device,subdevice,function
                                    INPUT SOURCE,NECx2,7,7,1
                                    POWER,NECx2,7,7,2
                                    1,NECx2,7,7,4
                                    2,NECx2,7,7,5
                                    3,NECx2,7,7,6
                                    VOLUME +,NECx2,7,7,7
                                    4,NECx2,7,7,8
                                    5,NECx2,7,7,9
                                    6,NECx2,7,7,10
                                    VOLUME -,NECx2,7,7,11
                                    7,NECx2,7,7,12
                                    8,NECx2,7,7,13
                                    9,NECx2,7,7,14
                                    MUTE,NECx2,7,7,15
                                    CHANNEL -,NECx2,7,7,16
                                    0,NECx2,7,7,17
                                    CHANNEL +,NECx2,7,7,18
                                    LAST,NECx2,7,7,19
                                    MENU,NECx2,7,7,26
                                    INFO,NECx2,7,7,31
                                    AD/SUBT,NECx2,7,7,37
                                    EXIT,NECx2,7,7,45
                                    E-MANUAL,NECx2,7,7,63
                                    TOOLS,NECx2,7,7,75
                                    GUIDE,NECx2,7,7,79
                                    RETURN,NECx2,7,7,88
                                    CUSOR UP,NECx2,7,7,96
                                    CURSOR DOWN,NECx2,7,7,97
                                    CURSOR RIGHT,NECx2,7,7,98
                                    CURSOR LEFT,NECx2,7,7,101
                                    ENTER,NECx2,7,7,104
                                    CH LIST,NECx2,7,7,107
                                    SMART HUB,NECx2,7,7,121
                                    3D,NECx2,7,7,159
                                    
                                    

                                    And overall size wise, I assume - as they are not storing every individual code and Ir format/type, instead it’s just the protocol and some other identifier - the whole irdb/code folder seems reasonably small.

                                    2B82889B-7547-4680-A42A-3029A4D70F7B.jpeg

                                    1 Reply Last reply Reply Quote 0
                                    • therealdb
                                      therealdb last edited by

                                      Are you sure you can’t open those devices and look at the electronics? It seems to be simpler than this, to me 😉

                                      Maybe, also, some repair shop could help you. They usually deal with these kind of things and maybe they have something smarter to identify them. May be worth a try.

                                      --
                                      Vera+MQTT+HomeAssistant+my own framework all orchestrated via MSR
                                      70+ Zwave Devices, a bunch of ZigBee light strips and a lot of code

                                      My Luup Plug-ins => https://github.com/dbochicchio/vera

                                      parkerc 1 Reply Last reply Reply Quote 0
                                      • parkerc
                                        parkerc @therealdb last edited by

                                        @therealdb said in Discover IR codes for lost remote:

                                        Are you sure you can’t open those devices and look at the electronics? It seems to be simpler than this, to me

                                        These items are racked up so it;s not quite as easy as I’d like that option to be - but I am weighing up the hassle of doing that vs doing this 🙂

                                        The benefit of making this code/process work is that a) i will have learnt something new - b) This could then be something g that helps others and c) it would give the Broadlink plug-in access to a huge ir bank of codes for people to use. 🙏🤞

                                        1 Reply Last reply Reply Quote 0
                                        • parkerc
                                          parkerc last edited by parkerc

                                          Hi,

                                          I’ve been working with the code that was shared (thanks so much), and have trimming it down a bit to work it through in sections, but - here’s my current issue - any ideas ?

                                          (I) if I put the .csv file in the main search folder it does not return any errors, but it also does not print anything out.

                                          /mnt/nas/vera/ircodes/7,7.csv

                                          
                                          LuaTest 1.7
                                          
                                          Lua file: /etc/cmh-ludl/luatest.lua
                                          
                                          Results
                                          No errors
                                          Runtime: 51.4 ms
                                          Code returned: nil
                                          
                                          Print output
                                          (none)
                                          
                                          Code
                                             1    
                                             2       local lfs = require "lfs" 
                                             3       local dir = "mnt/nas/vera/ircodes/"   -- make this your path to the files 
                                             4       local split = "[^,]+,[^,]+,[^,]+,[^,]+,[^,]+"  -- (cmd_name,protocol,D,S,F) 
                                             5        
                                             6       local prontoCode = '' 
                                             7    
                                             8       for file in lfs.dir(dir) do 
                                             9           if file: match "%.csv$" then 
                                            10             for line in io.lines(dir .. filename) do 
                                            11               local cmd_name,protocol,D,S,F = list: match (split) 
                                            12               if 'power' == cmd_name then 
                                            13                 print ("$protocol $D $S $F",  protocol,D,S,F) 
                                            14               end 
                                            15             end 
                                            16          end 
                                            17      end
                                          
                                          
                                          • When I run it again, I get this, should filename be local or specified ?
                                          
                                          LuaTest 1.7
                                          
                                          Lua file: /etc/cmh-ludl/luatest.lua
                                          
                                          Results
                                          Runtime error: Line 9: attempt to concatenate global 'filename' (a nil value)
                                          
                                          Locals
                                          [main]
                                          lfs={ _VERSION="LuaFileSystem 1.6.2", symlinkattributes=function, lock_dir=function, dir=function, _DESCRIPTION="LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution", setmode=function, unlock=function, _COPYRIGHT="Copyright (C) 2003-2012 Kepler Project", currentdir=function, touch=function, mkdir=function, lock=function, link=function, attributes=function, chdir=function, rmdir=function }
                                          dir="mnt/nas/vera/ircodes/"
                                          split="[^,]+,[^,]+,[^,]+,[^,]+,[^,]+"
                                          prontoCode=""
                                          
                                          Print output
                                          (none)
                                          
                                          Code
                                             1       local lfs = require "lfs" 
                                             2       local dir = "mnt/nas/vera/ircodes/"   -- make this your path to the files 
                                             3       local split = "[^,]+,[^,]+,[^,]+,[^,]+,[^,]+"  -- (cmd_name,protocol,D,S,F) 
                                             4        
                                             5       local prontoCode = '' 
                                             6    
                                             7       for file in lfs.dir(dir) do 
                                             8           if file: match "%.csv$" then 
                                             9             for line in io.lines(dir .. filename) do 
                                            10               local cmd_name,protocol,D,S,F = list: match (split) 
                                            11               if 'POWER' == cmd_name then 
                                            12                 print ("$protocol $D $S $F",  protocol,D,S,F) 
                                            13               end 
                                            14             end 
                                            15          end 
                                            16      end
                                          
                                          

                                          II) I know we are doing this in sections, but as there are many layers of manufacturer folders and device type sub folders, will the eventual end code systematically search for all *.csv files within all the levels below? E.g.

                                          /mnt/nas/vera/ircodes/Samsung/TV/7,7.csv
                                          /mnt/nas/vera/ircodes/Panasonic/TV/128,0.csv
                                          /mnt/nas/vera/ircodes/Panasonic/TV/128,1.csv
                                          /mnt/nas/vera/ircodes/Panasonic/TV/128,4.csv
                                          /mnt/nas/vera/ircodes/Panasonic/TV/128,9.csv
                                          /mnt/nas/vera/ircodes/Panasonic/DVD Player/128,0.csv /mnt/nas/vera/ircodes/Panasonic/DVD Player/160,0.csv /mnt/nas/vera/ircodes/Panasonic/DVD Player/160,16.csv
                                          /mnt/nas/vera/ircodes/Panasonic/DVD Player/160,18.csv
                                          /mnt/nas/vera/ircodes/Panasonic/DVD Player/160,28.csv
                                          /mnt/nas/vera/ircodes/Panasonic/DVD Player/160,34.csv
                                          /mnt/nas/vera/ircodes/Panasonic/DVD Player/160,4.csv
                                          /mnt/nas/vera/ircodes/Panasonic/Unknown_EUR7617010/170,3csv

                                          I found this online, is that the sort of thing we will need to factor i later on..

                                          Alex  /  Jan 12, 2012

                                          Lua function to traverse all files in a folder recursively

                                          Lua function to traverse all files in a folder recursively

                                          Here is a little function that uses Lua File System (lfs module) in order to traverse all the files in a folder and its sub folders (and their sub folders) recursively. DIR_SEP=”\” &#82…

                                          If I remove the ‘filename’ variable call, and specify a file, it then does this.

                                          
                                          LuaTest 1.7
                                          
                                          Lua file: /etc/cmh-ludl/luatest.lua
                                          
                                          Results
                                          Runtime error: Line 10: attempt to index global 'list' (a nil value)
                                          
                                          Locals
                                          [main]
                                          lfs={ _VERSION="LuaFileSystem 1.6.2", symlinkattributes=function, lock_dir=function, dir=function, _DESCRIPTION="LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution", setmode=function, unlock=function, _COPYRIGHT="Copyright (C) 2003-2012 Kepler Project", currentdir=function, touch=function, mkdir=function, lock=function, link=function, attributes=function, chdir=function, rmdir=function }
                                          dir="mnt/nas/vera/ircodes/"
                                          split="[^,]+,[^,]+,[^,]+,[^,]+,[^,]+"
                                          prontoCode=""
                                          
                                          Print output
                                          (none)
                                          
                                          Code
                                             1   local lfs = require "lfs" 
                                             2       local dir = "mnt/nas/vera/ircodes/"   -- make this your path to the files 
                                             3       local split = "[^,]+,[^,]+,[^,]+,[^,]+,[^,]+"  -- (cmd_name,protocol,D,S,F) 
                                             4        
                                             5       local prontoCode = '' 
                                             6    
                                             7       for file in lfs.dir(dir) do 
                                             8           if file: match "%.csv$" then 
                                             9             for line in io.lines(dir .. '7,7.csv') do 
                                            10               local cmd_name,protocol,D,S,F = list: match (split) 
                                            11               if 'POWER' == cmd_name then 
                                            12                 print ("$protocol $D $S $F",  protocol,D,S,F) 
                                            13               end 
                                            14             end 
                                            15          end 
                                            16      end
                                          
                                          
                                          1 Reply Last reply Reply Quote 0
                                          • A
                                            a-lurker last edited by a-lurker

                                            "list" should be "line"

                                            And /mnt/nas/vera/ircodes/Panasonic/Unknown_EUR7617010/170,3csv files are expected to end in ".csv"

                                            And "file" should probably be changed to "filename"

                                            Refer: https://keplerproject.github.io/luafilesystem/manual.html

                                            Also I see you changed "power" to "POWER", which is correct but it's safer to do this: 'POWER' == cmd_name:upper() to guarantee you get uppercase. You are also using commas in your filenames. While this is allowed in Linux, I'm not so sure it should be encouraged. If that's how they come, so be it.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Welcome. If you’d like to participate in the discussion, rather than just read, then you can join the forum. As a member, you can interact with others here to share your experience and ask the questions you need answered.

                                            Powered by NodeBB | Contributors
                                            Hosted freely by PointPub Media Communications Inc. | Contact us