It is currently Mon May 29, 2017 9:00 pm



Welcome
Welcome to britishgashive

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!





 Page 8 of 8 [ 74 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8
Author Message
 Post subject: Re: Automated JSON Feed retrieval
PostPosted: Mon Jul 18, 2016 9:16 am 

Joined: Thu Mar 06, 2014 1:15 am
Posts: 10
Has thanked: 0 time
Have thanks: 1 time
From the looks of things i think that is the behaviur of the API. Probabily a mistake created at the begining and was just left there.


Offline
 Profile  
 
 Post subject: Re: Automated JSON Feed retrieval
PostPosted: Mon Jul 18, 2016 2:46 pm 

Joined: Thu Feb 19, 2015 10:52 am
Posts: 20
Has thanked: 1 time
Have thanks: 3 time
I've just installed a Hive Active Light, and the following JSONs provide the status and brightness of the light:

["nodes"][3]["attributes"]["state"]["reportedValue"]
["nodes"][3]["attributes"]["brightness"]["reportedValue"]


Offline
 Profile  
 
 Post subject: Re: Automated JSON Feed retrieval
PostPosted: Wed Jul 27, 2016 11:25 am 

Joined: Thu Feb 19, 2015 10:52 am
Posts: 20
Has thanked: 1 time
Have thanks: 3 time
The following curl command can be used to control the Hive Active Light (assuming that you have already logged in and established a sessionId and nodeId - see previous posts):
light=$(curl  -s -k --cookie-jar cookie.jar -X PUT -H "Content-Type: application/vnd.alertme.zoo-6.2+json" \
   -H "Accept: application/vnd.alertme.zoo-6.2+json" -H "Content-Type: 'application/*+json'" \
   -H "X-AlertMe-Client: Hive Web Dashboard" -H 'X-Omnia-Access-Token: '"$sessionId" \
   -d '{"nodes":[{"attributes":{"state":{"targetValue":"'"$state"'"},"brightness":{"targetValue":"'"$brightness"'"}}}]}' \
   "https://api.prod.bgchprod.info:443/omnia/nodes/${nodeId}")

where state and brightness are previously defined, e.g.,
state="ON"
brightness="50"

state can be ON or OFF, and brightness between 0 and 100, in increments of 10 (or any value?).

(Note the complex single and double quotes around these two variables in the data portion of the curl command - thanks to StackExchange for this!)


Offline
 Profile  
 
 Post subject: Re: Automated JSON Feed retrieval
PostPosted: Sat Aug 27, 2016 11:14 am 

Joined: Wed Oct 28, 2015 7:21 pm
Posts: 11
Has thanked: 0 time
Have thanks: 0 time
I'm currently writing some Node Red flows for Hive. (details of Node Red https://www.youtube.com/watch?v=f5o4tIz2Zzc and Nodered.org).

I can get access to the key things that I need, ie:
Temperature=25.02
Heating Relay=OFF
Water Mode=SCHEDULED (converted from the actual string returned, ie HEAT)
Heating Mode=SCHEDULED (converted from the actual string returned, ie HEAT)
HotWater Relay=OFF
serverConnection=CONNECTED
Target Temperature=20

To do this, I am parsing the json (v6 api) and looking for the keys.

My question is, do the Node order numbers ever change? (are they fixed at BGas). I'm trying to determine which Node is the thermstat (checking the nodeType) but two are returned. I can see one is the Heating and the other is the Water controller. I guess the only way is to check the child nodes for supportsHotWater key.... Unless anyone has a better way?


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 8 of 8 [ 74 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

cron

suspicion-preferred