Skip to content

Commit

Permalink
Version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenyoussef authored Sep 8, 2024
1 parent ed2f849 commit bc1a48a
Show file tree
Hide file tree
Showing 45 changed files with 17,070 additions and 0 deletions.
2,431 changes: 2,431 additions & 0 deletions Crestron To Netatmo Integration.sm2

Large diffs are not rendered by default.

2,432 changes: 2,432 additions & 0 deletions Crestron To Netatmo Integration.smw

Large diffs are not rendered by default.

Binary file added Crestron To Netatmo Integration_archive.zip
Binary file not shown.
77 changes: 77 additions & 0 deletions Dimmer Feedback.ush
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[BEGIN]
Version=1
[END]
[BEGIN]
ObjTp=FSgntr
Sgntr=UserSPlus
RelVrs=1
IntStrVrs=1
SPlusVrs=4.06.00
CrossCplrVrs=1.3
[END]
[BEGIN]
ObjTp=Hd
[END]
[BEGIN]
ObjTp=Symbol
Exclusions=1,19,20,21,88,89,167,168,179,213,214,215,216,217,225,226,248,249,266,267,310,362,378,380,405,407,408,409,478,522,537,554,586,590,611,624,718,756,767,830,841,842,854,883,955,1032,1062,1079,1128,1129,1134,1140,1157,1158,1195,1199,1220,1221,1222,1223,1299,1348,1349,1439,1472,1473,1499,1746,1803,1975,2229,2354,2514,2523,2532,2706,2707,3235,3236,3427,3454,3567,3568,3601,3602,3708,3902,3903,3912,3918,3925,3926,4206,4207,
Exclusions_CDS=5
Inclusions_CDS=6,7
Name=Dimmer Feedback
SmplCName=Dimmer Feedback.usp
Code=1
SysRev5=3.090
SMWRev=2.02.05
OutputCue1=switch_on_fb
OutputSigType1=Digital
OutputCue2=switch_off_fb
OutputSigType2=Digital
InputList2Cue1=returned_string
InputList2SigType1=Serial
InputList2Cue2=device_id
InputList2SigType2=Serial
OutputList2Cue1=switch_brightness_fb
OutputList2SigType1=Analog
ParamCue1=[Reference Name]
MinVariableInputs=0
MaxVariableInputs=0
MinVariableInputsList2=2
MaxVariableInputsList2=2
MinVariableOutputs=2
MaxVariableOutputs=2
MinVariableOutputsList2=1
MaxVariableOutputsList2=1
MinVariableParams=0
MaxVariableParams=0
Expand=expand_separately
Expand2=expand_separately
ProgramTree=Logic
SymbolTree=32
Hint=
PdfHelp=
HelpID=
Render=4
Smpl-C=16
CompilerCode=-48
CompilerParamCode=27
CompilerParamCode5=14
NumFixedParams=1
Pp1=1
MPp=1
NVStorage=10
ParamSigType1=String
SmplCInputCue1=o#
SmplCOutputCue1=i#
SmplCInputList2Cue1=an#
SmplCOutputList2Cue1=ai#
SPlus2CompiledName=S2_Dimmer_Feedback
SymJam=NonExclusive
FileName=Dimmer Feedback.ush
SIMPLPlusModuleEncoding=0
[END]
[BEGIN]
ObjTp=Dp
H=1
Tp=1
NoS=False
[END]
123 changes: 123 additions & 0 deletions Dimmer Feedback.usp
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#DEFAULT_VOLATILE
#ENABLE_STACK_CHECKING
#ENABLE_TRACE


