#140 How to setup a new SkySpark demo project

gada Alaloof Tue 7 Jan 2014

Hi I'm new with haystack and just have installed the haystack project on my eclipse and deployed the servlet on a web server.

The ClientTest class mentioned somethiong about setup instance of SkySpark runing on localhost with standard demo project and a user account "haystack/testpass".

My question : How do I do that ? Do I need a additional setup ?

Thanks.

Brian Frank Tue 7 Jan 2014

That test uses SkySpark as a server to test client functionality. If you have access to SkySpark, then you just setup a special account with username haystack and password of testpass to run the test. If you don't have SkySpark, then that test cannot be used. But unless you are hacking the Client code itself, that test is really just for myself

gada Alaloof Tue 7 Jan 2014

Thank you. I have some additional questions here:

So From my understanding I need to contact SkySpark to get a demo server so I can get some experience with the API . BTW:Do you know if that something that cost money ?

On java library you provide there is a servlet which build a database.I wanted to experiment with some GET requests so I did the following:

/nav

ver:"2.0" navId,id,area,dis,site,tz,geoState,geoAddr,geoCity "D",@D,4000ft²,"D",M,"New_York","MA","Boston,MA","Boston" "A",@A,1000ft²,"A",M,"New_York","VA","Richmond,VA","Richmond" "B",@B,2000ft²,"B",M,"New_York","VA","Richmond,VA","Richmond" "C",@C,3000ft²,"C",M,"New_York","DC","Washington,DC","Washington"

Then wanted to read a specific site data so i send a GET request like that : read?filter=@D

But got error :er:"2.0" dis:"java.lang.ClassCastException.

Am i doing somethong wrong ?

Brian Frank Tue 7 Jan 2014

So From my understanding I need to contact SkySpark to get a demo server so I can get some experience with the API

You do not need this. If you have access to Niagara, you can use nhaystack to test against that. Or if you have access to neither, then I would suggest just testing against the test server which sounds like you already have running.

Then wanted to read a specific site data so i send a GET request like that : read?filter=@D

The URI for that would be read?id=@D, you can also use filter such as id==@D, but sometimes escaping a URI in GET is tricky, and its easier to use a POST

gada Alaloof Tue 7 Jan 2014

Thank you for fast response.

One more question that I have and maybe you can help me:

If I'm suppose to read Power meter that are represented as Tree model (Where every meter could have a sub meter ) then will I get all meters in one call for a site and then using the subMeter tag can walk my way through ?

Say for example:

http://localhost/HServlet/read?filter=point will return with:

id:@A, dis: "Main Elec Meter", elecMeter, siteMeter, equip

dis: "Main Elec Meter Demand", elecKw, equipRef @A, point, ...
dis: "Main Elec Meter Consumption", elecKwh, equipRef:@A, point, ...

id:@B, dis: "Lights", equip, elecMeterLoad:@A, lightsGroup

dis: "Lights ZoneX", equipRef:@B, elecMeterLoad:@A, lights, point, ...
dis: "Lights ZoneY", equipRef:@B, elecMeterLoad:@A, lights, point, ...

id:@C, dis: "HVAC Elec Submeter", elecMeter, submeterOf:@A, equip

dis: "HVAC Elec Submeter Demand", elecKw, equipRef:@C, point, ...
dis: "HVAC Elec Submeter Consumption", elecKwh, equipRef:@C, point, ..

BTW:How difficult is to simulate such response on existing TestDatabasde class provided ?

Brian Frank Wed 8 Jan 2014

The test database is constructed in TestDatabase.java. It does not currently build out anything sophisticated such as a sub-meter tree. But you can modify TestDatabase.java to construct whatever you want your database to look like.

Login or Signup to reply.