Jump to content
Flirc Forums

Leaderboard

Popular Content

Showing content with the highest reputation on 05/19/2023 in all areas

  1. This is currently being worked on. I'm not the engineer, so apologies if I get this mangled, but it appears to be an issue with the LEDs occasionally drawing more current than expected, or something like that. For some reason, it causes the remote to do a hard reset and momentarily lose settings. Effort now is to eliminate or reduce the reset and preserve the settings. I think by the end of all this, Jason could probably get a PHD in optimizing energy flow on devices with low battery.
    1 point
  2. A forum member asked how I converted a CSV file I had created originally into a JSON file and I figured I would share with everyone. I pulled my codes from here https://www.remotecentral.com/cgi-bin/codes/yamaha/rx-v1000/ Here is how I got my json file. I am familiar with the Linux command line so I performed the following steps. Before I show these let me say that an easier way could be to open a spreadsheet program and copy the button name into one column and the code for the button into another column. The second column needs to have the spaces between the numeric codes replaced with commas. You should then be able to save to the CSV file. It is possible you spreadsheet program may be able to save the file to JSON. If not, you may be able to use an online tool to do that basic work. I followed the following steps to dump the html page into a bit more of a manageable file. The steps below have been modified from the blog post. lynx -dump 'https://www.remotecentral.com/cgi-bin/codes/yamaha/rx-v1000/' | sed -e 's/^ *//' | tr -s ' ' ',' | sed 's/$/,/' > dumped_page.txt I then ran the following commands to strip out more of what I did not need. sed -i '/\[filler\.gif\]/d' dumped_page.txt sed -i '/\(Copy,to,Clipboard\)/d' dumped_page.txt sed -i '/\[filler\.gif\]/d' dumped_page.txt I then opened the dumped_page.txt file into a text editor and removed all the text I did not need. How I found that was by looking for these couple of lines of text Remote Model: RAV222 [filler.gif] Power ([23]Copy to Clipboard) Power is where my first button started so I removed every line above Power in the file. I then looked for the equivalent of the bottom the button codes. [filler.gif] [ < Back | Page: 1 [43]2 | [44]Next > ] [filler.gif] I removed everything starting from the first filler.gif line to the bottom of the file. I then combined all the codes for each button onto one line. BEFORE Stadium, 0000,006b,0022,0002,0156,00ad,0015,0015,0015,0041,0015,0015,0015,0041, 0015,0041,0015,0041,0015,0041,0015,0015,0015,0041,0015,0015,0015,0041, 0015,0015,0015,0015,0015,0015,0015,0015,0015,0041,0015,0041,0015,0015, 0015,0041,0015,0041,0015,0015,0015,0015,0015,0015,0015,0041,0015,0015, 0015,0041,0015,0015,0015,0015,0015,0041,0015,0041,0015,0041,0015,0015, 0015,05f8,0156,0057,0015,0e57, AFTER Stadium,0000,006b,0022,0002,0156,00ad,0015,0015,0015,0041,0015,0015,0015,0041,0015,0041,0015,0041,0015,0041,0015,0015,0015,0041,0015,0015,0015,0041,0015,0015,0015,0015,0015,0015,0015,0015,0015,0041,0015,0041,0015,0015,0015,0041,0015,0041,0015,0015,0015,0015,0015,0015,0015,0041,0015,0015,0015,0041,0015,0015,0015,0015,0015,0041,0015,0041,0015,0041,0015,0015,0015,05f8,0156,0057,0015,0e57 Since I know I am working with a CSV file I removed the last comma from each line since I do not need it and it could cause problems when creating the JSON file I saved that file which now gives me 20 lines for my remote and then i ran another script to convert the CSV into a JSON file. Notice that I filled in the "types", "brand", and "model" with what was relevant to me. I redirected the output of the script to a file. #!/usr/bin/env bash cat << EOF { "header": { "version": "2.0" }, "types": [ "devices.audio" ], "brand": "Yamaha", "model": "RX V-1000", "signals": [ EOF while read -r line; do _label=$(echo "${line}" | cut -d ',' -f 1) _code=$(echo "${line}" | cut -d ',' -f 2- | tr '[:lower:]' '[:upper:]') cat << EOF { "label": "${_label}", "code": "${_code}", "protocol": "PRONTO" }, EOF done < dumped_page.txt cat << EOF ] } EOF One thing to keep on mind is that JSON is picky about commas and where then end up and the end of blocks. I will show what I mean with the last two entries of my JSON file. { "label": "RO Concert", "code": "0000,006B,0022,0002,0156,00AD,0015,0015,0015,0041,0015,0015,0015,0041,0015,0041,0015,0041,0015,0041,0015,0015,0015,0041,0015,0015,0015,0041,0015,0015,0015,0015,0015,0015,0015,0015,001 5,0041,0015,0015,0015,0015,0015,0041,0015,0041,0015,0015,0015,0015,0015,0015,0015,0041,0015,0041,0015,0041,0015,0015,0015,0015,0015,0041,0015,0041,0015,0041,0015,0015,0015,05F8,0156,0057,0015,0E57", "protocol": "PRONTO" }, <----- NOTICE THIS COMMA { "label": "Stadium", "code": "0000,006B,0022,0002,0156,00AD,0015,0015,0015,0041,0015,0015,0015,0041,0015,0041,0015,0041,0015,0041,0015,0015,0015,0041,0015,0015,0015,0041,0015,0015,0015,0015,0015,0015,0015,0015,001 5,0041,0015,0041,0015,0015,0015,0041,0015,0041,0015,0015,0015,0015,0015,0015,0015,0041,0015,0015,0015,0041,0015,0015,0015,0015,0015,0041,0015,0041,0015,0041,0015,0015,0015,05F8,0156,0057,0015,0E57", "protocol": "PRONTO" } <----- IT CANNOT EXIST AT THE END ] }
    1 point
×
×
  • Create New...