STRING_INPUT returned_string[1000], device_id[20];
DIGITAL_OUTPUT switch_on_fb, switch_off_fb;
ANALOG_OUTPUT switch_brightness_fb;
nonvolatile string lost_feedback[50], lost_id[50];
CHANGE returned_string
{
STRING extractedData[100];
STRING response_switch_state_fb$[100];
STRING added_temp[50];
INTEGER startPos;
INTEGER endPos;
STRING temp_char1[1];
STRING temp_char2[1];
INTEGER positionValue; // To store the numeric position

device_id = Mid(device_id, 13, 11);
returned_string = lost_id + returned_string;
lost_id = "";
startPos = Find(device_id, returned_string);
print("startPos is: %d", startPos);
if(len(lost_feedback) > 0){
//This runs when we know that the feedback is split in 2
lost_feedback = lost_feedback + Mid(returned_string, 1, 23-Len(lost_feedback));
MakeString(response_switch_state_fb$, "%s", lost_feedback); // Store for feedback
print("response string is : %s", response_switch_state_fb$);
if(response_switch_state_fb$ = "true,"){
switch_on_fb = 1;
switch_off_fb = 0;
extractedData = Mid(returned_string, endPos+18, 1);
temp_char1 = Mid(returned_string, endPos+19, 1);
temp_char2 = Mid(returned_string, endPos+20, 1);
if(temp_char2 = ","){
extractedData = extractedData + temp_char1;
}
else if(temp_char1 = ","){
extractedData = extractedData;
}
else{
extractedData = extractedData + temp_char1 + temp_char2;
}
MakeString(response_switch_state_fb$, "%s", extractedData);
positionValue = Atoi(response_switch_state_fb$); // Convert to integer
switch_brightness_fb = positionValue;
//print("dimmer brightness is: %a", positionValue);
}
else{
switch_on_fb = 0;
switch_off_fb = 1;
switch_brightness_fb = 0;
}
lost_feedback = "";
}
else if (startPos)
{
endPos = startPos + 32;
if(endPos < 233){
extractedData = Mid(returned_string, endPos, 5); // Extract characters 21 to 25
MakeString(response_switch_state_fb$, "%s", extractedData); // Store for feedback
print("response string is : %s", response_switch_state_fb$);
if(response_switch_state_fb$ = "true,"){
switch_on_fb = 1;
switch_off_fb = 0;
extractedData = Mid(returned_string, endPos+18, 1);
temp_char1 = Mid(returned_string, endPos+19, 1);
temp_char2 = Mid(returned_string, endPos+20, 1);
if(temp_char2 = ","){
extractedData = extractedData + temp_char1;
}
else if(temp_char1 = ","){
extractedData = extractedData;
}
else{
extractedData = extractedData + temp_char1 + temp_char2;
}
MakeString(response_switch_state_fb$, "%s", extractedData);
positionValue = Atoi(response_switch_state_fb$); // Convert to integer
switch_brightness_fb = positionValue;
//print("dimmer brightness is: %a", positionValue);
}
else{
switch_on_fb = 0;
switch_off_fb = 1;
switch_brightness_fb = 0;
}
added_temp = "";
lost_feedback = added_temp;
lost_id = "";
}
else{
print("feedback in next line");
added_temp = Mid(returned_string, endPos, 23);
lost_feedback = added_temp;
print("lost_feedback is : %s", lost_feedback);
}

}
else
{
Trace("Device ID not found.");

extractedData = Mid(returned_string, 230, 25);
lost_id = "";
lost_id = extractedData;
}

}


Function Main()
{
// Initialize declared global and local variables/arrays as needed.

WaitForInitializationComplete();
//added = added_temp;
}



79 changes: 79 additions & 0 deletions Dimmer Set.ush
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[BEGIN]
Version=1
[END]
[BEGIN]
ObjTp=FSgntr
Sgntr=UserSPlus
RelVrs=1
IntStrVrs=1
SPlusVrs=4.06.00
CrossCplrVrs=1.3
[END]
[BEGIN]
ObjTp=Hd
[END]
[BEGIN]
ObjTp=Symbol
Exclusions=1,19,20,21,88,89,167,168,179,213,214,215,216,217,225,226,248,249,266,267,310,362,378,380,405,407,408,409,478,522,537,554,586,590,611,624,718,756,767,830,841,842,854,883,955,1032,1062,1079,1128,1129,1134,1140,1157,1158,1195,1199,1220,1221,1222,1223,1299,1348,1349,1439,1472,1473,1499,1746,1803,1975,2229,2354,2514,2523,2532,2706,2707,3235,3236,3427,3454,3567,3568,3601,3602,3708,3902,3903,3912,3918,3925,3926,4206,4207,
Exclusions_CDS=5
Inclusions_CDS=6,7
Name=Dimmer Set
SmplCName=Dimmer Set.usp
Code=1
SysRev5=3.090
SMWRev=2.02.05
InputList2Cue1=access_token
InputList2SigType1=Serial
InputList2Cue2=device_id
InputList2SigType2=Serial
InputList2Cue3=home_id
InputList2SigType3=Serial
InputList2Cue4=dimmer_value
InputList2SigType4=Analog
OutputList2Cue1=dimmer_value_header
OutputList2SigType1=Serial
OutputList2Cue2=dimmer_value_content
OutputList2SigType2=Serial
ParamCue1=[Reference Name]
MinVariableInputs=0
MaxVariableInputs=0
MinVariableInputsList2=4
MaxVariableInputsList2=4
MinVariableOutputs=0
MaxVariableOutputs=0
MinVariableOutputsList2=2
MaxVariableOutputsList2=2
MinVariableParams=0
MaxVariableParams=0
Expand=expand_separately
Expand2=expand_separately
ProgramTree=Logic
SymbolTree=32
Hint=
PdfHelp=
HelpID=
Render=4
Smpl-C=16
CompilerCode=-48
CompilerParamCode=27
CompilerParamCode5=14
NumFixedParams=1
Pp1=1
MPp=1
NVStorage=10
ParamSigType1=String
SmplCInputCue1=o#
SmplCOutputCue1=i#
SmplCInputList2Cue1=an#
SmplCOutputList2Cue1=ai#
SPlus2CompiledName=S2_Dimmer_Set
SymJam=NonExclusive
FileName=Dimmer Set.ush
SIMPLPlusModuleEncoding=0
[END]
[BEGIN]
ObjTp=Dp
H=1
Tp=1
NoS=False
[END]
Loading

0 comments on commit bc1a48a

Please sign in to comment.