Loxone anyone?

Hello,

I have weird problem - not sure if this is binding problem, Miniserver problem or I did something wrong in configuration.
My setup:

  • OpenHab 2.5.2 running on Rock64
  • Loxone Miniserver Gen. 2.

After adding new Thing everything is working fine for couple minutes I can control Loxone through OpenHab.

After some time in Thing configuration I can see that Host has changed to:

192-168-xxx-xxx.504Fxxxxxxxx.dyndns.loxonecloud.com

Port changed to

-1.

Above host name is new feature introduced recently - this is cloud connection to Loxone without need of port forwarding, this is only available for Miniserver Gen 2, unfortunately even when Remote Connection is disabled in Miniserver Thing gets updated anyway.

Is there any chance to block Thing autoupdate or force Thing to keep settings? Do I need to change something in Miniserver configuration?

I’ve tried with old .things but I fail with .items :-/

Thanks,
Maciej

Hi Maciej. I have never seen the thing to update automatically. Did you create the thing manually using the paper UI or added it from the Inbox?

Hi Pawel, I’ve added it manually from Paper UI. I will try again with automatic.

I thought the automatic would have explained it somehow. But if you add it manually and later it gets changed, this is somewhat mysterious. There is no method to initiate it from the Miniserver to the binding. Maybe through the discovery mechanism, but how would that reach the thing, if it is manually created, it should not interfere with it. It would be great to track that scenario and see what exactly happens. Maybe you have some logs with debug level from around when the port gets changed?

No problem, I can get some logs, which packages should I switch to DEBUG log level?

Hi Guys, relatively new to OH but have some experience with Loxone having setup my main house and a second house. I am currently learning OH and have a setup and a Raspberry Pi 3. Currently I have installed the Tesla Powerwall Binding and the Loxone Binding and am receiving data from both. Good Start. My goal is to be able to pass data from the Tesla Powerwall to the Loxone system. Loxone currently doesn’t support REST over HTTPS with self signed certificated hence the need for the Pi with OH to do this and pass the data along.

I am however getting hung up trying to write the rule to do this. I’ll provide as much detail as possible and would be ever great full if someone can point me in the right direction.

In Loxone I have setup a Virtual input called PiBatterySOE. I have items defined in OH from the Bindings as:

Number:Dimensionless TeslaPowerwallBatterysoe //reads from the Tesla Binding
Number:Dimensionless PiBatterySOE “Whole house / pi battery soe” //from the Loxone Binding

I have a rule then defined as follows:

rule “update Loxone Battery SOE”
when
Item TeslaPowerwall_BatterySOE changed
then
PiBatterySOE.sendCommand(TeslaPowerwall_BatterySOE)
end

I however get an error “Type mismatch: cannot convert from NumberItem to Command”.

Any advise appreciated!

Cheers, Shane

Try sending TeslaPowerwall_BatterySOE.state

1 Like

Thanks for the quick response. I now instead get the error “Cannot convert from State to Command.” The updated code looks like:

//This rule will run everytime Grid power changes or 1 / second
rule “update Loxone Battery SOE”
when
Item TeslaPowerwall_BatterySOE changed or
Time cron “0/5 0 0 ? * * *” or
System started
then
PiBatterySOE.sendCommand(TeslaPowerwall_BatterySOE.state)
end

OK. thanks for the help so far. I have found my problem and of course it was as simple as a syntax error in my item name. So now I have no compile time errors and I have a dummy variable updating correctly so my rule is working now. One step forward. The linked value through to loxone is updating in openhab now correctly on PaperUI and values are importing correctly from Loxone. I still can’t seem to get data to go in the other direction however. any tricks to this? Like I said before, I have created a Virtual Input in Loxone called PiBatterySOE. The only change I have made in Loxone is to uncheck “Use as a digital input” as I am expecting a number not a Boolean value. I have also defined this linked item in OH as a “Number”. What else do I need to do or check? My updated rule FYI is:

when
Item TeslaPowerwallBatterysoe received update
then
PiBatterySOE.postUpdate(TeslaPowerwallBatterysoe.state)
end

and
 don’t know if this will work but here is the loxone image pasted in:

Fixed. Perseverance. Ok so I learnt a few things in the process. The main one being that you can’t have your source item defined like Number:Power it can only be Number.

Once I changed the source number to be just a Number, and the Loxone linked item also to be just a Number it all works. Also had to change to sendCommand from postUpdate. Final code looks like:

 rule "update Loxone Battery SOE"

when 
    Item TeslaPowerwall_InstanteousBatteryPower received update
then 
    PiBatterySOE.sendCommand(TeslaPowerwallBatterysoe.state as Number) 
end
2 Likes

I am having similar trouble with my Gen2 miniserver. Did you find a way to block the configuration from updating to the junk address and port? Like you I have my miniserver configured as a manual thing, because I thought this issue could have been related to creation through the PaperUI. However here it happened again with it being an unmanaged thing.

Unfortunately my log did not catch anything in it related to the reconfiguration. I may not have the log level set deep enough to capture anything useful though.

Can you please set the log level to debug - login to the openHAB cli and give command: log set DEBUG org.openhab.binding.loxone
It does not happen with my installation. I need to find out how it may happen that the thing changes these parameters automatically.
Thanks

Hello,

I think I figured this out - this bug is due to automatic discovery (as suggested by @ppieczul before).
You need to remove thing, add it manually through Configuration -> Things -> + -> Loxone Binding.
And do not press Add in Inbox - this will mess up your configuration. [Update]

@ppieczul
We can play around with automatic discovery - I’m ok to break some things in my config :wink:

[Update]
I’ve tried again with Automatic discovery - Loxone Thing was ok even after long time.
The only thing that was changed since then is Loxone firmware.

Best regards,

This morning I changed the log level, and rebooted OpenHAB. Upon boot the Loxone information was correct, but after 3 minutes I saw a log entry pop up. Here is the log entry.

==> /var/log/openhab2/openhab.log <==
2020-05-03 12:30:11.122 [DEBUG] [xone.internal.LxDiscoveryParticipant] - Creating discovery result for serial xxxxxxxxxxxx label Miniserver @ 192-168-XX-XX.xxxxxxxxxxxx.dyndns.loxonecloud.com port -1
2020-05-03 12:30:11.122 [WARN ] [mon.registry.AbstractManagedProvider] - Could not update element with key loxone:miniserver:xxxxxxxxxxxx in ManagedThingProvider, because it does not exists.
2020-05-03 12:30:50.070 [DEBUG] [.binding.loxone.internal.LxWebSocket] - [1] Sending unencrypted string: keepalive
2020-05-03 12:30:50.071 [DEBUG] [ding.loxone.internal.LxServerHandler] - [1] Sleeping for 240 seconds.

@xeroiv
What is your Loxone firmware version? Are you running latest 11.0.4.29 version?

@xeroiv is that when you have thing created manually or through inbox? I suppose manually, because the discovery did not find the thing ID.
Do you know why Loxone introduces itself through the discovery mechanism with the remote address?

@maciejt it would be cool to debug more what data is provided in the discovery update. Maybe this is an update that does not change the IP but amends it with a new one. Do you have any means of tracing that message? Like wireshark? I will try to look at the code and see if there are any traces in the upnp module or if I can add some traces to dump the structures when discovery happened.

@maciejt
I am using Config Version 11, Firmware Version - 11.0.4.29

@ppieczul
I have tried it both ways. Initially I had created the thing through the inbox, but when this issue popped up I deleted it and recreated through a things file. I do not know why it introduces itself through the remote address, but the new firmware apparently introduced a new feature related to remote connections which doesn’t require port forwarding to be setup. It may have something to do with that.

