@librasun here is a demo I put together on Home Remote utilizing my personal project. I also use MSR for a majority of the conditional logic. The demo runs about 9 minutes.
Tarkus
Posts
-
Home Remote dashboard app and MSR HTTP API -
Feature request on reactions side.@toggledbits said in Feature request on reactions side.:
whereas buttonCodes[ . ] and buttonCodes["x"] simply make no sense.
These are actually OK if buttonCodes is an object, not an array. You can use the square-bracket notation same as dot member access, so buttonCodes[ "x" ] (note the quotes so it's a string) is the same as buttonCodes.x. Using the square bracket notation lets you use a variable for the member name. You don't need a second array, you just need to structure buttonCodes correctly...
buttonCodes = { '0': 'codes for 0', '1': 'codes for 1', '.': 'codes for dot' }
key_to_send = "." # or whatever/however you get the key
send_data = buttonCodes[ key_to_send ]I ended up using this method and it works great!
Thanks for all the help.
-
Feature request on reactions side.@librasun said in Feature request on reactions side.:
Secondly, your definition of buttonCodes itself shows just a long comma-separated list, which cannot work as is. To make it an array, it must start with [ and end with ].
Yeah i had the brackets but it did not work so the absence of of them is just me trying different things and not knowing what I am doing. LOL
-
Feature request on reactions side.I thought a period was considered numeric in programing to accommodate decimals.
-
Feature request on reactions side.@librasun yes i do that often
-
Feature request on reactions side.The X's are just left over remnants of the lua process I was using. It was just padding and acted a indicator that the channel was at a end and stop the process. So channel 7.1 would come over as 7.1xx. I set 5 characters to accommodate a 5 digit channel i.e. 135.1 I will take a look at your suggestions.
-
Feature request on reactions side.I also forgot to mention that I need to work a "." into the array
-
Feature request on reactions side.@LibraSun So this is where I am at and I am stuck. The variable Channel gets pulled in from veras multistring and it gets split into the Character variables. That part works, just trying to work thru the rest.
-
Feature request on reactions side.@librasun Ok the quotes did the trick! So I am assuming for
"code0","code1","code2", ... ,"code9"
I am assuming I am making 10 variables. i.e.
code0="0000 0067 0000 000D 0060 0018 0030 0018 0018 0018 0018 0018 0030 0018 0018 0018 0018 0018 0018 0018 0030 0018 0018 0018 0018 0018 0018 0018 0018 0422"
ect, ect....
-
Feature request on reactions side.@librasun Definitely did not use quotes, will try that.
-
Feature request on reactions side.Have not gotten that far. Just was playing around with this, this morning before my workday started. Will dig into logs when I get a chance.
-
Feature request on reactions side.yes, it just does not fire when putting the code into a variable.
-
Feature request on reactions side.Patrick did say the Plugin was really barebone's or something to that effect.
-
Feature request on reactions side.I am afraid the Global Cache IR plugin that Patrick added support for does not seem to work with expressions in the send code field. I tried to add the hex code for a digit to a Global expression and put ${{Digit_1}} in the send code field but it did not work.
-
Feature request on reactions side.@librasun Sure I currently have lua that has multiple "if" conditions that is run on the reaction side. Consider these "if" conditions in the lua the secondary conditions.
Usage senario:
Say you have 3 separate expression / variables with varying values of 0-9 lets call them.
Variable_1
Variable_2
Variable_3On the reaction side
If variable_1 = 2
Send TV IR code for digit 1
If variable_1 = 2
Send TV IR code for digit 2
etc, etc
delay 1 second
If variable_2 = 1
Send TV IR code for digit 1
If variable_2 = 2
Send TV IR code for digit 2
etc, etc
delay 1 second
If variable_3 = 1
Send TV IR code for digit 1
If variable_3 = 2
Send TV IR code for digit 2
etc, etc
-
Feature request on reactions side.Secondary conditional rules on reactions.
-
Parsing an expressionThanks guys, this worked just like I needed it to.
-
Parsing an expressionIt does not have to be on the Vera side. I can get the 3 digit variable into a MSR expression I just don't fully understand how to parse the characters into 3 separate entities for MSR to evaluate in a 3 seperare rules.i do follow what you suggested but just not sure how to implement it in MSR These are for TV channel.IR codes. I am using a lua routine on the Vera side for this and it often causes luup restarts. And I am just looking for a different approach.
-
Parsing an expressionSo this would have to be lua on the vera side that populates the extract variable which I can then define as an expression in MSR? I am using the multi-string plugin which gets populated with a 3 digit string on multistrings variable1 and I want to perform 3 different reactions based on the varying values of characters 1 2 and 3. One reaction for each character. It sounds like I would need 3 variables extract1, extract2 and extract3.
-
Parsing an expressionIf an expression value has a value of 789 can you isolate a character in the expression? i.e. If character 2 = 8 then perform a reaction. If not is this even possible to implement if I put in a feature request?