I use Loxone as my home automation system, and that has a lot of inbuilt load management and load sharing 'blocks' and can control anything I can chuck into it really. Id be looking at mainly battery status of charge, current usage, current information coming from solar etc etc.
Has anybody done this with loxone? if so how easy is it to pull information from the inverters and batteries to put that into loxone itself?
I'm no expert when it comes to API's/programming etc. but normally can follow along easy enough once I get the hang of it.
Any direction would be greatly appreciated
Integrating With Loxone

I'm right in the middle of re-writing this guide but I think it's got enough to get you started?
hoggy
Errr yeah maybe 😆
A lot of computer tech talk in there, but will try and have a look through and see what I can come up with.
Pity the systems don't have a direct IP address (maybe future ones will) or direct modbus registers. That would be so much easier 😄

DeanoC75 theres also GivTCP but again you need to be able to request the data simialr to the API (unless Loxone can deal with MQTT, i dont know if it can)
DeanoC75 I would have preferred modbus - but it was felt by givenergy to be too complicated for most as there are often many commands required to carry out some functions and the risk that it would break something.
The other advantage of using an API is that there (should be) is only one master on the network so it avoids clashes on the network.
I have had GIVTcp poling the system as well as the app on two different devices and the online portal with no obvious issues.
hoggy Loxone cant deal with MQTT at the moment as far as I'm aware. There is workarounds by using a raspberry Pi using "loxberry".
Loxone tends to keep products compatible with its own programming as it doesn't want a 3rd party software allowing access to your own system as that could lead to all sorts of issues if it gets hacked. One of the basic examples is alexa, people want to integrate it, but you have to connect through the cloud to integrate it and don't want that risk.
It will allow to poll commands and webpage data etc.
anglefire Modbus read only registers would of been much better 😄
Apparently givtcp is reading modbus over IP, "This project allows connection to the GivEnergy invertors via TCP Modbus". I wonder if there is a way to convert it back to a serial? (Presume that's what loxone needs)

jd the modbus registers and what they do won’t be forthcoming from GE I’m afraid (under lock and key)
The determined can no doubt work back GivTCP I guess but your risk. I doubt GE would entertain warranty if you roast your inverter through meddling.
You can speak to the EM115 meter directly but that only gets you the stuff the meter sees, not the battery %.
I’ve never looked into it but I guess there must be such a device that could take the outputs from GivTCP/API from say an RaspberryPi and dish them out over modbus that could sit in the middle?
Edit: yes you can by rs485/modbus add on hats for the rpi.
Tim Just had a quick look at that link, and ill have a read into a little bit later on, I use virtual inputs/outputs for various things, but you need an actual IP address to reference the commands from/to etc.
As i say ill have a good look into it. Thanks for sharing that link
jd Loxone can take any commands HTTP and uses virtual inputs/outputs to handle these, and they also do various add on extensions, so they do a Modbus, serial RS232 RS485 etc etc which are not an issue to communicate with, its what data needs to be pulled and where from to give you the inputs/outputs which are required to allow programming.
Loxone itself has a really good integration with all this stuff, and some inverters work natively with the software pulling the information from either an IP or modbus source.
If set up correctly it can control all the likes of your EV chargers, load sharing etc etc very very easily.
hoggy Yeah i guessed you can get any hat for a Pi. I originally had a Pi with a USB RS485 converter to pull information for a modbus meter and worked inbetween for testing purposes.
Ill have a look into the GivTCP, is it just done through a search or is it somewhere online?
DeanoC75 The package is maintained by @Britkat . It seems that either it just works for you, or you need to tickle it a bit (as I did), but it's working for me now. I don't use it for control, just for monitoring. You do need to know your inverter IP, or host name (whichever responds with "ping") whereas the GivEnergy APIs just use URLs.
Tim Thanks for that, ill have a look into it 😃
hoggy that’s what I’m doing as my heating controller doesn’t support api calls - or at least the version I have doesn’t/isn’t licenced to do so.
So I just created a slave device in the controller and send the modbus to it from the rpi/node red.

anglefire good to know. Although i have a few rpi's scattered around ive never really gone down that route with them. (I do however relive my youth with Sega and Nintendo emualtors on them instead!)
I run home assistant in a docker on the rpi 4 (booted off a ssd) together with GivTcp and everything else.
I do have 3 other rpi’s running ubiquiti software to manage the network and two others running Pi-hole for DNS and other odds and sods.
Don’t have time for games - not really played them for a long long time!
Frustration alert, after several attempts of trying to following instructions, numerous swearing at screens and wondering WTF am i doing wrong, i just can't seem to get the likes of the GivTCP/docker working, its coming up with loads of errors and all sorts.
I'm working my way through the GE API guide and I'm getting things to pull information, but I haven't got a clue, how I can make that into a URL to pull that information I require.
Where am i going wrong? can anybody help me in the right direction?
Any examples of a correctly formatted URL to pull certain information eg inverter temperature, or status of charge of the battery, current usage etc etc?
I'm about to pull what's left of my hair out 😃
Thanks
hoggy I've tried to follow the guide and using your examples, but windows is blocking scripts been run on my PC for some reason using the power shell ?
EDIT - I've now sorted the security settings of the machine sorted and now can run the scripts. 😃

hoggy I didn't see that guide, ill try again with that to see what happens, i've deleted it all as it was doing my head in really.
I still haven't got it working fully as I gave up,

DeanoC75 I did build a little script that should set it all up for you (link is in the guide) although from what I’m seeing from others I think the Dongle MAC may have changed at some point (newer inverters) so it might fail on trying to find the inverter for you if yours is relatively new install.
Worth a go I guess.
hoggy
I managed to get something scrolling through on docker and managed to see the 'run all' data using your guide, however I just don't know how to pull out data for what I need.??!!
Hoggy, I'm just thinking. I think the URL would be the best way for me to move forward.
I can stipulate in the Loxone software the polling cycles, so I can go from 1 second to 1000 seconds if required to pull the information, so I think it would be better for the GE API integration.
Just need to work through the API and see what I need to pull, and try and work out a typical URL for the information I need to push into Loxone.
I don't think i'll need to write any information, it will only be read only

Whichever output you use (API or GivTCP (runALL) spits out JSON data.
Provided Loxome has a way for you to call up the URL that gives you the data, then you presumably need to specify which bits via DOT notation.
If you copy paste the output from whichever source your using into that JSONPathFinder page in the guide I did for the API then you should be able to isolate the “path” to the parts you want to use and ignore the rest.
hoggy Hoggy, yeah Loxone has 'Virtual Inputs/outputs' where you specifiy the web address/command you can want to use.
Excuse my non programming knowledge, but the dot notation would you just replace the dots with the slashes?

DeanoC75 So looking at the Loxome doc you linked it doesn't sound like it supports "Bearer" authentication which may mean your out of luck with trying to put your API key into the URL and using the normal API.
You should have some joy by running GIVTCP and pointing the Loxone Virtual Input to IP_OF_DEVICE_RUNNING_GIVTCP:6345/runAll - which would allow it to "see" the GIVTCP page like you do.
This should work as GIVTCP doesn't have any authentication as it's all running locally, so no username/password needed
e.g: http://192.168.1.200:6345/runAll
From what i gather it then looks like the virtual Input acts like a simple "find text" / screen scraper. Where you tell it to look for a keyword in the page and then it retrieves the value after the key word? (In their example they use value="\v ) which would allude to it then retrieving the next number it sees after it finds that text which in the example is 5.0. You wouldn't need to use Dot notation at all.
Given the output from GivTCP RunAll is all unique, in theory I guess all you need to use is something like:
"SOC":\v which given there is only one line where "SOC" gets mentioned in GiVTCP should pull in the battery SOC value? (I'm unsure how Loxone's scraper thing handles spaces, it may need to be "SOC": \v, to take the spaces into account?
other test would be "Battery Power": \v
Hoggy, i'm keep getting loads of new client connected, and then <client unknown> closed connection alerts in the docker window, is that normal?
And thanks for the reply above, however once I put the web address in for the run all into Loxone it's coming up with an error and no connections.
I so wish this had direct modbus connections ;-)
Mind you i can see there is a modbus address on the run all, but this would be for the meter I presume.
DeanoC75 The client connected then client closed connection logs show that something is connecting to the MQTT broker in your giv_tcp container, then disconnecting shortly after. If you're not using MQTT then it's unlikely to be a problem. if you are, then this could be valid - the client connects to publish a single data chunk then disconnects. It could be that it shows a problem, I don't know the specifics. If it is valid and the publishes are happening frequently, I'd certainly encourage the client to change to maintaining its connection rather than disconnecting each time.

DeanoC75 which web address are you giving it, if it’s the 127.0.0…. One then it won’t see it (that’s basically just geek for “the PC I’m on right now)
you’ll need to use the actual IP of the PC your currently using to run Docker on (think I run through that on the GivTCP guide but can’t remember off top of my head)
If it’s windows then you might also need to let docker through the firewall.
If you can get to the IP of your machine to the runALL page from another machine on the same network then your Loxome should as well (unless it’s on another network / Wi-Fi entirely)

hoggy and yes mines full of open / close connections. It runs fine. If you pummel it for updates every 10 seconds it can get a bit hit and miss, 20 seems OK for me but they are working on getting it down to 5 sec.
This Loxome doesn’t seem to support MQTT so I’d just ignore it
Hoggy, i've got docker installed on this laptop so the 127.0.0 address works fine, i've just done an IP scan on my network and i have a mention to docker address and tried to run that address in the web browswer and thats not working.
Wish i was a bit more up with the programming side of it all, and its going out the window very soon.
Probably with a 5.2 battery and 5.0kw inverter also :-(

DeanoC75 did you put the :6345 but at the end of the IP address?
You should even be able to pull up the GivTCP runAll page from your mobile if it's fully accessible across your home WiFi which would be a good test.
I know how frustrating it can be. Took me ages to track down why my Docker refused to talk
Yeah i put the :6345/runAll and nothing. Nothing from mobile either
@hoggy thanks for all the help, with a clear mind today and a little help from Loxone support, i've managed to get it running today from another PC, i was hoping to get it run on a Rpi, but ran into a few issues so went onto another PC and have pulled a lot of information from the docker GivTCP into loxone. Think i'm pulling 60 items through to get data from, however i wont be using them all, but its still good to see the information ;-)
There is quite a noticeable difference between the information supplied to the app, and what's coming off the inverter.
I've set the polling cycle for Loxone to pull all information every 10 seconds, similar to the app, so getting good data through.
Once again thanks

DeanoC75 glad to hear youve got it sorted and getting fast updates.
Now it's proven it should hopefully be fairly easy to transition to rpi by changing the IP address.
It may be of use to other users at some point if you do a little write up of how its done (atleast the getting the value parts into the system with the whole \v thing, unless i guessed right!)
I think your the first Loxone user but im sure there will be more out there and this would likely be the only post that shows up in a search.
@hoggy yeah you were not far off, the string value is \i"Battery_SOC": \i\v for an example, however on the run all, there is a space in between the information, so that had to be included also.
Speaking to the partner tech team at Loxone, they said they have had a couple of people enquire about the integration between the two and this is probably the simple way of doing it at the moment, but if they get a few requests they may look into it further, so who knows.
Just need to get docker installed onto a pi now, then away we go.
Yeah i can probably do a quick guide/write up, and i've saved the config as a template with all points what i think is relevant information that needs to be pulled (currently 65 items). It comes up pretty well on the Loxone app also with a bit of tinkering. ;-)

DeanoC75 That's good to hear they are considering it. I guess it would be better if they did get some interest, to be bi-directional so the Loxone Kit can adjust the Givenergy side (stop battery discharge if charging car or something like that) or just to the point where you have everything in their App rather than flicking from one to the other.
hoggy I don't think they will support it natively as there would have to be a huge demand for it for them to develop the integration. I guess it will depend on if GE helps with certain aspects of it also and maybe change coding etc which I doubt it will.
There is various 'function blocks' you can use and if you can create your own custom logic in the config software, anything is possible to achieve, it just depends on how you get that command to where it needs to go.
We shall see.