Orvio/Bauhn/Aldi Wi-Fi Power Point

Begonnen von franc, 16 Juli 2014, 11:51:47

Vorheriges Thema - Nächstes Thema

franc

In case anyone else is intersted I wrote a simple device driver for these, code is at

https://github.com/franc-carter/fhem-bauhn


rudolfkoenig

Thanks for the link.

Some remarks:
- since you have a DefineFn, you should change the name from 99_Bauhn.pm to something like 30_Bauhn.pm, to allow autoloading.
- you could use the SetExtensions for some additional functions.
- using IO::Select in a loop in ReadFn is not the ideal solution, as it might block FHEM for a while. It is better to store unfinished data in $hash, ReadFn will be called again, if there is data to read.
- perhaps it would be enough to store the ip of the device, instead of doing a discovery on each FHEM-startup. In this case the user should have a possibility to force a new discovery.



franc


- Thanks, I will change the name
- I've struggled with understanding some of the concepts of fhem, SetExtensions is one of the ones I have little grasp of
- yes, that makes sense, I'll look at fixing that
- I'd prefer to avoid storing the ip, if people have dhcp without reservations they will have hard to explain behaviour occasionally

rudolfkoenig

ZitatSetExtensions is one of the ones I have little grasp of

Take a look at the examples, e.g. in FS20.pm
In essence, you call SetExtensions instead of returning the list of possible commands.

franc

An update,

fixing this is trickier than I first expected as I made a design error. I'll need to split it in to two devices a Hub and a Device similar to the way the Hue is done.

I'm working on it but it's a rewrite ;-(

franc


I'm making some progress - I've started from scratch as it needs to be two level device.

I am using Dispatch() to send messages from the physical device to the logical device, can someone tell me what the correct/preferred method is for the Parse() method to determine which instance of the device the messages is for.

thanks

rudolfkoenig

Either go through all your devices (devspec2arr with TYPE=logdev) or store the code to hash  pairing in the module specific hash. Take a look to the FS20 code for the latter example

franc

thanks,

I'll have a look in to those

cheer

franc


Neat,

The FS20 example is clear

thanks again

franc


Hi,

this is nearly finished, however there is at least one bug I am having trouble with.

When I turn the device on/off using the button on the device the web interface does not get updated until I do a refresh in the browser. This work better (not perfectly) with the previous driver that did not use two layer devices.

Any idea of where to look for my bug ?

thanks

rudolfkoenig

first, longpoll for the FHEMWEB instance has to be set.
second, an on/off event must be generated. this is done automatically for you, if the module set routine does not use readingsupdate, else you have to do it yourself.

franc

#11
Here's the second version of the driver. I have made it a two level driver, a Bridge and a Device

  • The Bridge does all the network communication

  • The Device does the per device settings

https://github.com/franc-carter/fhem-bauhn




pipp37

#12
Hello franc.
I installed your module to control a orvido wiwo-s20 switch.
http://eud.dx.com/product/orvibo-wiwo-s20-smart-wi-fi-eu-standard-wall-mounted-socket-white-844343066#.Vf0ca5c08rI

Great, it works, Thanks.

I have seen that port 10000  is used and on my solaris box also webmin runs at the same port.
Is it possible to change the used port from the BauhnBridge?

Orvibo S20 uses also the communication at port 10000 udp for commands.

Also i get some entries in the logfile.
Thanks Armin


2015.09.19 10:28:31 3: OrvidoBridge1: Unknown code HASH(0x9fa58a8), help me!
2015.09.19 10:30:30 3: BauhnBridge_Write: FBK_PREAMBLE ac:cf:23:65:4f:ac
2015.09.19 10:30:30 3: BauhnBridge_Read: FBK_PREAMBLE ac:cf:23:65:4f:ac
2015.09.19 10:30:30 3: BauhnDevice_Parse: FBK_PREAMBLE ac:cf:23:65:4f:ac
2015.09.19 10:30:30 3: OrvidoBridge1: Unknown code HASH(0x9b757c0), help me!
2015.09.19 10:30:31 3: BauhnBridge_Read: SUBSCRIBED ac:cf:23:65:4f:ac off
2015.09.19 10:30:31 3: BauhnDevice_Parse: SUBSCRIBED ac:cf:23:65:4f:ac off
2015.09.19 10:30:31 3: OrvidoBridge1: Unknown code HASH(0x9fe9bc0), help me!
2015.09.19 10:32:30 3: BauhnBridge_Write: FBK_PREAMBLE ac:cf:23:65:4f:ac
2015.09.19 10:32:30 3: BauhnBridge_Read: FBK_PREAMBLE ac:cf:23:65:4f:ac
2015.09.19 10:32:30 3: BauhnDevice_Parse: FBK_PREAMBLE ac:cf:23:65:4f:ac
2015.09.19 10:32:30 3: OrvidoBridge1: Unknown code HASH(0x9b85768), help me!
2015.09.19 10:32:31 3: BauhnBridge_Read: SUBSCRIBED ac:cf:23:65:4f:ac off
2015.09.19 10:32:31 3: BauhnDevice_Parse: SUBSCRIBED ac:cf:23:65:4f:ac off
2015.09.19 10:32:31 3: OrvidoBridge1: Unknown code HASH(0x9b32400), help me!


Vmware-ESX-VM-Ubuntu 16.04 Docker Main-FHEM -> Raspberry Pi-B ser2net
HMLAN mit HomeMatic, Busware SCC433 stacked SCC868 (culfw), Jeelink, MAX Heizkörperthermostate, Enigma2 (Vudo2/DM800SE), Philips 55" Ambilight PHTV - WMBUS EnergyCam+Engelmann FAW, Intertechno-Komponenten, Ubiquiti mPower