F520 Energy Managemet

Continuing the discussion from [BTicino/OpenWebNet] New openHAB2 binding ready for testing:

Ciao Massimo,
I have F520 to monitor Energy management; every F520 has 3 imput energy monitor (3 toroid). Can I use it with your binding?

F520 and F521 should be both supported, but it must be tested.
Which WHERE address is your F520?
Which address did you give to your toroids?
Try also auto discovery to see if it works (should work!): you should be able to find your energy management devices in the Inbox after a new scan.
Let me know!
Massi

Ciao Massimo,
My OpenHab is configured via text config. file.
I have 3 F520 the first F520 is configured

A1 = Null
A2 = Null
A3-Ta=1
A3-Tb=4
A3-Tb=7

To monitor Toroid “Ta” Where address is: 51; Tb is 54 and Tb Where address is 57 correct?

Thing config:
Bridge openwebnet:bus_gateway:mybridge[ host=“10.3.9.1”, passwd=“12345”, Port=“20000”] {


bus_energy_central_unit Fase1Enel “Fase 1 Enel” [ where=“51” ]
}

Looks correct!
Does it work?
If not , post here some relevant logs (Log level DEBUG)

M

Ciao Massimo
I enable log from Karaf console:

  • log:set DEBUG org.openhab.binding.openwebnet
  • log:set DEBUG org.openwebnet
    this is output of /var/log/openhab2/openhab.log


