06-11-2020, 02:55 PM
I've done this before and had no issues, but I am setting up another driver based on the HTTP Trigger driver and having some issues that must be just a simple oversight on my behalf.
Trained URL is http://<ip>:45101/fauxmo?fld=kitchenmain&fldcmd=on
Two parameter pairs. fld is the field to be changed and fldcmd is the value to be passed to the field
Simple so far.
Trained the driver on that URL. There is only one field to be used as the parameters will be used in if statements.
This is what I have so far (note P2 is not blank, but a whitespace)
// Get the tokens from the URL. 1 - Field to be written to, 2 - value to write
System::GetNthToken
P1=%(LVar:CQCActParm_2)
P2=
P3=1
P4=LVar:Field
System::GetNthToken
P1=%(LVar:CQCActParm_2)
P2=
P3=2
P4=LVar:FieldCmd
System::LogMsg
P1=FauxMo Command
P2=0
P3=FauxMo Sent a Command for %(LVar:Field):%(LVar:FieldCmd)
P4=Status
So this should dump a message in the log indicating the two parameters but I get nothing at all - the parameters from the URL are not getting assigned to the local variables.
06/12 08:53:09-Zeus01, CQCServer, CQCIRActThread_FauxMo
{
CQCAct, FauxMo Command.0, Status/App Status
FauxMo Sent a Command for :
}
I've done it this way before and it works, but I can not see what I have wrong here and for it to not work. I guess I am just out of practice
Trained URL is http://<ip>:45101/fauxmo?fld=kitchenmain&fldcmd=on
Two parameter pairs. fld is the field to be changed and fldcmd is the value to be passed to the field
Simple so far.
Trained the driver on that URL. There is only one field to be used as the parameters will be used in if statements.
This is what I have so far (note P2 is not blank, but a whitespace)
// Get the tokens from the URL. 1 - Field to be written to, 2 - value to write
System::GetNthToken
P1=%(LVar:CQCActParm_2)
P2=
P3=1
P4=LVar:Field
System::GetNthToken
P1=%(LVar:CQCActParm_2)
P2=
P3=2
P4=LVar:FieldCmd
System::LogMsg
P1=FauxMo Command
P2=0
P3=FauxMo Sent a Command for %(LVar:Field):%(LVar:FieldCmd)
P4=Status
So this should dump a message in the log indicating the two parameters but I get nothing at all - the parameters from the URL are not getting assigned to the local variables.
06/12 08:53:09-Zeus01, CQCServer, CQCIRActThread_FauxMo
{
CQCAct, FauxMo Command.0, Status/App Status
FauxMo Sent a Command for :
}
I've done it this way before and it works, but I can not see what I have wrong here and for it to not work. I guess I am just out of practice