Camera webhook'in

Hi,
I have camera with pir sensor and mail notification when motion is detected.
The fun thing is that camera got remote and i can turn on and off notifications just like an alarm system, second possibility is steering by curl.
I want to do simple on/off alarm with one button
this is arm alarm command
curl -T on.xml http://login:pass@cameraip/ISAPI/WLAlarm/telecontrol
on.xml
< ?xml version="1.0" encoding="UTF-8"?> < telecontrol version="1.0" xmlns="urn:psialliance-org"> < enabled>true</enabled> < delay> < armingdelay>0</armingdelay> < /delay> < /telecontrol>

Question is how to encode on.xml in to webhook.
second question is how to put it in the button. Should be simple?:

BLYNK_WRITE(V35){
  if (param.asInt())
  {
  Blynk.virtualWrite(V36, value);
  }
  else
  {
  Blynk.virtualWrite(V37, value);
  }
 }

And off top question, my code got over 400 lines and counting. What software do You use to developing your projects?

In regard to your last question, I use PlatformIO. It trumps the Arduino IDE is sooooo many ways.

In regard to encoding XML, there are several libraries for Arduino with which you can make web calls, for example this: https://www.arduino.cc/en/Tutorial/HttpClient

1 Like