WatchPower and connecting to Indigo via RS232

Ask questions about integrating other services (internet and otherwise) and applications with Indigo.
User avatar
mwoodage
Posts: 177
Joined: Fri Dec 19, 2014 8:35 am
Location: Devon UK

WatchPower and connecting to Indigo via RS232

Post by mwoodage »

Hi Everyone, i'm after some help please.
I've recently moved into the world of batteries and using them to power my house :D
Currently, i've bought some second hand fork lift truck batteries (24v) and have them connected to all the lighting in my house via a charge controller. It's working really well with the sun now powering all my lighting and hopefully some more electrical items later...... :lol:

However, and this is where i need some help, i've bought a charge controller (see links below), which works really well, but the interface software is not very good. I currently have it (WatchPower) working on an old PC with a COM port ,and i can see the usage of the batteries and power consumption on the PC, but i can't get it to work on my MAC.
There is a MAC version of WatchPower which only works on MACs up to 10.13, which is fine for my current setup, but i can't get it to work / connect to the charge controller. I'm using one of these USB to RS232 Serial adaptors, which is setup correctly and working. https://www.amazon.co.uk/gp/product/B00 ... UTF8&psc=1

So my question is, is there a way to connect RS232 to indigo without the WatchPower software so i can read the information coming from the charge controller? I could then take this info and produce a control page showing everything i need.
I'm assuming that i'll still need the USB to RS232 interface, but how do i see the information coming in from the charge controller?

Any help would be greatly appreciated,

Charge Controller - https://www.photonicuniverse.com/en/cat ... arger.html
Latest Software - http://www.mppsolar.com/manual/Watchpow ... 0(latest)/

Thanks
Martin
User avatar
matt (support)
Site Admin
Posts: 21476
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: WatchPower and connecting to Indigo via RS232

Post by matt (support) »

You would need to create a plugin that handles the RS232 communication with the WatchPower. That would require some python programming experience and the difficulty would range from medium to hard depending on the complexity of the RS232 protocol. Some protocols are pretty straightforward, but some can get very complicated (example: the API Indigo uses to communicate with an Insteon PowerLinc or Z-Stick is a ton of work). I glanced at the manual and and didn't see any information about the API. They may or may not have it publicly available.
Image
User avatar
mwoodage
Posts: 177
Joined: Fri Dec 19, 2014 8:35 am
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

Post by mwoodage »

Hi Matt,
thank you for your response, sounds like it's a bit beyond my capabilities! I have basic skills but writing a plugin is a bit over my head!!

thanks again
Martin
User avatar
mwoodage
Posts: 177
Joined: Fri Dec 19, 2014 8:35 am
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

Post by mwoodage »

Hello again, I need a bit of help from someone that's way cleverer than me!

Since my last post i've now bought one of these to go with my Inverter......
https://www.photonicuniverse.com/en/cat ... ation.html

I'm now able to see the data being transferred on my wifi network and with a bit of playing around with Wireshark, i've managed to extract the following info:-
Am I able to use this with either Ghost XLM or Cynical Network to extract the data into Indigo? If so, how? Or do i still need to write a plugin like Matt said before?

Basically, what i'm trying to do is get the battery info to show up on a control page and also use the info to trigger events.

Thanks
Martin
Attachments
Screenshot 2020-02-04 at 17.31.01.png
Screenshot 2020-02-04 at 17.31.01.png (265.83 KiB) Viewed 5826 times
Screenshot 2020-02-04 at 17.21.09.png
Screenshot 2020-02-04 at 17.21.09.png (383.27 KiB) Viewed 5826 times
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: WatchPower and connecting to Indigo via RS232

Post by howartp »

GhostXML pointing at the /realInfo.json URL should be a good start.


Sent from my iPhone using Tapatalk Pro
User avatar
mwoodage
Posts: 177
Joined: Fri Dec 19, 2014 8:35 am
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

Post by mwoodage »

Hi Howartp,
Thanks for the reply, i've tried using http://realInfo.json/ in Ghost XML but get the following reply, i've also tried various other variations of the same thing but no joy.


GhostXML Debug [Ghost XML] Communication started.
GhostXML Ghost XML
GhostXML Debug HTTPS CURL result: * Rebuilt URL to: http://realInfo.json/
* Could not resolve host: realInfo.json
* Closing connection 0

GhostXML Debug ReturnCode: 6
GhostXML Warning [Ghost XML] curl error * Rebuilt URL to: http://realInfo.json/ * Could not resolve host: realInfo.json * Closing connection 0 . [Return code: 6
GhostXML Debug [Ghost XML] Parse Error: No JSON object could be decoded
GhostXML Debug [Ghost XML] jsonRawData
GhostXML Warning There was a parse error. Will continue to poll.

Also, do i need to be using Ghost XLM Device (String Type) or (Real Type) - i've tried both but get the same answer.

Thanks in advance,
Martin
User avatar
DaveL17
Posts: 6884
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: WatchPower and connecting to Indigo via RS232