2018-12-31 14:13:10.357 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'bticino.things'
2018-12-31 14:13:23.643 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - ##gw-openwebnet-conn## sending MON keepalive ACK
2018-12-31 14:13:23.646 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - MON SENDING    ======>>>>>> *#*1##
2018-12-31 14:13:24.668 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'bticino.things'
2018-12-31 14:13:24.961 [DEBUG] [et.internal.OpenWebNetHandlerFactory] - ==OWN:HandlerFactory== createHandler()
2018-12-31 14:13:24.963 [DEBUG] [et.internal.OpenWebNetHandlerFactory] - ==OWN:HandlerFactory== creating NEW ENERGY Handler
2018-12-31 14:13:24.966 [DEBUG] [bnet.handler.OpenWebNetEnergyHandler] - ==OWN:EnergyHandler== constructor
2018-12-31 14:13:24.971 [DEBUG] [ebnet.handler.OpenWebNetThingHandler] - ==OWN:ThingHandler== initialize() thing=openwebnet:bus_energy_central_unit:tarzo:Fase2Enel
2018-12-31 14:13:24.975 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  BridgeHandler.registerDevice() 
2018-12-31 14:13:24.978 [DEBUG] [ebnet.handler.OpenWebNetThingHandler] - ==OWN:ThingHandler== associated thing to bridge with ownId=54
2018-12-31 14:13:24.983 [DEBUG] [bnet.handler.OpenWebNetEnergyHandler] - ==OWN:EnergyHandler== initialize() thing=openwebnet:bus_energy_central_unit:tarzo:Fase2Enel
2018-12-31 14:14:26.454 [DEBUG] [g.openwebnet.bus.MyHomeJavaConnector] - ##gw-openwebnet-connector## readMonitoring() SocketTimeoutException: Read timed out
2018-12-31 14:14:26.457 [DEBUG] [org.openwebnet.OpenGatewayBus$a     ] - ##gw-openwebnet-BusReceiveThread## SocketTimeoutException on readMonitoring: Read timed out
2018-12-31 14:14:26.460 [DEBUG] [org.openwebnet.OpenGatewayBus$a     ] - ##gw-openwebnet-BusReceiveThread## ^^^ sending CMD message to see if gw is still reachable...
2018-12-31 14:14:26.464 [INFO ] [g.openwebnet.bus.MyHomeJavaConnector] - COM SENDING   ============>>>>>>>>>>>> 
2018-12-31 14:14:26.468 [DEBUG] [g.openwebnet.bus.MyHomeSocketFactory] - ##gw-openwebnet-socket## CANNOT read from socket: read returned -1
2018-12-31 14:14:26.471 [DEBUG] [g.openwebnet.bus.MyHomeJavaConnector] - ##gw-openwebnet-connector## read returned -1
2018-12-31 14:14:26.475 [DEBUG] [g.openwebnet.bus.MyHomeJavaConnector] - ##gw-openwebnet-connector## let's try with a NEW SESSION...
2018-12-31 14:14:26.477 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - ##gw-openwebnet-socket## Trying openCommandSession() socket....  (10.3.9.1:20000)
2018-12-31 14:14:26.484 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - ##gw-openwebnet-conn## ... starting HANDSHAKE ... 
2018-12-31 14:14:26.488 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - COM RECEIVED   <<<<<<====== *#*1##
2018-12-31 14:14:26.492 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - COM SENDING    ======>>>>>> *99*0##
2018-12-31 14:14:26.499 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - COM RECEIVED   <<<<<<====== *#886714289##
2018-12-31 14:14:26.503 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - COM SENDING    ======>>>>>> *#4282335195##
2018-12-31 14:14:26.511 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - COM RECEIVED   <<<<<<====== *#*1##
2018-12-31 14:14:26.515 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - ##gw-openwebnet-socket## ... CONNECTED command session 10.3.9.1:20000
2018-12-31 14:14:26.520 [INFO ] [g.openwebnet.bus.MyHomeJavaConnector] - COM SENDING   ============>>>>>>>>>>>> *#13**15##
2018-12-31 14:14:26.567 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - COM RECEIVED  <<<<<<<<<<<<============ *#13**15*200##
2018-12-31 14:14:26.613 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - COM RECEIVED  <<<<<<<<<<<<============ *#*1##
2018-12-31 14:14:26.917 [DEBUG] [org.openwebnet.OpenGatewayBus$a     ] - ##gw-openwebnet-BUSReceiveThread## ^^^ ... CMD was answered, gw is still reachable!
2018-12-31 14:14:26.919 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *#13**15*200##
2018-12-31 14:14:26.922 [DEBUG] [org.openwebnet.OpenGatewayBus       ] - ##gw-openwebnet-BUS## server MODEL=MyHOMEServer1 / MH202 / F455
2018-12-31 14:14:26.925 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  GatewayManagement WHAT = null
2018-12-31 14:14:53.643 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - ##gw-openwebnet-conn## sending MON keepalive ACK
2018-12-31 14:14:53.646 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - MON SENDING    ======>>>>>> *#*1##
2018-12-31 14:16:26.963 [DEBUG] [g.openwebnet.bus.MyHomeJavaConnector] - ##gw-openwebnet-connector## readMonitoring() SocketTimeoutException: Read timed out
2018-12-31 14:16:26.966 [DEBUG] [org.openwebnet.OpenGatewayBus$a     ] - ##gw-openwebnet-BusReceiveThread## SocketTimeoutException on readMonitoring: Read timed out
2018-12-31 14:16:26.969 [DEBUG] [org.openwebnet.OpenGatewayBus$a     ] - ##gw-openwebnet-BusReceiveThread## ^^^ sending CMD message to see if gw is still reachable...
2018-12-31 14:16:26.972 [INFO ] [g.openwebnet.bus.MyHomeJavaConnector] - COM SENDING   ============>>>>>>>>>>>> *#13**15##
2018-12-31 14:16:26.976 [DEBUG] [g.openwebnet.bus.MyHomeSocketFactory] - ##gw-openwebnet-socket## CANNOT read from socket: read returned -1
2018-12-31 14:16:26.979 [DEBUG] [g.openwebnet.bus.MyHomeJavaConnector] - ##gw-openwebnet-connector## read returned -1
2018-12-31 14:16:26.982 [DEBUG] [g.openwebnet.bus.MyHomeJavaConnector] - ##gw-openwebnet-connector## let's try with a NEW SESSION...
2018-12-31 14:16:26.985 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - ##gw-openwebnet-socket## Trying openCommandSession() socket....  (10.3.9.1:20000)
2018-12-31 14:16:26.991 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - ##gw-openwebnet-conn## ... starting HANDSHAKE ... 
2018-12-31 14:16:26.995 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - COM RECEIVED   <<<<<<====== *#*1##
2018-12-31 14:16:26.998 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - COM SENDING    ======>>>>>> *99*0##
2018-12-31 14:16:27.003 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - COM RECEIVED   <<<<<<====== *#502917005##
2018-12-31 14:16:27.007 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - COM SENDING    ======>>>>>> *#3816816615##
2018-12-31 14:16:27.012 [DEBUG] [org.openwebnet.bus.MyHomeConnection ] - COM RECEIVED   <<<<<<====== *#*1##
2018-12-31 14:16:27.016 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - ##gw-openwebnet-socket## ... CONNECTED command session 10.3.9.1:20000
2018-12-31 14:16:27.020 [INFO ] [g.openwebnet.bus.MyHomeJavaConnector] - COM SENDING   ============>>>>>>>>>>>> *#13**15##
2018-12-31 14:16:27.061 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - COM RECEIVED  <<<<<<<<<<<<============ *#13**15*200##
2018-12-31 14:16:27.104 [INFO ] [g.openwebnet.bus.MyHomeSocketFactory] - COM RECEIVED  <<<<<<<<<<<<============ *#*1##
2018-12-31 14:16:27.411 [DEBUG] [org.openwebnet.OpenGatewayBus$a     ] - ##gw-openwebnet-BUSReceiveThread## ^^^ ... CMD was answered, gw is still reachable!
2018-12-31 14:16:27.415 [INFO ] [org.openwebnet.OpenGatewayBus$a     ] - MON RECEIVED  <<<<<<<<<<< *#13**15*200##
2018-12-31 14:16:27.419 [DEBUG] [org.openwebnet.OpenGatewayBus       ] - ##gw-openwebnet-BUS## server MODEL=MyHOMEServer1 / MH202 / F455
2018-12-31 14:16:27.424 [DEBUG] [bnet.handler.OpenWebNetBridgeHandler] - ==OWN==  GatewayManagement WHAT = null


