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?
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.
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?
Hey everyone, I'm currently working on developing a bed sensor that can detect when you're out of bed. It could be used to trigger other smart home gadgets, like lights or blinds, temperature etc.
The sensors are placed under the legs of your bed post. Should look and feel like "smart furniture pads" with size 2 inches in diameter and 1/4 inch thick.
Before we go any further, I'd love to get your thoughts on this - would a bed sensor like this be something you'd find useful? We're still in the early stages of development, so any feedback you have would be greatly appreciated. Thanks in advance!
@DesT, fenced code blocks display differently after the upgrade.
abc defThe above should display as abc and def on two separate lines. This works. But this fails:
verbose: true config: data: "auto"The above should display as three lines, verbose: true, config: and data: "auto", but this fails. In order to make it display properly, I now have to open the fenced code block with ```text (specify language, generic text). This displays without highlighting. The words yml and yaml (and the all-caps versions) don't seem to be recognized. I can also use js to get JavaScript highlighting, but this isn't great for YAML. Here's the same block with the language (text) specifier added (no other changes):
verbose: true config: data: "auto"Sure, we can start adding language specifiers to our new posts, but I suspect if we start digging around old posts, we're going to find a lot of broken display of the fenced code blocks (plain ``` at the start with no language specifier) in the thousands of old posts in these forums, upon which people still rely for answers and information.
Log file snippets also get similarly brutalized:
[###BUILDVERSION###]2023-04-26T19:41:51.683Z <ZWaveJSController:NOTICE> ZWaveJSController#zwavejs added file logger to zwavejs.log [###BUILDVERSION###]2023-04-26T19:41:51.747Z <ZWaveJSController:WARN> zwavejs_capabilities defines x_zwave_device_cfg, which is not consistent with the recommended naming [###BUILDVERSION###]2023-04-26T19:41:51.747Z <ZWaveJSController:WARN> zwavejs_capabilities defines x_zwave_mfg_spec, which is not consistent with the recommended naming [###BUILDVERSION###]2023-04-26T19:41:51.747Z <ZWaveJSController:WARN> zwavejs_capabilities defines x_zwave_device_ver, which is not consistent with the recommended naming [###BUILDVERSION###]2023-04-26T19:41:51.747Z <ZWaveJSController:WARN> zwavejs_capabilities defines x_zwave_values, which is not consistent with the recommended naming [###BUILDVERSION###]2023-04-26T19:41:51.837Z <ZWaveJSController:INFO> ZWaveJSController#zwavejs connecting to ws://192.168.0.10:3000 [###BUILDVERSION###]2023-04-26T19:41:51.874Z <ZWaveJSController:NOTICE> ZWaveJSController#zwavejs connected [###BUILDVERSION###]2023-04-26T19:41:51.874Z <ZWaveJSController:INFO> ZWaveJSController#zwavejs sending connection initialization [###BUILDVERSION###]2023-04-26T19:41:51.931Z <ZWaveJSController:INFO> ZWaveJSController#zwavejs greeting from server: [Object]{ "type": "version", "driverVersion": "10.16.0", "serverVersion": "1.28.0", "homeId": 3631280043, "minSchemaVersion": 0, "maxSchemaVersion": 28 } [###BUILDVERSION###]2023-04-26T19:41:51.932Z <ZWaveJSController:INFO> ZWaveJSController#zwavejs performing initial inventory [###BUILDVERSION###]2023-04-26T19:41:52.325Z <ZWaveJSController:INFO> ZWaveJSController#zwavejs manufacturer-specific data for 134 (AEON Labs) from package ver 22315.1 [###BUILDVERSION###]2023-04-26T19:41:52.328Z <ZWaveJSController:INFO> ZWaveJSController#zwavejs configuring node 1 endpoint 0 (entity "1-0") [###BUILDVERSION###]2023-04-26T19:41:52.339Z <ZWaveJSController:INFO> ZWaveJSController#zwavejs manufacturer-specific data for 543 (Elexa Consumer Products Inc.)I think this is going to be a problem. Is there a way in NodeBB to configure the default language for fenced code block markdown for the entire forum so that these display more as they did before the upgrade?
EDIT: Examples below of old posts with corrupt formatting now:
https://smarthome.community/topic/1101/dynamic-groups-controller-filter-expressions
https://smarthome.community/post/11362
This last old post is interesting, because the first block displays incorrectly, but the second block is OK. In playing around, there seem to be triggering character sequences, suggesting that the markdown processor is trying to "guess" the language but not getting it right, perhaps:
Can anyone help with the MIOS UI5 weblink? Not the getvera one.
Still running UI5 on a couple of sensors & lights and need to tweak PLEG but for the life of me I can't remember the link to tunnel back to the trusty machine....
The wifi on my router is turned off, and wifi around the house is provided using a mesh - 3 units altogether (one connected directly to the router) that are spread around the house.
I would like to start automating certain tasks around the house and intend to try adding a few smart sockets to my setup.
The mesh system I have supports both 2.4GHz and 5GHz, and does not provide me with the option to control them - i.e. turn one or both on/off, give each a different SSID, etc.
The devices I wish to purchase/use only support 2.4GHz.
Will turning the mesh units off and temporarily turning the 2.4GHz wifi on the router to allow me to set them up be enough? Will I then be able to return to my usual setup and everything will work as it should?
Many thanks in advance
ChatGPT samples:
Me:
Tell me about an iot program called openLuup.
It:
OpenLuup is an open source home automation system that is built on the VeraLuup platform. It is designed to be easy to install and configure, and provides users with a powerful and versatile way to control their home automation devices. OpenLuup offers a wide range of features, including support for many popular home automation devices, scheduling, scripting, and integration with other services. OpenLuup is designed to be customizable, allowing users to create their own home automation systems. It is an excellent choice for those looking to create their own home automation system without spending a lot of money.
Me:
Write an iot program using openLuup.
It:
--openLuup IoT Program-- -- Initialize Variables -- local device_id = "MyHomeDevice" local temperature_sensor_id = "MyTemperatureSensor" local temperature_threshold = 75 -- Create Devices -- luup.create_device("OpenLuup Temperature Sensor", 0, device_id, "D_GenericSensor1.xml", "I_GenericSensor1.xml", "S_TemperatureSensor1.xml", "") luup.variable_set("urn:upnp-org:serviceId:TemperatureSensor1", "CurrentTemperature", 0, device_id) -- Start Timer -- luup.call_delay("check_temperature", 10, "", false) --Function to Check Temperature-- function check_temperature() local current_temperature = luup.variable_get(temperature_sensor_id, "CurrentTemperature", 0) --Check Temperature Threshold-- if current_temperature >= temperature_threshold then --Send Alert-- luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "SendTextMessage", {PhoneNumber="1234567890", Message="ALERT! Temperature exceeded threshold!"}, 0) end --Reset Timer-- luup.call_delay("check_temperature", 10, "", false) endMe:
Write an iot program using openLuup.
It:
Write an iot program using openLuup. -- openLuup IOT Program -- -- Variables local lampState = false local lampTime = 0 -- Functions function lampTimer() if lampTime > 0 then lampTime = lampTime - 1 if lampTime == 0 then luup.variable_set('urn:upnp-org:serviceId:SwitchPower1', 'Status', 0, lampDeviceID) lampState = false end end end -- Setup luup.call_delay('lampTimer', 60, 0) -- Main Loop while true do -- Check for motion if luup.variable_get('urn:micasaverde-com:serviceId:MotionSensor1', 'Tripped', motionSensorDeviceID) == '1' then if not lampState then luup.variable_set('urn:upnp-org:serviceId:SwitchPower1', 'Status', 1, lampDeviceID) lampState = true -- Set lamp timer to 5 minutes lampTime = 300 end end luup.sleep(1) endWhat??
luup.sleep(1)Not good - looks like I still have some semblance of a job to fulfill.
Me:
An iot program called openLuup was written by akbooer. Who is akbooer?
It: (note: answer redacted and as I understand it, also incorrect re: AltUI):
akbooer is the pseudonym of the software developer and home automation enthusiast. He is the creator of the openLuup home automation software, which is an open-source version of the Vera home automation system. He is also the creator of the AltUI graphical user interface for openLuup.
Me:
Who created of the AltUI graphical user interface for openLuup.
and
Me:
Who created of the AltUI graphical user interface for the home automation system Vera.
Names two different people - mmmm.
Regardless very impressive - give it a few more years.
...which I'd like to do. I know I go about these things all wrong (namely think of something I'd like to do, then try and work out what I need to know) but that's me 🙂
Just looking for some pointers on what I should google for really:
What I'd like is to provide a selection of (basically two word) phases which I can select from randomly (or even pseudo randomly) and pass to Alexa to be spoken. There are 10 such phrases only.
So what should I be reading up on to get me started?
TIA for any guidance
C
Discover IR codes for lost remote
-
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)
-
Hi,
If you're looking for a specific brand/model, you might try https://irdb.globalcache.com/Home/About. Registering is free and access to normal users has rate limited access to the DB, but it does contain IR codes which can be converted to Pronto codes via other free programs. I've used it for a number of codes for my devices.
-
I fear, I may have hit my Vera/Lua wall.
I seem to have been able to partially rework the output from IrScrutinizer, but I can’t seem to get it into an appropriate format for @a-lurker’s code to then run through them all in sequence..
Input file (text1.txt) from IrScrutinizer
Power 0000 0070 0000 0032 0080 0040 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0030 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0010 0010 0030 0010 0030 0010 0030 0010 0ACD Power$1 0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 05F7 015B 0057 0016 0E6C Power$2 0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0019 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0041 0016 0019 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 05F7 015B 0057 0016 0E6C
Current Output file (text2.txt)
The ‘print’ looks positive, however I can’t seem to get each line in the correct format in the text2.txt file, it always spans 2 lines.
local Power = "0000 0070 0000 0032 0080 0040 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0030 0010 0030 0010 0010 0010 0010 0010 0030 0010 0010 0010 0030 0010 0030 0010 0010 0010 0030 0010 0030 0010 0030 0010 0ACD " local Power$1 = "0000 006C 0022 0002 015B 00AD 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0016 0016 0016 0016 0016 0016 0041 0016 0016 0016 0041 0016 0041 0016 0016 0016 0041 0016 0041 0016 0041 0016 05F7 015B 0057 0016 0E6C " local Power$2 = "0000 0068 0000 0022 0169 00B4 0017 0044 0017 0044 0017 0017 0017 0017 0017 0017 0017 0044 0017 0017 0017 0044 0017 0017 0017 0017 0017 0044 0017 0044 0017 0044 0017 0017 0017 0044 0017 0017 0017 0044 0017 0017 0017 0017 0017 0044 0017 0044 0017 0017 0017 0017 0017 0044 0017 0017 0017 0044 0017 0044 0017 0017 0017 0017 0017 0044 0017 0044 0017 0017 0017 0636 " local Power$3 = "0000 006D 0011 000E 0013 005F 0013 0026 0026 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0013 0227 0013 005F 0013 0026 0013 0013 0026 0013 0013 0026 0013 0013 0013 0013 0013 0013 0013 0013 0026 0026 0026 0026 0013 0013 0026 0026 0013 1054 "
Latest code is below.. All ideas/suggestions welcome
-- https://oc.cil.li/topic/1524-how-can-i-store-each-line-of-a-file-in-an-array-in-lua/#comment-6763 -- CP: does not Work -- v0.9 function sendProntoCodeToBroadLinkDevice(prontoCode) local BROADLINK_DEVICE_ID = 49 luup.call_action('urn:a-lurker-com:serviceId:IrTransmitter1', 'SendProntoCode', {ProntoCode = prontoCode}, BROADLINK_DEVICE_ID) end local write_file_path = "/mnt/nas/vera/text2.txt" -- # path to your file here local read_file_path = "/mnt/nas/vera/text1.txt" -- # path to your file here local pattern1 = "^.*Power.*$" -- # your pattern to find local pattern2 = "^.*0000.*$" -- # your pattern to find local matches = {} io.open(write_file_path,"w+"):close() local function contains(str, pattern) return string.match(str, pattern) and true or false end for line in io.lines(read_file_path) do if contains(line, pattern1) then command = (line) -- table.insert(matches, line1) end if contains(line, pattern2) then ProntoCode = (line) -- table.insert(matches, line1, line2) local irstr = command .. "" .. ProntoCode --print(irstr) print(string.format('local %s = "%s"\n',command,ProntoCode)) local file = io.open(write_file_path, 'a') -- file:write(command .. "" .. ProntoCode .. "\n") -- file:write(irstr .. "\n") file:write(string.format('local %s = "%s"\n',command,ProntoCode)) file:close() end end local INTERVAL_SECS = 2 luup.call_delay('sendProntoCodeToBroadLinkDevice', INTERVAL_SECS, prontoCode)
-
Well, they say in life "nothing ventured, nothing gained" and thanks to this forum and stackoverflow, I’ve got a working solution.
Code is below, any feedback on optimisation is always appreciated.
local lfs = require "lfs" local read_file_path = "/mnt/nas/vera/text1.txt" -- # path to your file here local write_file_path = "/mnt/nas/vera/text2.txt" -- # path to your file here local pattern1 = "^.*Power.*$" -- # your pattern to find local pattern2 = "^.*0000.*$" -- # your pattern to find io.open("/mnt/nas/vera/text5.txt", 'a'):close() --local logFile = io.open(write_file_path, 'w') local logs = {} -- We will use this to log the messages to log.txt later local i = 1;for line in io.lines(read_file_path) do if (line:find(pattern1) or not line:find('%A')) and line:len() > 1 then local powerref = line logs[#logs+ 1] = 'Command: ' .. powerref elseif line:find(pattern2) then local prontoCode = line local x = 1 do x = x + 1 local pause = os.clock() print('"' ..prontoCode..'"') luup.call_action('urn:a-lurker-com:serviceId:IrTransmitter1', 'SendProntoCode', {ProntoCode = prontoCode}, 49) -- x = x + 1 -- local pause = os.clock() repeat until os.clock() > pause + 3 local time = os.date("%Y-%m-%d %H:%M:%S") local xfile = io.open("/mnt/nas/vera/text5.txt", 'a') xfile:write(time .. " - " .. prontoCode .. "\n") xfile:close() end logs[#logs + 1] = 'Sequence: ' .. line end; i = i + 1 -- Raise the line number end local logFile = io.open(write_file_path, 'w') logFile:write(table.concat(logs, '\n')) logFile:flush()