newbie in Python /pushover messaging

Python and python framework

Moderator: leecollings

Post Reply
petecz
Posts: 5
Joined: Sunday 13 August 2017 17:53
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

newbie in Python /pushover messaging

Post by petecz »

hello,
I ve got such a problem
viewtopic.php?f=62&t=18865
I am trying to make workaround with Python script
My JSON address is:
http://192.168.101.117:8080/json.htm?ty ... ces&rid=12
my data which are gonna to be extracted is @screenshot.
I want to have a message when state is changed /for example it will be loss of voltage on alarm system.
I have a piece of code for sending pushover notes and it works.

Code: Select all

 
import sys
import json
import urllib2
import re
import time
import datetime
import httplib, urllib
 

conn = httplib.HTTPSConnection("api.pushover.net:443")
conn.request("POST", "/1/messages.json",
urllib.urlencode({
    "token": "ap",
    "user": "ug",
    "message": "message: ",
    "title": "title",
    "priority": "-1",
  }), { "Content-type": "application/x-www-form-urlencoded" })
conn.getresponse()

How to merge it?
Attachments
dmtcz.jpg
dmtcz.jpg (165.36 KiB) Viewed 719 times
mivo
Posts: 80
Joined: Friday 21 April 2017 8:58
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Czechia
Contact:

Re: newbie in Python /pushover messaging

Post by mivo »

My toys:
Raspberry Pi 3 + UPS PIco HV3.0 A Stack
Minibian (Raspbian Jessie) + Domoticz beta
RFLink 433 Gateway, 1wire DS18B20 temp sensors (GPIO)
RaZberry module + 2x Comet Z-Wave + Z-wave socket
---
Plugins: WeMo Switch, UPS PIco HV3.0A on GitHub
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests