![]() |
Help to read html code - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: Help to read html code (/showthread.php?tid=2359) |
Help to read html code - peyoe - 21.11.2019 Hello friends. I try several times to read active power from my wibeee power meter trough the web page. I use the example on https://forum.logicmachine.net/showthread.php?tid=712 and on https://openrb.com/read-plugwise-smile-p1-meter-data-with-http-requests/ But I can not do it, I do not have any ressult. This is the url I use: http://192.168.1.238/en/phase1.html And this is a screen capture how html is: ![]() Can someone help with the script? Thanks and greetings. PD: Sorry about my english ![]() RE: Help to read html code - Erwin van der Zwart - 22.11.2019 Hi, Try this: Code: require('socket.http') Erwin RE: Help to read html code - peyoe - 22.11.2019 (22.11.2019, 00:06)Erwin van der Zwart Wrote: Hi,Hello @Erwin van der Zwart Thanks for the script!! I change the script in order to put the user and password and to change the output object (virtual byte floating point) see it: Code: require('socket.http') But this doesn't work, looking to the log this is the output: ![]() And this is the searched data read from the wibeee webpage, storeged on "data" Code: <tr> Any idea? Thanks again. RE: Help to read html code - admin - 22.11.2019 Data is probably loaded via JavaScript so initial HTML fields are empty. Check network tab in browser. You might get a URL for JSON data which will make parsing easier. RE: Help to read html code - peyoe - 22.11.2019 (22.11.2019, 08:04)admin Wrote: Data is probably loaded via JavaScript so initial HTML fields are empty. Check network tab in browser. You might get a URL for JSON data which will make parsing easier. Hello, I completely a noob with html and java. How can I do it? RE: Help to read html code - admin - 22.11.2019 Open dev tools (F12) switch to Network tab and reload the page. Post a screenshot of what requests you get there. RE: Help to read html code - Erwin van der Zwart - 22.11.2019 Hi, What model do you use? When looking at the internet data i see it supports XML and modbus TCP, so integration by parsing XML or communicate over modbus should be easy and there is no need to fetch the data from the HTML (this is the last option i would use). I would go for Modbus TCP when available. BR, Erwin RE: Help to read html code - peyoe - 22.11.2019 (22.11.2019, 09:20)Erwin van der Zwart Wrote: Hi, I use this one: https://wibeee.com/producto/wibeee-box-mono/#tab-additional_information EDIT Well, It seems that it does have modbus TCP communication: ![]() Any info how catch this data? RE: Help to read html code - Daniel - 22.11.2019 Read manuals or contact support. You need to setup modbus, probably just enable and get the registry info. RE: Help to read html code - peyoe - 22.11.2019 (22.11.2019, 09:57)Daniel. Wrote: Read manuals or contact support. You need to setup modbus, probably just enable and get the registry info. I'm on it RE: Help to read html code - peyoe - 22.11.2019 I already have the information from support, how to put it in modbus TCP mode and address table: See: ![]() The direction I would like to read is 0x000D "Total Active Power" Now I need how to extract this info. Can someone help me with that? And once again, thanks RE: Help to read html code - Daniel - 22.11.2019 Go to modbus tab, add attached profile and then add modbus IP device. Map object and you are done. Profile may need adjustment. RE: Help to read html code - peyoe - 22.11.2019 (22.11.2019, 15:15)Daniel. Wrote: Go to modbus tab, add attached profile and then add modbus IP device. Map object and you are done. Wow, that was fast. Thanks a lot, later at home I try it. RE: Help to read html code - peyoe - 25.11.2019 Finally I can do it, but not trough modbus, because when I inserted new modbus device, the software ask for the IP and one port. I don't had idea what port wibeee uses for this task. So, searching info on the manual I founded that wibeee can answer to html request for one item. With this info, I have used the scrip from @Erwin van der Zwart and modify to request only for the items I wanted. This is the final script: Code: require('socket.http') I launch it every 5 minutes, and works pretty well ![]() Thanks to all, for the help. RE: Help to read html code - Joep - 14.12.2019 (25.11.2019, 12:30)peyoe Wrote: Finally I can do it, but not trough modbus, because when I inserted new modbus device, the software ask for the IP and one port. I don't had idea what port wibeee uses for this task... Modbus over TCP is most likely port 502. |