WatchPower and connecting to Indigo via RS232

Posted on
Mon Jan 20, 2020 11:14 am
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

WatchPower and connecting to Indigo via RS232

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/B00425S1H8/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=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/catalog/full/393-Iconica-3000W-24V-hybrid-pure-sine-wave-inverter-with-50A-solar-charge-controller-and-25A-mains-battery-charger.html
Latest Software - http://www.mppsolar.com/manual/Watchpower%20(off-grid)/WatchPower%20v1.13SP3%20(latest)/

Thanks
Martin

Posted on
Mon Jan 20, 2020 12:24 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: WatchPower and connecting to Indigo via RS232

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

Posted on
Mon Jan 20, 2020 3:34 pm
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

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

Posted on
Tue Feb 04, 2020 11:36 am
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

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/catalog/full/411-Wi-Fi-Remote-monitoring-kit-for-Iconica-hybrid-inverters-with-Email-communication.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 5101 times
Screenshot 2020-02-04 at 17.21.09.png
Screenshot 2020-02-04 at 17.21.09.png (383.27 KiB) Viewed 5101 times

Posted on
Tue Feb 04, 2020 5:09 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: WatchPower and connecting to Indigo via RS232

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


Sent from my iPhone using Tapatalk Pro

Posted on
Wed Feb 05, 2020 9:52 am
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

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

Posted on
Wed Feb 05, 2020 10:23 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WatchPower and connecting to Indigo via RS232

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]

Posted on
Wed Feb 05, 2020 11:53 am
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

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 5007 times

Posted on
Wed Feb 05, 2020 12:31 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WatchPower and connecting to Indigo via RS232

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 4995 times

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed Feb 05, 2020 12:48 pm
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

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 4986 times

Posted on
Wed Feb 05, 2020 1:19 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WatchPower and connecting to Indigo via RS232

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]

Posted on
Wed Feb 05, 2020 2:01 pm
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

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 4979 times
Screenshot 2020-02-05 at 19.50.15.png
Screenshot 2020-02-05 at 19.50.15.png (55.79 KiB) Viewed 4979 times

Posted on
Wed Feb 05, 2020 2:33 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WatchPower and connecting to Indigo via RS232

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]

Posted on
Wed Feb 05, 2020 4:00 pm
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

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

Posted on
Thu Feb 06, 2020 3:02 pm
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

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 4900 times

Who is online

Users browsing this forum: No registered users and 2 guests