fruggy83 / openocean

27 stars 11 forks source link

virtualRockerSwitch stop sending after restart #23

Open k00ala opened 5 years ago

k00ala commented 5 years ago

Hey,

great work @fruggy83 i was waiting for a long time on this binding!

Now i have found a problem with the virtualRockerSwitch. It stop sending when i restart openhab. But when i change the channel on thing and item live in the textfiles from virtualRockerswitchA to virtualRockerswitchB and also from virtualRockerswitchB to virtualRockerswitchA it starts working again.

Log: After restart and switch item on the sitemap:

2018-11-01 11:59:05.589 [ome.event.ItemCommandEvent] - Item 'v1' received command ON

2018-11-01 11:59:05.608 [nt.ItemStatePredictedEvent] - v1 predicted to become ON

2018-11-01 11:59:05.621 [vent.ItemStateChangedEvent] - v1 changed from NULL to ON

After changed channel from B to A (update process and afterwards trigger via sitemap):

2018-11-01 12:01:03.856 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'enocean.things'

==> /var/log/openhab2/openhab.log <==

2018-11-01 12:01:04.371 [DEBUG] [an.handler.OpenOceanBaseThingHandler] - Initializing open ocean base thing handler.

2018-11-01 12:01:04.375 [DEBUG] [an.handler.OpenOceanBaseThingHandler] - initializeThing thing openocean:virtualRockerSwitch:usb:AABBDD09 bridge status ONLINE

==> /var/log/openhab2/events.log <==

2018-11-01 12:01:04.391 [me.event.ThingUpdatedEvent] - Thing 'openocean:virtualRockerSwitch:usb:AABBDD09' has been updated.

2018-11-01 12:01:04.404 [me.event.ThingUpdatedEvent] - Thing 'openocean:virtualRockerSwitch:usb:AABBDD09' has been updated.

2018-11-01 12:01:04.407 [me.event.ThingUpdatedEvent] - Thing 'openocean:virtualRockerSwitch:usb:AABBDD09' has been updated.

==> /var/log/openhab2/openhab.log <==

2018-11-01 12:01:05.288 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'enocean.items'

==> /var/log/openhab2/events.log <==

2018-11-01 12:01:05.598 [.ItemChannelLinkAddedEvent] - Link 'v1-openocean:virtualRockerSwitch:usb:AABBDD09:virtualRockerswitchA' has been added.

2018-11-01 12:01:12.679 [ome.event.ItemCommandEvent] - Item 'v1' received command OFF

2018-11-01 12:01:12.693 [nt.ItemStatePredictedEvent] - v1 predicted to become OFF

2018-11-01 12:01:12.709 [vent.ItemStateChangedEvent] - v1 changed from ON to OFF

==> /var/log/openhab2/openhab.log <==