@ppieczul
I will try to run wireshark, but I need to modify my network a bit :slight_smile:
Maybe wireshark straight from my OpenHAB box will do the job.

Debug log:

2020-05-04 12:24:32.338 [DEBUG] [ding.loxone.internal.LxServerHandler] - [14] Disposing of thing
2020-05-04 12:24:32.339 [DEBUG] [al.LxDynamicStateDescriptionProvider] - Removing all state descriptions
2020-05-04 12:24:32.340 [DEBUG] [ding.loxone.internal.LxServerHandler] - [14] Thread interrupted
2020-05-04 12:24:32.341 [DEBUG] [ding.loxone.internal.LxServerHandler] - [14] disconnect the websocket: OK, Thing is going down.
2020-05-04 12:24:32.342 [DEBUG] [.binding.loxone.internal.LxWebSocket] - [14] Closing session
2020-05-04 12:24:32.351 [DEBUG] [.binding.loxone.internal.LxWebSocket] - [14] Session closed
2020-05-04 12:24:32.353 [DEBUG] [.binding.loxone.internal.LxWebSocket] - [14] Websocket connection closed with code 1000 reason : normally closed
2020-05-04 12:24:32.354 [DEBUG] [.internal.security.LxWsSecurityToken] - [14] Cancelling token refresh.
2020-05-04 12:24:32.355 [DEBUG] [ding.loxone.internal.LxServerHandler] - [14] set offline code=OK reason=Thing is going down.
2020-05-04 12:24:32.358 [DEBUG] [ding.loxone.internal.LxServerHandler] - [14] client stop
2020-05-04 12:24:32.364 [DEBUG] [.binding.loxone.internal.LxWebSocket] - [14] Websocket error : CONTINUATION frame without prior !FIN
2020-05-04 12:24:32.372 [DEBUG] [ding.loxone.internal.LxServerHandler] - [14] client stopped
2020-05-04 12:24:32.373 [DEBUG] [ding.loxone.internal.LxServerHandler] - [14] Thread ending
2020-05-04 12:24:32.383 [DEBUG] [ding.loxone.internal.LxServerHandler] - [15] Initializing thing instance
2020-05-04 12:24:32.423 [DEBUG] [ding.loxone.internal.LxServerHandler] - [15] Thread starting
2020-05-04 12:24:32.424 [DEBUG] [ding.loxone.internal.LxServerHandler] - [15] Server connecting to websocket
2020-05-04 12:24:32.425 [DEBUG] [ding.loxone.internal.LxServerHandler] - [15] connect() websocket
2020-05-04 12:24:32.575 [DEBUG] [ding.loxone.internal.LxServerHandler] - [15] Connecting to server : ws://192.168.1.200:-1/ws/rfc6455 
2020-05-04 12:24:32.579 [DEBUG] [ding.loxone.internal.LxServerHandler] - [15] Error starting websocket client: null
2020-05-04 12:24:32.584 [DEBUG] [ding.loxone.internal.LxServerHandler] - [15] received offline request with code COMMUNICATION_ERROR, but thing already offline.
2020-05-04 12:24:32.597 [DEBUG] [ding.loxone.internal.LxServerHandler] - [15] Delaying connect request by 10 seconds.

@xeroiv
could you please check if it works correctly when Miniserver is added manually from Paper UI? Configuration -> Things -> + (Plus sign on top of screen) -> Loxone Bindings -> Add manually (bottom of the list)
or you can try directly via link:
http://192.168.xxx.xxx:8080/paperui/index.html#/inbox/setup/add/loxone:miniserver

@maciejt
I added it manually through the PaperUI since it wasn’t initially discovered automatically, after removing the .things entry for it and rebooting OH. It then later showed up in my inbox with the incorrect address and port number, which was also reflected in the DEBUG log for the binding. I did nothing with the entry and now it is not showing in my inbox anymore, and I can not find any log entries related to it past that point. I will continue to monitor for issues.