[SOLVED] G-Homa Wifi Smart Socket “EMW302WF“ and “EMW302WFO” with OpenHAB2

Great work on here - I had a problem with the latest ghoma nodejs module and openhab. It appears to need a better filter to get the state updating correctly.

Anyway, if it helps anyone else I have a JavaScript transform and a docker container that encapsulates all the work by others.

Transform and docker file here. https://github.com/opulentrich/ghoma-docker

Docker container can run like this :
docker run -d -p 3000:3000 -p 4196:4196 -n ghoma-proxy opulentrich/ghoma-proxy

The config commands in this thread can be run like this
docker exec ghoma-proxy nodejs /node_modules/ghoma/config.js …

1 Like

This tutorial is very clear.

I’ve just set up this configuration for a plug with firmware 1.8.26.
It runs on a raspberry PI 2 without any issue.

Thanks a lot for your work.

1 Like

Hello everybody,
yesterday I had my first try on openhab. I installed it on my regular computer under win10 for first try.

I´ve (until now) only some G-Homa Sockets, so I used this tutorial to bring them up with openhab. It really works fine!! So thank you for your work.

But now, i want to get the socket working again with the original App of G-Homa until I have my raspi and some other items. I thought by resetting the socket with holding the knob until the led blinks fast would make it possible, but that doesn´t work.

Asking google for an “original” config brought me no solution. So could someone help me to get it work again?

Thank you!

@AlexS77

Press and hold the ON / OFF button on the WiFi power outlet for at least 20 seconds. All made
Settings are deleted. The LED flashes fast, you can add the deleted WiFi Smart Socket again.

I used to do this about 20 times today, but it doesn´t work…

Ironically it works after having sent my question here.
So the problem is solved!!

Thank you, @Celaeno1 !!

Hi, i just got this Outlet because the owner does not want to deal with it anymore… I tried to setup, could not with Android 10 Phone, and Then i tried with Android 8 phone, has some issues, meanwhile i found out the admin/admin login because the G Homa App did not want to show me the Outlet. The current state is that the G Homa app shows the outlet and i can switch it via local and remote network connection. Nice to have, just i would like to understand why the heck does the factory reset not reset the admin/admin password ? I cannot login after I changed the password for admin in the http webinterface of the Outlet… does someone of you know why a factory reset does not initialize the admin/admin login possibility anymore to the web frontend? or did this beast make a firmware update and now it has another password?
when i check at firmware update it states its the latest firmware but it does not show a mac address and no firmware version, both fields are empty???
any ideas are welcome and thank you!!! Anton

@ant0nwax

The webinterface is only visible with firmware lower or equal to 1.0.06.

I only know the login: admin/admin.

To reset the plug press 20 sec or longer on the button.

i get a login requester but even after resetting (20 sec) the admin admin combination does not work

@ant0nwax

If configuration via html-configuration (web interface) is not possible, then see steps 1-11 and 13-19.

Thanks, I would just like to change the password to admin admin :slight_smile:
i am not keen (YET) on using openhab

@ant0nwax

I don’t know if this is possible. But you can try to reset it with a command!

Please read this manual:

http://www.sabreadv.com/wp-content/uploads/HF-LPC100-User-Manual-V1.0.pdf

To reset socket or load factory settings, there is the following command:

 AT+RELD<CR>

For doing this please use my manual above steps: 1-11 and 13-19

There were some changes of the scripts in the meantime !!!:

step 4.

modify line 70 in express_example.js

   from res.send(JSON.stringify(plug)); to res.send(JSON.stringify(plug.state));

.
.

step 13 f. --> comment line 75 and line 76 in config.js

//send(new Buffer(“AT+NETP=TCP,Client,”+controlPort+","+controlServer+"\r"));
//send(new Buffer(“AT+NETP\r”));

.

ATTENTION!! This following step is for resetting the socket!
.
step 13 g. --> fill in 2 new lines after line 76 --> (THIS IS FOR RESETTING G-HOMA SOCKET)

send(new Buffer("AT+RELD\r")); //reset socket
send(new Buffer("AT+Z\r")); //reboot socket

Hope this helps!

NEW MANUAL

INSTRUCTIONS: (running nodejs 10.16.0 (or higher) and java script version “ghoma 1.1.0”)