Post by DaveL17 »

I suspect that http://realInfo.json/ is not a valid resource on your network--and your router can't resolve that address to anything. Typically, the plugin expects a URL/URI that reconciles to something that you could retrieve with a web browser (whether credentials are required or not) -- like http://192.168.1.178/realinfo.json or something like that. A quick inspection of the device you linked to looks like it's sending emails--can you log directly into that device to see data on the connected appliance?

The choice between the two different GhostXML device types is simply to determine whether the resulting data is returned to Indigo as all strings or its "true" type.
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
User avatar
mwoodage
Posts: 177
Joined: Fri Dec 19, 2014 8:35 am
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

Post by mwoodage »

Thanks Dave,
Using http://192.168.1.178/realinfo.json has brought some success :D - Ghost XML now reports that its connected and updated. I've turned on Debug and get the following:-

GhostXML Debug HTTPS CURL result: * Trying 192.168.1.178...
* TCP_NODELAY set
* Connected to 192.168.1.178 (192.168.1.178) port 80 (#0)
> GET /realinfo.json HTTP/1.1
> Host: 192.168.1.178
> User-Agent: curl/7.54.0
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server:WebServer V1.0
< Content-Type:application/json
<
{ [170 bytes data]
* Closing connection 0

Excuse my inexperience with this :roll: ,but once it's connected, where does the information go? Should i see info coming back in the log?

Regarding the device, its not sending email directly. You sign up for a service called DataCentre http://power-datacenter.com which connects to the device I have and gathers the data to display in the following format. It's this info that i want to collect so i can show it on a control page and also use the info to trigger events.

Cheers
Martin
Attachments
Screenshot 2020-02-05 at 17.50.34.png
Screenshot 2020-02-05 at 17.50.34.png (372.13 KiB) Viewed 5732 times
User avatar
DaveL17
Posts: 6884
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: WatchPower and connecting to Indigo via RS232

Post by DaveL17 »

Glad to hear that you're making progress. The details that are returned in the JSON call are stored in custom device states. You can find those below the device view pane in Indigo's interface.
Screen Shot 2020-02-05 at 12.30.24 PM.png
Screen Shot 2020-02-05 at 12.30.24 PM.png (29.67 KiB) Viewed 5720 times
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
User avatar
mwoodage
Posts: 177
Joined: Fri Dec 19, 2014 8:35 am
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

Post by mwoodage »

Ah ok, so i'm not getting anything back, does that mean its not working?
Attachments
Screenshot 2020-02-05 at 18.47.40.png
Screenshot 2020-02-05 at 18.47.40.png (499.52 KiB) Viewed 5711 times
User avatar
DaveL17
Posts: 6884
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: WatchPower and connecting to Indigo via RS232

Post by DaveL17 »

Are you sure that nothing's coming back? Put your cursor in the pane where the device details panel is and try to scroll. Even if you get nothing back from the source, there should still be some standard states that are created by the plugin that should be available. Another way to check is to go to the control page builder and select the device states there.
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
User avatar
mwoodage
Posts: 177
Joined: Fri Dec 19, 2014 8:35 am
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

Post by mwoodage »

Ok, i've got the following coming back - this gives me the basic info, but its not providing any of the useful data like battery charge or capacity.
Any ideas?
Attachments
Screenshot 2020-02-05 at 19.59.41.png
Screenshot 2020-02-05 at 19.59.41.png (141.28 KiB) Viewed 5704 times
Screenshot 2020-02-05 at 19.50.15.png
Screenshot 2020-02-05 at 19.50.15.png (55.79 KiB) Viewed 5704 times
User avatar
DaveL17
Posts: 6884
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: WatchPower and connecting to Indigo via RS232

Post by DaveL17 »

That's progress. What's displayed includes the information that you showed above in your Wireshark post. There are only four data points there and neither battery charge or capacity are shown, which leads me to believe that they're available in another JSON payload or just not available. You'll need to do some more detective work to capture the data you want so that we know where to look for it.
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
User avatar
mwoodage
Posts: 177
Joined: Fri Dec 19, 2014 8:35 am
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

Post by mwoodage »

Thanks Dave, that all sounds good - i'll have another look tomorrow and let you know what i find. Thank you for your help so far :D

Martin
User avatar
mwoodage
Posts: 177
Joined: Fri Dec 19, 2014 8:35 am
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

Post by mwoodage »

Hi Dave,
I've looked again at the feed on Wireshark and found the following. This gives all the data that i've been looking for :D
However i've tried to put in the cmc/getMachineInfo.html into Ghost XML and just get an error. Is that because its a POST request rather than a GET request?

If you can point me in the right direction once more that would be appreciated, Unfortunately i'm off on holiday for a week tomorrow so won't be able to play until i get back :(
Attachments
Screenshot 2020-02-06 at 20.54.43.png
Screenshot 2020-02-06 at 20.54.43.png (479.06 KiB) Viewed 5625 times
Post Reply

Return to “Integrating Services/Applications”