Ok, but does it work for you???
Otherwise post again the log but this time using code fences and explain what is not working for you.
Bye
M

No does not Work!

Ciao Massimo
I was wrong…
I had used as thing name “light” the address…

bus_on_off_switch         51      "Prato Zona Est"      [where="51"]    //Elettrovalvola Zona EST
bus_energy_central_unit   Fase1Enel  "Fase 1 Enel"       [where="51"]

This configuration is OK

bus_on_off_switch         l51      "Prato Zona Est"      [where="51"]    //Elettrovalvola Zona EST
bus_energy_central_unit   Fase1Enel  "Fase 1 Enel"       [where="51"]

Now i see energy thing! in PaperUI
but i see:

2018-12-31 16:20:36.553 [hingStatusInfoChangedEvent] - 'openwebnet:bus_on_off_switch:tarzo:l51' changed from UNKNOWN: waiting state update... to OFFLINE (COMMUNICATION_ERROR): Could not get channel state

2018-12-31 16:20:38.338 [hingStatusInfoChangedEvent] - 'openwebnet:bus_on_off_switch:tarzo:l54' changed from UNKNOWN: waiting state update... to OFFLINE (COMMUNICATION_ERROR): Could not get channel state

Ok now the problem is more clear.
You probably now see energy reading on the F520 but the light does not change anymore if you change it from physical device.
Correct?
M

Correct Massimo!

Strange…

//Irrigazione
    bus_on_off_switch       l51      "Prato Zona Est"                    [where="51"]    //Elettrovalvola Zona EST
    bus_on_off_switch       l52      "Elettrovalvola Nord"               [where="52"]    //Elettrovalvola Zona NORD (Orto e Gocciolatoi Nord)
    bus_on_off_switch       l53      "Prato Zona Ovest"                  [where="53"]    //Elettrovalvola Zona OVEST
    bus_on_off_switch       l54      "Gocciolatoi Sud"                   [where="54"]    //Elettrovalvola Zona SUD
    bus_on_off_switch       l55      "Gocciolatoi Nord"                  [where="55"]    //Elettrovalvola Zona Gocciolatoi
    bus_on_off_switch       l56      "Orto"                              [where="56"]    //Elettrovalvola Orto

