<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[RemoteXY community — RemoteXY + Pushsafer]]></title>
		<link>https://forum.remotexy.com/viewtopic.php?id=1180</link>
		<atom:link href="https://forum.remotexy.com/extern.php?action=feed&amp;tid=1180&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in RemoteXY + Pushsafer.]]></description>
		<lastBuildDate>Thu, 01 Oct 2020 11:55:02 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: RemoteXY + Pushsafer]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3390#p3390</link>
			<description><![CDATA[<p>Hi, <br />As for now i have this assembled, it&#039;s quite coarse, but it gets the job done (at least the RemoteXY part)</p><div class="codebox"><pre><code>#include &lt;Pushsafer.h&gt;
#define REMOTEXY_MODE__ESP8266WIFI_LIB_CLOUD
#include &lt;ESP8266WiFi.h&gt;
#include &lt;ArduinoJson.h&gt;
#include &lt;RemoteXY.h&gt;
#include &lt;WiFiClient.h&gt;
#include &lt;Pushsafer.h&gt;

#define PushsaferKey &quot;The Key&quot;
char ssid [] = &quot;My SSID&quot;;
char password [] = &quot;My pass&quot;;
WiFiClient client;
Pushsafer pushsafer(PushsaferKey, client);

// RemoteXY connection settings 
#define REMOTEXY_WIFI_SSID &quot;My SSID&quot;
#define REMOTEXY_WIFI_PASSWORD &quot;My pass&quot;
#define REMOTEXY_CLOUD_SERVER &quot;cloud.remotexy.com&quot;
#define REMOTEXY_CLOUD_PORT 6376
#define REMOTEXY_CLOUD_TOKEN &quot;My Token&quot;





// RemoteXY configurate  
#pragma pack(push, 1)
uint8_t RemoteXY_CONF[] =
  { 255,3,0,0,0,52,0,10,177,1,
  130,2,1,1,61,98,26,2,0,8,
  20,22,11,2,26,31,31,79,78,0,
  79,70,70,0,2,0,34,20,22,11,
  2,26,31,31,79,78,0,79,70,70,
  0,3,131,6,38,51,19,2,26 };
  
// this structure defines all the variables and events of your control interface 
struct {

    // input variables
  uint8_t switch_1; // =1 if switch ON and =0 if OFF 
  uint8_t switch_2; // =1 if switch ON and =0 if OFF 
  uint8_t select_1; // =0 if select position A, =1 if position B, =2 if position C, ... 

    // other variable
  uint8_t connect_flag;  // =1 if wire connected, else =0 

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
//           END RemoteXY include          //
/////////////////////////////////////////////

#define PIN_SWITCH_1 D6
#define PIN_SWITCH_2 D7


void setup() 
{
  RemoteXY_Init (); 
  
  pinMode (PIN_SWITCH_1, OUTPUT);
  pinMode (PIN_SWITCH_2, OUTPUT);
  
  pushsafer.debug = true;

  // Take a look at the Pushsafer.com API at
  // https://www.pushsafer.com/en/pushapi
  
  struct PushSaferInput input;
  input.message = &quot;Water overflow&quot;;
  input.title = &quot;Warning&quot;;
  input.sound = &quot;8&quot;;
  input.vibration = &quot;2&quot;;
  input.icon = &quot;2&quot;;
  input.iconcolor = &quot;#FFCCCC&quot;;
  input.priority = &quot;1&quot;;
  input.device = &quot;28458&quot;;
  input.url = &quot;https://www.pushsafer.com&quot;;
  input.urlTitle = &quot;Open Pushsafer.com&quot;;
  input.picture = &quot;&quot;;
  input.picture2 = &quot;&quot;;
  input.picture3 = &quot;&quot;;
  input.time2live = &quot;&quot;;
  input.retry = &quot;&quot;;
  input.expire = &quot;&quot;;
  input.answer = &quot;&quot;;

  Serial.println(pushsafer.sendEvent(input));
  Serial.println(&quot;Sent&quot;);
  
}

void loop() 
{ 
  RemoteXY_Handler ();
  
  digitalWrite(PIN_SWITCH_1, (RemoteXY.switch_1==0)?LOW:HIGH);
  digitalWrite(PIN_SWITCH_2, (RemoteXY.switch_2==0)?LOW:HIGH);
  
  if (digitalRead(D7) == HIGH) // if pin 7 enjoyed a high level voltage
    RemoteXY.select_1 = 0;
  else                        // else
    RemoteXY.select_1 = 2;
    
  if (digitalRead(D6) == HIGH) // if pin 6 enjoyed a high level voltage
    RemoteXY.select_1 = 1;
  else                        // else
    RemoteXY.select_1 = 2;

}</code></pre></div><p>Sorry if there&#039;s something really faulty or obviously wrong in the code, feels like being a Car guy messing with a Plane</p><p>Edit: I&#039;m working with a WeMos D1 Mini based on ESP8266</p>]]></description>
			<author><![CDATA[null@example.com (guardocarlos94)]]></author>
			<pubDate>Thu, 01 Oct 2020 11:55:02 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3390#p3390</guid>
		</item>
		<item>
			<title><![CDATA[Re: RemoteXY + Pushsafer]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3388#p3388</link>
			<description><![CDATA[<p>Welcome,</p><p>What have you tried ?</p>]]></description>
			<author><![CDATA[null@example.com (Guillaume)]]></author>
			<pubDate>Wed, 30 Sep 2020 19:30:02 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3388#p3388</guid>
		</item>
		<item>
			<title><![CDATA[RemoteXY + Pushsafer]]></title>
			<link>https://forum.remotexy.com/viewtopic.php?pid=3387#p3387</link>
			<description><![CDATA[<p>Greetings!</p><p>Simple question: has anyone tried to run these two apps together on the same code? if so, how did you code it?<br />i have little to none experience with these two applications and i&#039;m having trouble making the two work at the same time</p><p>My idea is to set a trigger, took from the device, and translate it to a push notification on my phone</p><p>Any suggestions/ideas are welcome!</p><br /><br /><p>(sorry for the bad english, not my forte)</p>]]></description>
			<author><![CDATA[null@example.com (guardocarlos94)]]></author>
			<pubDate>Wed, 30 Sep 2020 18:20:55 +0000</pubDate>
			<guid>https://forum.remotexy.com/viewtopic.php?pid=3387#p3387</guid>
		</item>
	</channel>
</rss>
