WatchPower and connecting to Indigo via RS232

Posted on
Thu Feb 06, 2020 3:23 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WatchPower and connecting to Indigo via RS232

Unfortunately, the GhostXML plugin doesn't parse html output. If you can find a URL that provides the same data as an XML or JSON file, you would be in business.

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

[My Plugins] - [My Forums]

Posted on
Thu Feb 06, 2020 3:50 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: WatchPower and connecting to Indigo via RS232

mwoodage wrote:
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?


Looks like you're going to need to use the Raw Curl authentication method so you can do a POST with the payload (which is the serialNumber and protocol).

See the example at https://github.com/IndigoDomotics/GhostXML/wiki/devices

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Feb 06, 2020 3:56 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: WatchPower and connecting to Indigo via RS232

DaveL17 wrote:
Unfortunately, the GhostXML plugin doesn't parse html output. If you can find a URL that provides the same data as an XML or JSON file, you would be in business.


I didn't see any HTML in that last Wireshark capture.

Looks to me like this would work:

Code: Select all
curl -X POST -d "serialNo=XXX&protocol=30" http://<IP address>/cmc/getMachineInfo.html?random=<that long string>"

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

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

Re: WatchPower and connecting to Indigo via RS232

Thanks Dave and Flying Diver for your comments. I'll take a quick look at this tomorrow morning before i'm off, but i'm going to have to wait a week before I can get back on it.

Just out of interest, where do i put
curl -X POST -d "serialNo=XXX&protocol=30" http://<IP address>/cmc/getMachineInfo.html?random=<that long string>"

does that go in Ghost XML? I'm a bit of a novice at this so you might need to help me out! :lol:

Posted on
Thu Feb 06, 2020 5:09 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: WatchPower and connecting to Indigo via RS232

First, try it out in a terminal window and see if you get JSON content back. Make sure you put in the correct info where I put placeholders.

If that works, then it goes in GhostXML per the instructions in my previous post.

At this point, you need to be using curl commands to test out what you think will work, since you've gotten about all you can from WireShark.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Feb 07, 2020 6:14 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WatchPower and connecting to Indigo via RS232

FlyingDiver wrote:
I didn't see any HTML in that last Wireshark capture.

I was looking at the URL in the POST, but you're right--there doesn't seem to be any HTML in the body.

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

[My Plugins] - [My Forums]

Posted on
Fri Feb 14, 2020 10:48 am
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

Hi Dave, Joe,
I'm back from holiday so thought i'd give this another go - i've managed to capture loads more information from Wireshark that i'll PM you as a separate file, as it's to large to put on here. Looking through it my guess is that this needs a plugin rather than just something you can call up via Ghost XML, am i correct? I'm no way experienced enough to write a plugin, so this might be the end of the road for this little project :cry:

Let me know what you think regarding the info i've sent to you,

Thanks again for all your help so far,
Martin

Posted on
Fri Feb 14, 2020 11:13 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: WatchPower and connecting to Indigo via RS232

Hi Martin -- have responded to the PM.

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

[My Plugins] - [My Forums]

Posted on
Tue Mar 17, 2020 11:48 am
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

Hello,
Following on from my last post, i've spent the last few weeks trying out different things and puling my hair out in the process. I then found that my inverter is also know under a different name (Axpert) which brought up a whole load of things on Git Hub for me to try.
And, success (sort of) i can now, with the help of MMP-Solar and a Raspberry Pi, talk to my inverter :lol:
https://github.com/jblance/mpp-solar

So, now i've managed to get it talking to the Raspberry pi, i'm now trying to use MQTT to transmit the data across to Indigo. I've downloaded Flying Divers Indigo MQTT plugin, but just don't have the experience or knowledge to join the two together. I'm hoping someone can help me with this bit please :)

I have managed to get the Indigo MQTT plug in connected to the Raspberry Pi, so have had some success. See the screen shot below.

Thanks in advance for any help you can give, please remember that i know very little about coding or MQTT - but i'm learning fast.......

Martin
Attachments
Screenshot 2020-03-17 at 17.44.13.png
Screenshot 2020-03-17 at 17.44.13.png (47.81 KiB) Viewed 3808 times
Screenshot 2020-03-17 at 17.35.52.png
Screenshot 2020-03-17 at 17.35.52.png (506.82 KiB) Viewed 3808 times

