Hi All
Hopefully this place looks like a helpful forum as I’m quite new to all this!
I’ve had a few devices all working separately /through their proprietary apps but we’re just finishing off a large house extension and this has added to the list.
I’d ideally like to be able to view/switch a number of different devices on one screen/head end but have no idea where to start.
The devices we have/will have shortly are as follows;
Zigbee Smart Sockets
Zigbee smart switches (for lights)
Heatmiser Neo Underfloor Heating (this runs from a Samsung ASHP but that part is automatic)
Samsung VRF air conditioning (currently using Smart Things App)
Hive (2xLTHW heating circuits in the existing house and Hot Water)
Ring (doorbell!)
Hik Vision PoE CCTV
We have lots of appliances (Neff N70) which we can control remotely but not too fussed about controlling those at the
Moment)
Any help/recommendations would be appreciated!
Thanks
Adrian
I have a legacy home automation set-up running on Windows XP. the computer and software have now died.
I have written a very nice Excel VBA program to replace the software and it can run on any modern Windows system.
My only remaining problem is to output the correct signal to a USB port to trigger the wireless switches.
Has anybody done a similar exercise. Please help.
Hi All,
Kind of new to Home Automation. Started off Using Amazon Echo units and added a Samsung SmartThings hub. I have mostly been using plug in modules for turning lights on and off. I live in a very rural area where the internet goes out a lot. I eventually want to change to to a non internet Hub so things will work without needing an internet connection. But I will post with those questions at a later date.
So, the task at hand is this: I have flood lights at each corner of my house. They are currently controlled by switches at the front and back doors. I would like to add Security Cameras to each corner also. I can easily find small Wifi switches to put into the electrical box where the flood lights are located, then I can terminate the leads together behind the Decora switch to have constant power. Then I can use the constant power up at the lights electrical box to power the security cameras. I would also like to have a wireless switch to take the place of the Decora switch to be able to turn the lights off and on.
I cannot seem to find a product like this. It seems I can find the small wired in switch boxes that will also come with external smart wall switches, but the wall switches are an external box that does not fit in or cover the existing Wall switch electrical box. I can also find Wireless Decora switches that come with a remote wired in small switch box , but they all seem to be RF and do not integrate with a Smart Hub.
I am hoping someone here knows of a product that matches what I am looking for. Any help would be appreciated.
Also any recommendations for Wireless Security cameras are welcome.
Thanks for any help.
Dear Forum,
I am just starting a smart home system. I've wanted to do this for 10 years at most and really would like to get a start. What I have are a couple of SONOFF wifi relays, some 433 (Hz/mHz) switches ( not wifi ) a couple of wifi lightbulbs, and I'd like to expand wifi thermostat, leak/water detectors, garage door openers and what ever else I can think of.
In the SONOFF items I have it's a particular app, the wifi bulbs are another app, and if I do a thermostat there might be another app. My wife is not a Luddite but she damn sure doesn't want to have to trouble shoot if/why a particular app breaks down.
So in what I do understand about smart home things is that I need/want a HUB. I spent 15 years doing some programming so I do have some computer ability, though I'd prefer to stay away from HAVING to line command operate the hub.
I would like a list of HUB's that people have found to be the best. Even better are links to let's say Amazon for that hub.
Regards from Noob Smart Home,
Barry
Hello lovely people. Long time and all that. Hope you're all doing OK.
Bit of a left field one here, looking for extra eyes more than an answer and you're the most logical bunch I know 🙂
Part of our HA system is a Logitech Elite hub and remote control.
This is programmed to control my Cyrus Stereo, our TV, and HDMI switch and our Virgin V6 box.
I've been away for a couple of days. Got back this evening to (eventually) work out that the V6 box appears to be not accepting any commands from the Logitech.
Everything has been rebooted.
Logitech uses IR to control
Cyrus: Fine
TV: Fine
HDMI: Fine
Remote control uses Bluetooth to control Hub.
All commands from the Remote to the hub are executed (one might assume correctly) as the activity LED responds, and if you're controlling (say) the Cyrus, all works fine.
iOS App can be used to control Hub over the WLAN:
All commands from the App re executed (one might assume correctly) as the activity LED responds, and if you're controlling (say) the Cyrus, all works fine.
Native remote (that uses as far as I know bluetooth) to control the V6 box works fine.
V6 box refuses to acknowledge any command other than from the native remote. Remote or app provoke absolutely zero response from the V6 box.
This is annoying, but damned if I can think of any logical reason. One might assume a firmware update on the V6 box, but given that the Hub simply emulates the native remote, that seems unlikely.
I'm struggling to think of where even to start troubleshooting this, so any random thoughts would be appreciated.
My initial approach is to buy another hub in case there's a different radio set that's failed in the hub...
TIA!
C
I currently have an HVAC system in the attic - for heating and A/C. 120v is supplied to the unit to run the gas heating. A/C uses 240v. I have an ecobee thermostat...which sometimes goes offline....not often. When it goes offline, I need to turn the 120v power to the HVAC system off and then back on (the ecobee gets its power from the HVAC system). That resets the ecobee and all is fine. I spend the summer away from this house and if the ecobee goes offine..I have no current method to reset the HVAC 120v power remotely. My idea is to replace the current 120v plug in the attic with a smart plug...then I can remotely turn the 120v power off and the ecobee will reset and come back online. I use Wyze and Lutron Casita in the house currently and was hoping I could find an in-wall smart plug from Wyze or Lutron. Obviously, I don't need diming, etc...just the ability to turn the plug power on/off. I've seen some options...but one problem I have is the attic can reach up to 135F in the summer...many of the smart plugs I've seen are not rated for that temperature. Might any of you have any thoughts on a smart plug I might want to look at? I don't want to invest in anything that would require a new hub - so either WiFi based or Casita HUB based. I need 120v and 15amp ratings. Thanks in advance.
I am trying to run a reaction that turns on lights if a sensor has not been tripped for 2 minutes. Basically, when a garage door is open, turn on inside lights if nothing has been sensed for 2 minutes. My question has to do with the expression/variable for "Last Seen". The variable never gets updated over time since the last seen event never changes.
Screenshot 2024-09-02 191632.png
In the screenshot above, the reaction checks for any garage door as well as the variable called "GarageLastEntry". The expression for this variable is displayed below:
Screenshot 2024-09-02 191651.png
The problem that I am experiencing is that the variable never changes over time. I understand that this is because the "last seen" variable does not change over time when there is no activity. In this screenshot, the value shows 0.029... This can also be seen as the current value in the original reaction screenshot above. After 10 minutes, this value should be 10. However, when a garage door is opened, the variable does not get updated and thus the rule does not become true since .029 is less than 2.
When I go to the variable and click on the > icon, the variable then gets updated as expected as seen below:
Screenshot 2024-09-02 191711.png
So the ultimate question is, how do I use a rule that can use a variable such as "last seen"? Do I need to create another variable or reaction that multiplies this by 1 every minute? From what I read in the manual, a variable is evaluated every time it is included in a reaction. But this is not what I am seeing.
I also want to ask another question related to this variable. It seems like Reactor continuously deletes this variable and I have to keep recreating it? I have never experienced this with MSR so wanted to ask if this is a common problem or if my definition is causing this.
Any info is appreciated!!!
BACKGROUND
I have been using 4 x Yale Contactless Connected Door Locks for several years (they use either a rfid tag or code to enter)
I have also been using 1 x Yale L1 Door Lock on the main front door and this connects via Yale Software
Yale contacted me to advise the L1 Lock software was being withdrawn and I needed to install a Yale Access Module into the existing lock and a Wi-Fi Bridge to link it with the newly released software
ALL of the above was working just fine.
RECENT
Yale emailed to advise I should add a Yale Access Module to each of the 4 other locks as this would link with the updated software via the Wi-Fi Bridge.
They offered a deal of just £4 each for these Modules so I got them.
THE PROBLEM
I found that only 2 of these modules would slot easily into the locks - two of them bent the pins and one of those snapped the female part in a lock (I do have a spare lock but thats not the point).
Anyway, I began to set-up the two fitted Modules with the Wi-Fi Bridge and I eventually found (thanks Google, NOT Yale) that I now need 1 x Wi-Fi Bridge PER LOCK (£50 each).
QUESTION
Does anyone know of a compatible Wi-Fi Bridge which works with Yale AND can handle multiple connections (ie 5 all 5 of my locks) ?
THANK YOU
Hello,
I had an iCOMEN boiler switch that worked for many years. And I used iCOMEN app on my phone to manage it. Short time ago app started to have an error message that it cannot connect to the server, and after some time the device also stopped working.
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)?
Hello forum instigators.
Not sure who host/runs the forum software but a couple of challenges:
The chat is not currently usable, as the scrolling is all not right and it's not possible to read chats or send chats reliably.
There are a lot of female members that should perhaps be on another forum; where they can advertise their skills more appropriately. Note: I agree it's a job, like any other.
Whoever you are - thank you for your invaluable work.
I run a B&B and am looking for a way to turn the lights off whenever a room is unoccupied for X amount of time. The guest should still be able to turn the lights on and off manually, but should not be able to disable the auto turn off feature if the room is unoccupied.
I guess I am looking for a light switch with a built in presence sensor? I guess a presence sensor would be better as if it is a motion sensor, the lights may go off unwanted if the guest fails to make sufficient movement e.g. if the guest is lying down watching a film.
Are there any products on the market that would work for my application?
Hello,
I am in search of a device capable of using Bluetooth to connect with a smartphone and serve as its primary sound source on demand. This device should function similarly to conventional Bluetooth headphones, which automatically become the phone's sound output upon activation. However, this device should differ in that it transmits the audio signal to an amplifier via a jack, SPDIF, or similar connection. Alternatively, it could be an integrated amplifier that directly sends the signal to passive speakers.
The control of this process should be manageable through an API such as MQTT, REST, MODBUS, or similar. Are you aware of any devices that operate in this manner?
The concept is as follows: upon entering the bathroom, I would press a wall-mounted switch. This switch would send a signal to the Bluetooth device, prompting it to connect to my smartphone and seamlessly continue playing the audiobook I am currently listening to. Instead of using the phone's speakers, it would seamlessly start playing through ceiling-mounted speakers.
Many thanks 🙂
Hi folks,
I currently have some cheap Zigbee hub and some Amazon Alexas running my smart home which mostly consists of Zigbee power strips and Zigbee battery powered switches.
It all worked OK originally, but now whenever I press a Zigbee switch the light in the corresponding plug switches on then immediately off again.
If I ask Alexa to turn the light on it works fine. Likewise if I switch it on from my phone.
Any ideas what the issue could be?
I've tried unplugging the hub a number of times but that doesn't seem to fix it.
I was thinking about getting a Homey Pro 2023 to speed things up (tmas the Zigbee hub seems to be really slow now as well, for some reason) but I'm not sure about that either.
Any suggestions greatly appreciated!
Looking for a recommendation:
Locksmith is trying to talk me into the Yale Assure Lock Touchscreen with Wi-Fi and Bluetooth - the original 1st generation because they said it's built better than the Assure Lock 2. Any thoughts on this? Which would you recommend?
I see Mul T Lock makes a cylinder (KW-KIDYRL) for Yale Smart Locks. Would this fit the 1st gen Assure Lock, as well as Assure Lock 2? Has anyone tried replacing the cylinder with this on either lock?
Other smart lock I was considering is the Schlage Encode Plus.
Thanks!
Hi. So when I had my house build I ran a bunch of stuff, one of which being two pairs of speaker wires to each bedroom and to 4 spots around my living room… Over the years I have used them here and there with different success.. But today they sit in my walls just unused.
I converted all the cat6 or 5e (I don’t remember) over to basically eithernet jacks. The cable coaxial well it’s there but now unused. But I was thinking there has got to be some use for two pairs of speaker wires to each room. Can I make them usb plugs? Not sure so looking for ideas.
Thanks in advance for your thoughts on this.
Kevin
Hey guys...
We are replacing the heat pump and furnace this week and I will also need to replace my nest thermostat at the same time 'cause Nest is ending the cloud thing end of the month.
Anyway, I'm looking to use the
T6 Pro Z-Wave Programmable Thermostat | Smart Home | Honeywell HomeThat's what the heat pump installer recommend BUT, using Nest I was also using it to control the home humidifier using a single wire connected to nest... but no low voltage thermostat is able to do that, I checked all of them...
So I need some help on how I can do that, to connect the home humidifier using zwave also....
Hi
We are looking for a solution where we can detect presence of a «thing» (people , car , dog, cat, and more..
We need:
fast detections, 1-3 seconds in range from 0 to 20 m from «base» fysical «client» , chip , transmitter , unit. base , receiver placed at a door, gate, house, etc uniq Identifying wirelessThe client:
no need for pressing any thing (no buttons) battery , hoply 2-5 years battery time.Have someone done anything like this?
What technologi will be best?
Discover IR codes for lost remote
-
@parkerc said in Discover IR codes for lost remote:
any idea why this didn’t work ?
...because the syntax is wrong.
I've lost count of the number of times that I may have suggested to you that it might just be worthwhile to learn a little bit more about Lua. The effort that you are putting into this shows that a bit of learning will be a very good investment.
This will split the parameters:
local params = "([^,]+),([^,]+),([^,]+),([^,]+)" local protocol, D,S,F = etc: match(params)
-
@akbooer said in Discover IR codes for lost remote:
I've lost count of the number of times that I may have suggested to you that it might just be worthwhile to learn a little bit more about Lua.
I know, and believe me when I say. I honestly try to lean aspects of Lua when I can. but - I don’t know if you recall my responses in the past - my job and other commitments leave me so little time to learn anything for any length of time. And when I do find a pocket of time to play, I’m eager to create something new and interesting , and obviously use that as time to learn in the process.
To make it worse, not being a programmer, and not being able to work with LUA on a daily basis, so much of what I learn is sadly lost - through lack of use..
Not meant to be a sob story, just something I have to work with - hence I’m always so grateful for your help and the help of others..
-
It looks like I finally have the main function in good shape Next on the list is to understand how the IrpTransmogrifier element fits in.
FYI - I’ve added a logging facility to the code, so that I can keep track of the .csv files accessed and the codes sent.
function scanIndexFiles () local lfs = require "lfs" local dir = "mnt/nas/vera/ircodes/" -- make this your path to the files local split = "^([^,]+),(.*)" -- (func_name,protocol,D,S,F) local prontoCode = '' for filename in lfs.dir(dir) do if filename: match "%.csv$" then print('Filename =' ..filename) for line in io.lines(dir .. filename) do local func_name,etc = line: match (split) local params = "([^,]+),([^,]+),([^,]+),([^,]+)" local protocol, D,S,F = etc: match(params) if 'POWER' == func_name:upper() then -- print ("$protocol $D $S $F", etc) print('Protocol = ' .. protocol) print('D = ' .. D) print('S = ' .. S) print('F = ' .. 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) print(command) local handle = assert(io.popen(command)) local prontoCode = handle:read("*a") handle:close() print(prontoCode) local time = os.date("%Y-%m-%d %H:%M:%S") local file = io.open("/www/test_write.txt", 'a') file:write(time .. "; " .. filename .. "; " .. protocol .. "; " .. D .. "; " .. S .. "; " .. F .. "\n") file:close() local INTERVAL_SECS = 2 --luup.call_delay('sendProntoCodeToBroadLinkDevice', INTERVAL_SECS, prontoCode) end end end end end
-
Current sticking point is - what do I do about the ‘Java’ requirement for getting IrpTransmogrifier to run on Vera.. Any recommendations?
To help narrow down my options; I’ve also posted this question on the Vera forum to see if anyone installed/used it.. -
Hoping this is the final piece to the puzzle and then we’re hopefully good to go....
JamVM seems the most likely...
-
@akbooer said in Discover IR codes for lost remote:
"...a Java VM is out of the question"
Interesting, as when I had read that part, I assumed he was just referring to your normal/standard approach to installing a Java VM on anything, as later in his point (3) he goes on to say ....
- Finding a lightweight Java VM that runs on MIPS. If you Google for "java openwrt" there are a lot of forum postings lamenting the lack of a working JVM for OpenWRT. However, jamvm (an actively maintained lightweight JVM) has had an OpenWRT ipkg right there in the OpenWRT opkg repository for a couple of years.
Goes on in (4) to propose..
opkg install jamvm
Which, considering how Vera is set up, that’s not a package you can install via that route..
root@MiOS_5247999:/tmp/verair# opkg install jamvm Unknown package 'jamvm'. Collected errors: * opkg_install_cmd: Cannot install package jamvm. root@MiOS_ 5247999:/tmp/verair#
It would be good to have everything I need for this all on the same machine; looking at the specification of a VeraPlus, does anyone think it has the resources ?
Spec / Vera Plus
CPU = 880MHz MIPS SoC
Flash Memory = NAND 128MB
Memory = DDR3 256MB -
@parkerc said in Discover IR codes for lost remote:
does anyone think it has the resources ?
No.
Forget doing this on a Vera. It would be easier to use, say Windows. Any recent Win machine probably already has the JRE already installed. Just install Lua on the Win machine (refer Google), get the code working (can still use Vera to test the majority of the code) and the call the IR transmitter on Vera with a URL, just like any other function (refer MiOS wiki) can be executed.
The install info for IrpTransmogrifier already has a batch file available ready to run it (refer to IrpTransmogrifier GitHub release and documentation pages). Basically IrpTransmogrifier is a Java program and needs to be executed by something that knows how to do it eg JVE. Just like windows knows how to execute Windows executables.
What does IrpTransmogrifier do? Lots of stuff but in your case it can generate (or as they prefer "render") actual codes, when feed a little bit of information. ie the parameters that define a code in a concise manner - that is: protocol,D,S,F
-
Thanks
Agreed, it doesn't really matter where the ‘processing’ is done, (doing it all on Vera just seemed the easiest) - but I ultimately just need to have a facility where I can search, find and the raise a request (all of which is so far unproven/tested) for the ‘POWER’ IR commands via ...
irptransmogrifier render -p -n D=7,S=7,F=2 NECx2
... and then have it (hopefully) return the command in the pronto code/format I want ....
0000 006C 0000 0022 00AD 00AD 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 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 0041 0016 06FB
.. and then once I have it, I just need to get that returned ‘code’ into your Broadlink request..
function sendProntoCodeToBroadLinkDevice(prontoCode) local BROADLINK_DEVICE_ID = 49 luup.call_action('urn:a-lurker-com:serviceId:IrTransmitter1', 'SendProntoCode', {ProntoCode = prontoCode}, BROADLINK_DEVICE_ID) end sendProntoCodeToBroadLinkDevice(prontoCode)
It all seem so do-able when I started.
-
Hi all
The plan on this now is to generates a CSV file, one line per signal, containing the filename, the ‘POWER’ command was found in, its protocol, and the D, S, and F parameters, that I can then import into IrScrutinizer (which is basically IrpTransmogrifier with a GUI), and then export that in the Pronto format .
Currently the following code to create the .csv is not going recursively through all the folders, any advice ?
function scanIndexFiles () local lfs = require "lfs" local dir = "mnt/nas/vera/ircodes/" -- make this your path to the files local split = "^([^,]+),(.*)" -- (func_name,protocol,D,S,F) local time = os.date("%Y-%m-%d %H:%M:%S") local prontoCode = '' for filename in lfs.dir(dir) do if filename: match "%.csv$" then for line in io.lines(dir .. filename) do local func_name,etc = line: match (split) local params = "([^,]+),([^,]+),([^,]+),([^,]+)" local protocol, D,S,F = etc: match(params) if 'POWER' == func_name:upper() then local file = io.open("/www/powerircodes.txt", 'a') print(filename .. "; " .. protocol .. "; " .. D .. "; " .. S .. "; " .. F .. "\n") file:write(filename .. "; " .. protocol .. "; " .. D .. "; " .. S .. "; " .. F .. "\n") file:close() end end end end end scanIndexFiles()
-
If it’s not easy/desirable to work through the folders using code, I can alway go down through the entire sub- folder hierarchy and bring all the individual .csv files into one single directory.
Update:
Some really good progress has been made using the IrScrutinizer app on a windows PC, as that allows me to do a batch conversion of the raw format i gather , into the desired Pronto code format.
Next challenge:
What is the best export format from IrScrutinizer to use with Lua ? Txt, html, xml,
See all the expert options here.. - http://www.harctoolbox.org/IrScrutinizer.html#The+Export+pane
Once that’s’ s done, the final piece of this grand plan i guess, is to have Vera work through that entire exported list, in order - sending each command, wait for a response, and if nothing is seen after x seconds, move onto the next one..
-
Hi,
If there is anyone still following this -
I’ve got all the .csv files into a single directory now, and everything is pretty much coming together - it’s just that my current issue seems to be with the code that’s extracting the ‘POWER’ line item information.
Based on the following LuaTest output, if I’m interpreting it correctly it needs something to handle any errors found when working through each .csv file. I’ve tired to add an ‘elseif’ but it either just breaks it/or stops.
Please could someone advise how do to get it ignore a file where it has a problem and move on seamlessly to the next one ?
LuaTest 1.7 Lua file: /etc/cmh-ludl/luatest.lua Results Runtime error: Line 14: attempt to index local 'etc' (a nil value) Locals [scanIndexFiles] 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="" [main] Print output Filename =26,-1.csv Filename =232,26.csv Filename =88,23.csv Filename =3,1.csv Filename =64,-1.csv Filename =1,222.csv Filename =25,-1.csv Filename =20,-1.csv Filename =64,159.csv Filename =203,67.csv Filename =167,133.csv Filename =192,243.csv Code 1 function scanIndexFiles () 2 local lfs = require "lfs" 3 local dir = "mnt/nas/vera/ircodes/" -- make this your path to the files 4 local split = "^([^,]+),(.*)" -- (func_name,protocol,D,S,F) 5 6 local prontoCode = '' 7 8 for filename in lfs.dir(dir) do 9 if filename: match "%.csv$" then 10 print('Filename =' ..filename) 11 for line in io.lines(dir .. filename) do 12 local func_name,etc = line: match (split) 13 local params = "([^,]+),([^,]+),([^,]+),([^,]+)" 14 local protocol, D,S,F = etc: match(params) 15 if 'POWER' == func_name:upper() then 16 -- print ("$protocol $D $S $F", etc) 17 -- print('Protocol = ' .. protocol) 18 -- print('D = ' .. D) 19 -- print('S = ' .. S) 20 -- print('F = ' .. F) 21 local time = os.date("%Y-%m-%d %H:%M:%S") 22 local file = io.open("/www/powerircodes.txt", 'a') 23 print(filename .. "; " .. protocol .. "; " .. D .. "; " .. S .. "; " .. F .. "\n") 24 file:write(filename .. "; " .. protocol .. "; " .. D .. "; " .. S .. "; " .. F .. "\n") 25 -- file:write(time .. "; " .. filename .. "; " .. protocol .. "; " .. D .. "; " .. S .. "; " .. F .. "\n") 26 file:close() 27 28 end 29 end 30 end 31 end 32 end 33 34 scanIndexFiles()
-
function scanIndexFiles () local lfs = require "lfs" local dir = "mnt/nas/vera/ircodes/" -- make this your path to the files local split = "^([^,]+),(.*)" -- (func_name,protocol,D,S,F) local file = io.open "/www/powerircodes.txt" for filename in lfs.dir(dir) do if filename: match "%.csv$" then for line in io.lines(dir .. filename) do local func_name,etc = line: match (split) if etc then local params = "([^,]+),([^,]+),([^,]+),([^,]+)" local protocol, D,S,F = etc: match(params) if 'POWER' == func_name:upper() then local info = table.concat ({filename, protocol, D, S, F}, "; ") print(info) file:write(info .. "\n") end end end end end file:close() end
-
Thanks so much @akbooer
I’ve run it a couple of times now, but it doesn’t seem to write to the file? It prints to the screen ok, but not to the write?
To get around that I’ve just been coping and pasting the print output into a text fileI’m close to the final piece now, I’ve captured and converted all the ‘POWER’ codes listed across all of those .csv files and I’d like to convert them into a table, or .csv, with their associated command name as the variable name, so I can then call them.
Example content of text1.txt (created by 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 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
And I’m now trying to get that above into a more usable format, such a Lua array/table or maybe another .csv. Below is th3 code I’ve been working on to do that, but i’m not having much success doing the conversion.
function convertCodestoarray (filename) local lfs = require "lfs" local dir = "mnt/nas/vera/ircodes/" -- the path to the files print(dir .. filename) for filename in lfs.dir(dir) do if filename: match "%.txt$" then for line in io.lines(dir .. filename) do local params = "([^,]+)/n([^,]+)" local codename, prontocode = params local params = table.concat ({codename, prontocode}, ", ") print(params) for filename in lfs.dir(dir) do local file = io.open("powerircodes.csv", 'a') filename:write(params .. "\n") end end filename:close() end end end convertCodestoarray("text1.txt")
-
-
@parkerc said in Discover IR codes for lost remote:
Last ask
Last answer...
A demo program that reads lines from a string with your data format and converts to tables of numbers.
local t = [[ 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 ]] local function decode(line) local code = {} for n in line: gmatch "%x+" do code[#code+1] = tonumber(n,0x10) end return code end for l in t: gmatch "[^\n]+" do if l: match "^%x+" then print(pretty(decode(l))) end end
Gives this output:
{0,112,0,50,128,64,16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,48,16,16,16,16,16,48,16,16,16,16,16,16,16,16,16,16,16,16,16,48,16,16,16,48,16,16,16,48,16,48,16,48,16,48,16,16,16,16,16,48,16,16,16,48,16,48,16,16,16,48,16,48,16,48,16,2765} {0,108,34,2,347,173,22,22,22,22,22,22,22,22,22,22,22,22,22,65,22,22,22,65,22,65,22,65,22,65,22,65,22,22,22,65,22,65,22,22,22,65,22,22,22,22,22,65,22,22,22,22,22,22,22,65,22,22,22,65,22,65,22,22,22,65,22,65,22,65,22,1527,347,87,22,3692} {0,104,0,34,361,180,23,68,23,68,23,23,23,23,23,23,23,68,23,23,23,68,23,23,23,23,23,68,23,68,23,68,23,23,23,68,23,23,23,68,23,23,23,23,23,68,23,68,23,23,23,23,23,68,23,23,23,68,23,68,23,23,23,23,23,68,23,68,23,23,23,1590}
-
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?
-
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)