If you don’t want to use cloud based G-Homa App and need an integration into OpenHAB2, you can use your own “control server” written in nodejs.

See here: https://github.com/rodney42/node-ghoma
or here: https://www.npmjs.com/package/ghoma

Prerequisites:

G-Homa App (available here)
Android: https://play.google.com/store/apps/details?id=com.everflourish.android&hl=de
iOS : https://itunes.apple.com/de/app/g-homa/id887296762?mt=8

nodejs (LTS Version)
see here: https://nodejs.org/en/download/

openHAB2 binding: http1 and transformation: map

Download also the following manual from here:
http://www.sabreadv.com/wp-content/uploads/HF-LPC100-User-Manual-V1.0.pdf

Important information:

FIRMWARE of ghoma wifi socket <= 1.0.06 (check if ‘manufacturing date’ on product packaging is 10.14 or before!), then see steps 1-12 and 14-19

FIRMWARE >1.0.06 --> no html-configuration available, then see steps 1-11 and 13-19

  1. Install nodejs and including npm (see documentation)

  2. Install ghoma (be sure that “net” and “express” also is installed!)
    npm install net
    npm install express
    npm install ghoma

  3. you will get five javascripts in a subfolder ‘ghoma’ containing: ghoma.js, example.js, config.js, config_example.js and express_example.js

  4. modify line 70 in express_example.js
    from res.send(JSON.stringify(plug));
    to res.send(JSON.stringify(plug.state));

  5. run express_example.js (e.g. from Windows-commandline: node express_example.js)
    this will start a “mini-webserver” (port: 3000) and a g-homa-control-server (port: 4196) on your local machine

  6. confirm firewall-exception, if poping up.

  7. plug your ghoma wifi socket into a power socket

  8. press button on your wifi socket more than 3 seconds

  9. connect your notebook or smartphone to wifi with SSID “G-Homa

  10. open a browser to address http://10.10.100.254 (user: admin, pw: admin)

image
image

  1. if site in step 10 is not available, your firmware is >1.0.06, go to step 13

  2. next steps (a - g) are for firmware <=1.0.06
    a. go to “STA Setting”, scan and choose your local wifi
    image


    b. important: always press ‘Save’ after you made changes, but do NOT restart your wifi-socket! Press: “Back

    c. fill in your SSID password and (optional) Disable ‘Obtain an IP address automatically’)
    d. (optional) fill in a manual IP-Address, Subnetmask, Gateway, DNS Server


    e. go to “Other Setting’: fill in ‘Server Address’: this is IP Address where you started the express_example.js (in step 5 above).


    f. go to “Work Mode” and choose “STA mode”, press “save” and NOW restart your socket.!


    g. connect your notebook or smartphone back to your home-wifi. Go to step 14

  3. next steps (a - h) are for firmware >1.0.06
    a. open G-Homa App, add new socket, choose your wifi SID and fill in wifi password.
    b. identify IP address of your new socket with your router web interface at network monitor. This will be ‘ghoma address’ in step c.
    c. run config.js which you got in step 3:
    node config.js ‘ghoma address’ ‘control server address’ ‘control server port’
    (‘control server port’ has to be: 4196)
    e.g. node config.js 192.168.100.55 192.168.100.44 4196
    d. if you want to use DHCP for your socket, all done, go to step 14.
    e. if you want a static IP address for your socket, go to step f.
    f. comment line 75 and line 76 in config.js
    //send(new Buffer("AT+NETP=TCP,Client,"+controlPort+","+controlServer+"\r"));
    //send(new Buffer("AT+NETP\r"));
    g. fill in 3 new lines after line 76
    send(new Buffer("AT+WANN=static,192.168.100.229,255.255.255.0,192.168.100.1\r"));
    send(new Buffer("AT+WANN\r")); // See the network settings
    send(new Buffer("AT+Z\r")); //reboot socket

 192.168.100.229 = static IP address of socket, 255.255.255.0 = subnetmask, 192.168.100.1=gateway

then run step 13 c. again, (now use your NEW static IP-Address of the socket in the command!)

  1. h. reboot your socket, power off and power on again

  2. open a webbrowser with address: http://IP-Address:3000/list where IP-Address is IP of your local machine in step 5.

  3. now you will see something like that: [{“id”:“3ef72b”,“state”:“off”}], where “id” is the short-MAC of your ghoma wifi socket.

  4. in openhab2 install the following Add-on: http1

  5. in openhab2 install the following transformation: map

  6. create an onoff.map containing the following:
    “on”=ON
    “off”=OFF

  7. .items-file:

Switch GHoma1	"G-Homa Socket 1"	{ http=">[ON:GET:http://192.168.100.44:3000/on/3ef72b] >[OFF:GET:http://192.168.100.44:3000/off/3ef72b] <[http://192.168.100.44:3000/state/3ef72b:60000:MAP(onoff.map)]" }

where <192.168.100.44> has to be replaced with ‘IP-Address of your mini-webserver’
and <3ef72b> has to be replaced with “id” of your ‘ghoma wifi socket’ (in step 15) and 60000 = milliseconds time interval. (=every 60 seconds)

Have fun! :slight_smile:

okay, i found the new description, thanks for that and i have an issue at step 15
i see only this: []

I further do not understand how i could connect to UART of the device via WiFi, i tried on telnet port 23, does not work, the IP of ghoma socket that is shown in my Router (Fritzbox) is 192.168.188.88 and it does not even answer to ICMP / ping request, and not anymore to http requests… but the cloud app works, even from other networks, so it IS connected to the router AND the internet

I guess it made a firmware update automatically. Then http access is not available anymore.

If you made step 1-11 and 13 a-b. Then run 13 c again.

node config.js 192.168.188.88 192.168.188.xxx 4196

xxx = IP Address of your local PC.

thank you @ALL

it works now…
do i understand right that the http admin/admin will never work again?

[{“id”:“6ff27a”,“firmware”:“1.8.17”,“state”:“off”,“statechanged”:“2019-11-20T06:53:39.083Z”,“triggered”:“local”,“prevstate”:“unknown”,“initalized”:“2019-11-20T06:53:36.630Z”,“remoteAddress”:“::ffff:192.168.188.88”,“remotePort”:9279,“reregistered”:0,“heartbeat”:“2019-11-20T06:53:56.680Z”}]

Now the Ghoma Socket does not work with the Cloud App anymore
is there an android app that EASILY connects to the socket on LOCAL Network, without openhab?

There is an APP called “HTTP Request Shortcuts”.

For switching ON/OFF or getting STATE you also can just use a browser with simple HTTP GET commands (or with above mentioned APP):

http://192.168.188.xxx:3000/on/6ff27a
http://192.168.188.xxx:3000/off/6ff27a
http://192.168.188.xxx:3000/state/6ff27a

where xxx is IP Address of your PC, where you started the express_example.js.

Yes, unless you undo the firmware update. I think this is not possible, but I don’t know.

I only can find this newest firmware here:

What happens when you load:

http://192.168.188.88/iweb.html ?? (I guess: NOTHING!!)

With an older firmware you would see the following (after login):

(Sorry, it’s in german!)


image


If no website is available, you could try the following:

Inside the above mentioned download folder, inside the zip file, there is a file called: lpb_web_ew_V1.0.14.bin (1.0.14 is the same version as you can see in my system settings in 2nd screenshot above)

This is the “web interface”. Maybe you can upload it again onto your socket.
ATTENTION!! YOU DO IT ON YOUR OWN RISK! MAYBE YOU WILL DESTROY YOUR SOCKET!

.
If you want to try it (on your own risk!!), here is a short manual:

Download above .zip. Unzip only lpb_web_ew_V1.0.14.bin to a folder e.g. C:\g-homa\

goto step 13 f: revert the steps in f. (uncomment) (eventually delete or comment the 3 lines from former attempts of step 13 g !)
goto step 13 c and run it again. Then again goto step 13 f. (comment again)
new step 13 g: fill in 1 new line after line 76:

 send(new Buffer("AT+UPURL=file:///C:/g-homa/,lpb_web_ew_V1.0.14.bin\r")); //upload old webpage firmware

.
Attention: the “,” inside the above path C:/g-homa/,lpb_web_ew_V1.0.14.bin is from above documentation (page 21). If it’s not running, try it without “,”.

BUT AGAIN: ALL ON YOUR OWN RISK! I’VE NEVER TRIED THIS! SO, NO WARRANTY!

I know this topic is old but to whom might interest, HFeasy now supports any HF-LPB100/LPT100F/LPB130 based device:

1 Like