Posted on
Sun Mar 29, 2020 6:58 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'm nearly there for this project! I've spend days trying to get it working and finally getting some results! I've had some great help from the chap on Github who wrote the code for the inverter, https://github.com/jblance/mpp-solar/issues/10 but I need some help on what to do with the MQTT plugin.

This is what i've got so far:-

1, I've got communication between the Mosquito broker on the raspberry pi and Indigo / MQTT plugin,
2, I can post all the data from my inverter via MQTT and see it on the network, (see the screen shot below)
3, I've managed to get some success with displaying on a control page, i've got this working with one payload but can't figure out how to add additional payloads and where they appear on a control page.

What i'm struggling with is what to put into the MQTT plugin to receive the data?

These are the things i'm confused about.

1, For a topic, if i add 92331809100013/status/battery_capacity/value to the Device section under Topic Subscriptions (see screen shot below) i can have this data showing on a control page, but if i add any more topics they don't appear in the device state, i just get Status and two Topics?
2, I'm assuming i need to add each line of code as a separate topic, but where do i add these?

Any help would be great, thanks
Martin
Attachments
Screenshot 2020-03-28 at 18.04.06.png
Control Page Output
Screenshot 2020-03-28 at 18.04.06.png (31.43 KiB) Viewed 3735 times
Screenshot 2020-03-28 at 17.47.47.png
Control Page
Screenshot 2020-03-28 at 17.47.47.png (38.64 KiB) Viewed 3735 times
Screenshot 2020-03-28 at 17.39.02.png
Topic Subscriptions
Screenshot 2020-03-28 at 17.39.02.png (88.57 KiB) Viewed 3735 times
Screenshot 2020-03-28 at 17.14.07.png
Posting data from the raspberry pi
Screenshot 2020-03-28 at 17.14.07.png (486.37 KiB) Viewed 3735 times

Posted on
Sun Mar 29, 2020 7:53 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: WatchPower and connecting to Indigo via RS232

At this point, you really need to move this discussion to the MQTT plugin forum (viewforum.php?f=316), since you're dealing solely with MQTT. But I'll give you a couple of tips to get started.

1. The MQTT Connector device states only show the LAST message information (topic and payload). You should not be trying to connect control pages to the connector device states.

2. The mpp-solar library's mpp-info-pub command that I think you're using to publish the messages from the rPi is very poorly designed, in that it doesn't give you any control over the format of the topic message. And the topic it uses starts with the device number, so you can't use any leading components to identify messages from the device. But that's not a deal breaker. Since you want ALL messages from that device, just use "92331809100013/status/#" as your (only) topic subscription. The '#' is the MQTT wildcard.

3. Since you want to "save" the device messages for use on a control page, you need to use an MQTT Shim device to save them. I think you're going to need a Shim for each value you want to display, since they're all coming in with distinct Topics. It would have been better if your publish command sent all the values in one payload as a JSON string. If it was me, I'd rewrite that code. But if you're not a programmer, then that might be beyond you.

Read the Wiki for the Shim devices here: https://github.com/FlyingDiver/Indigo-S ... asic-Setup
Then read the threads on using Shims here: viewtopic.php?f=316&t=22783

Then post any follow up questions in the MQTT forum (above).

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Mar 29, 2020 8:12 am
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

Thanks I'll give that a try. I had installed MQTT Shims but didn't know if this was the right thing to be using.

I'll close this thread for now and ask any further questions on the MQTT thread,

Thanks
Martin

Posted on
Sun Mar 29, 2020 8:16 am
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: WatchPower and connecting to Indigo via RS232

Alternatively, you could use an MQTT Connector trigger event and copy the payload state into an Indigo variable. You would need a trigger for each value (variable) you want to maintain. Simpler than using Shim devices. Shim devices are actually a little overkill for your application.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Mar 30, 2020 4:31 am
mwoodage offline
User avatar
Posts: 174
Joined: Dec 19, 2014
Location: Devon UK

Re: WatchPower and connecting to Indigo via RS232

OMG - i've finally got this working :D . It's taken months of playing around with different things but I can now finally show the solar battery information on a control page.
Thanks for everyones help on this and to Flyingdiver for writing the MTQQ plugin that's meant I can get the info I want from the battery inverter.

If anyone else need help on this for a Battery inverter with an MPP Solar Inverter then i should be able to help!

Thanks all,
Martin

Who is online

Users browsing this forum: No registered users and 3 guests