2018-11-01 12:01:12.788 [DEBUG] [nal.transceiver.OpenOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback

2018-11-01 12:01:12.792 [TRACE] [nal.transceiver.OpenOceanTransceiver] - << Sending data, type RADIO_ERP1, payload 55000707017AF650FFF13FB03001FFFFFFFFFF0034

2018-11-01 12:01:12.807 [TRACE] [nal.transceiver.OpenOceanTransceiver] - Received Sync Byte

2018-11-01 12:01:12.814 [TRACE] [nal.transceiver.OpenOceanTransceiver] - >> Received header, data length 1 optional length 0 packet type 2

2018-11-01 12:01:12.817 [DEBUG] [nal.transceiver.OpenOceanTransceiver] - RESPONSE with code RET_OK payload 00

2018-11-01 12:01:12.820 [TRACE] [nal.transceiver.OpenOceanTransceiver] - Response without listener

2018-11-01 12:01:12.838 [TRACE] [nal.transceiver.OpenOceanTransceiver] - Received Sync Byte

2018-11-01 12:01:12.841 [TRACE] [nal.transceiver.OpenOceanTransceiver] - >> Received header, data length 7 optional length 7 packet type 1

2018-11-01 12:01:12.845 [DEBUG] [nal.transceiver.OpenOceanTransceiver] - RADIO_ERP1 with RORG RPS for FFF13FB0 payload F650FFF13FB03101FFFFFFFF3D00

2018-11-01 12:01:13.071 [DEBUG] [nal.transceiver.OpenOceanTransceiver] - Enqueue new send request with ESP3 type RADIO_ERP1 without callback

2018-11-01 12:01:13.317 [TRACE] [nal.transceiver.OpenOceanTransceiver] - << Sending data, type RADIO_ERP1, payload 55000707017AF600FFF13FB02001FFFFFFFFFF0087

2018-11-01 12:01:13.333 [TRACE] [nal.transceiver.OpenOceanTransceiver] - Received Sync Byte

2018-11-01 12:01:13.336 [TRACE] [nal.transceiver.OpenOceanTransceiver] - >> Received header, data length 1 optional length 0 packet type 2

2018-11-01 12:01:13.339 [DEBUG] [nal.transceiver.OpenOceanTransceiver] - RESPONSE with code RET_OK payload 00

2018-11-01 12:01:13.341 [TRACE] [nal.transceiver.OpenOceanTransceiver] - Response without listener

2018-11-01 12:01:13.349 [TRACE] [nal.transceiver.OpenOceanTransceiver] - Received Sync Byte

2018-11-01 12:01:13.352 [TRACE] [nal.transceiver.OpenOceanTransceiver] - >> Received header, data length 7 optional length 7 packet type 1

2018-11-01 12:01:13.357 [DEBUG] [nal.transceiver.OpenOceanTransceiver] - RADIO_ERP1 with RORG RPS for FFF13FB0 payload F600FFF13FB02101FFFFFFFF4000

2018-11-01 12:01:15.411 [TRACE] [nal.transceiver.OpenOceanTransceiver] - Received Sync Byte

2018-11-01 12:01:15.415 [TRACE] [nal.transceiver.OpenOceanTransceiver] - >> Received header, data length 10 optional length 7 packet type 1

2018-11-01 12:01:15.423 [DEBUG] [nal.transceiver.OpenOceanTransceiver] - RADIO_ERP1 with RORG _4BS for 01851D03 payload A59C7B000901851D038101FFFFFFFF4000

My config is:

Thing:

Bridge openocean:serialbridge:usb "OpenOcean Gateway" [ port="/dev/ttyUSB0" ] 
{
    Thing virtualRockerSwitch AABBDD09 "V1" @ "Kueche" senderIdOffset=48, sendingEEPId="F6_02_01_Virtual", broadcastMessages=true, suppressRepeating=false ] {Channels: Type virtualRockerswitch:virtualRockerswitchA [duration=300, switchMode="rockerSwitch"]} 
}

Item:

Switch v1 "v1" { channel="openocean:virtualRockerSwitch:usb:AABBDD09:virtualRockerswitchA" [profile="openocean:rockerswitch-from-on-off"]}

Sitemap:

sitemap Test_Enocean label="Test_Enocean"
{
    Frame label="Rolladen/Markisen Aktoren - Enocean"
    {
        Switch item=v1                   
    }
}
fruggy83 commented 5 years ago

Hi @k00ala,

thanks a lot for this hint. I will analyse this problem and hopefully find a solution. Your thing, item and sitemap definition look good. Maybe it has something to do with the initial "NULL" state. Could you do me a favor and switch your virtualrocker twice after a restart?

Best regards Daniel

k00ala commented 5 years ago

Hey @fruggy83

Log of switching the virtualRocker few times:


2018-11-10 11:44:15.772 [nt.ItemStatePredictedEvent] - v1 predicted to become ON

2018-11-10 11:44:15.789 [vent.ItemStateChangedEvent] - v1 changed from NULL to ON

2018-11-10 11:44:16.637 [ome.event.ItemCommandEvent] - Item 'v1' received command OFF

2018-11-10 11:44:16.643 [nt.ItemStatePredictedEvent] - v1 predicted to become OFF

2018-11-10 11:44:16.653 [vent.ItemStateChangedEvent] - v1 changed from ON to OFF

2018-11-10 11:44:17.409 [ome.event.ItemCommandEvent] - Item 'v1' received command ON

2018-11-10 11:44:17.417 [nt.ItemStatePredictedEvent] - v1 predicted to become ON

2018-11-10 11:44:17.432 [vent.ItemStateChangedEvent] - v1 changed from OFF to ON

It seems that the Things which are defined by text files are not correct initialized on startup. I defined a new virtualRockerSwitch Thing via PaperUI and this works after restart. This is now my workaround but its not perfect because i want to define everything by text files.

Best regards Stefan