//Energy Management
    bus_energy_central_unit Fase1Enel  "Fase 1 Enel"       [ where="51" ]
    bus_energy_central_unit Fase2Enel  "Fase 2 Enel"       [ where="52" ]
    bus_energy_central_unit Fase3Enel  "Fase 3 Enel"       [ where="53" ]

    bus_energy_central_unit Fase1Pompa  "Fase 1 Pompa"       [ where="54" ]
    bus_energy_central_unit Fase2Pompa  "Fase 2 Pompa"       [ where="55" ]
    bus_energy_central_unit Fase3Pompa  "Fase 3 Pompa"       [ where="56" ]

    bus_energy_central_unit Fase1FV  "Fase 1 FV"       [ where="57" ]
    bus_energy_central_unit Fase2FV  "Fase 2 FV"       [ where="58" ]
    bus_energy_central_unit Fase3FV  "Fase 3 FV"       [ where="59" ]

on PaperUI


P.S.
After how long the read values are refreshed of bus_energy_central_unit ?

How access to measured data?

Istant Power is OK
W/h Day ?
W/h Mouth ?
W/h Year ?

Hi,
you spotted a bug about conflicting WHERE address for different subsystems (in your case Light and Energy).
It will be corrected in the next release. Good job!

It depends on the BUS / BTicino system: the binding simply updates the value as soon as it is transmitted on the BUS. I suggest you check your MyHome configuration for that.

These are not yet implemented in the binding (feel free to add a new issue explaining the desired behavior.

What is your use-case?
Why would you need these averaged values in OH2 when you have them already on your monitoring from BTicino?

bye
M

Hi Massi

If there is no device that polls the BUS energy data (WebServer or Touchscreen), the values remain unchanged. If there was a way to define the thing …

bus_energy_central_unit Step1Enel "Phase 1 Enel" [where = "5111", interval = 30]

where 30 is refresh of the values (in seconds).

Where OpenHab (with OpenWebNet) poll the BUS.

In fact, this data is not very useful, you’re right.

Can you download this official OpenWebNet Client from BTicino -> tab TOOLS (for Windows) , then put the IP address of your BTicino gateway and password (select HMAC if text password)
and send this openwebnet command:

  • *#18*51*#1200#1*1##

this should ask to send power measures every 1 min on the BUS.
if it works it could be included in the binding , so that the binding will receive updates even if no other device on the BUS is polling.

Let me know,
Massi

means that it updates the energy data that takes place within a minute.
In fact:
2019-01-05%2023_35_57-Window
I changed What Address…
this method is preferred…

I know the documentation , thanks, that is where I took the message from :wink:!
Documentation is sometime unprecise and there are also errors in the gateways…
So is always better to test!
The dimension request you suggest requires polling , while activating power events from the BUS on power changes i think is better. I will set it to 1min, to start with.
Would you mind adding a new issue in GitHub ?
So that this gets tracked and queues up with the rest of tyings that are in the pipeline.
Bye
Massi

Hi Massimo, Hi Gabriele, Hi Everybody,

happy new year! :smiley: Today I have updated to binding b9-1 and had, for what I have read in your posts, the same issues… I have an F521 and the automation connect throug a MyHomeScreen 10’’.

The log I found is this one:

2019-01-06 18:48:22.135 [INFO ] [ebnet.handler.OpenWebNetThingHandler] - ==OWN:ThingHandler== Thing state request timer expired, still unknown. Setting thing=openwebnet:bus_energy_central_unit:casa_mhscreen10:Energy_CU to OFFLINE

My .things and .items file are set as described in the man page, everything works fine except for energy.

If you need complete configs and logs just let me know.

So my question is: this “bug” Gabriele found regards all “bus_energy_central_unit” things? Once you fix it it’ll be ok for both F520 and F521?

Thanks in advance and keep up Massimo! You’re doing a great job!

André

Yes.
See: Energy Meter polling (WHO=18) · Issue #39 · mvalla/openhab-addons · GitHub

Hi there,
I have installed F520 with beta9-1 binding and it works fine.
Being able to set the polling interval would be a good enh. If you need help with testing please count in me.
Do anyone knows if is it possible to read negative values? I placed the toroid to measure power from grid but when my FV panels generate more than consumed the current is going in the opposite direction. I read bticino manuals but I’m not able to understand if the F520 sends negative values.

Thx.