Page 2 of 2

Re: json for version or other command

Posted: Thursday 18 January 2024 18:43
by pierrotori
it's exactly that i search
is your process web-scraping is a node-red flow ?

Re: json for version or other command

Posted: Thursday 18 January 2024 18:48
by waltervl
Why scraping??? Why not use whatchtower or diun as suggested earlier?

Re: json for version or other command

Posted: Thursday 18 January 2024 19:08
by pierrotori
because i prefer to use only the container to manage the functionality of the smart home, not to manage the system, or exploitation
i prefer in this case use the script shell or dzvents

today, i have a different container for domoticz/mosquito/homebridge/zwave-js-ui/fail2ban/wireguard
i could to use watchtower, portainer, etc but i add a constraint when i upgrade all the containers. i prefer a script shell , it's a sure value and i prefer also to concentrate the times only on the home automation scenario

Re: json for version or other command

Posted: Thursday 18 January 2024 23:04
by waltervl
You can also run a daily or weekly Cron just to pull the latest beta.

Re: json for version or other command

Posted: Friday 19 January 2024 16:28
by FireWizard
Hello @pierrotori,

You asked:
is your process web-scraping is a node-red flow ?
Yes, it is.
If you can tell me which version (stable/beta) and platform you need, I can send you a working flow for your version.

It is not up to me, to decide for others, what is the best method to get the desired data.
I have this flow available and if someone want to use it, I'm happy to share.

@waltervl

You commented:
Why not use whatchtower or diun as suggested earlier?
These programs seems to be Docker related. I do not use them and I'm not familiar with them, because I do not use Docker.
Perhaps they are better than web scraping, but, as said, that is for Docker users to decide.

Regards

Re: json for version or other command

Posted: Friday 19 January 2024 18:10
by lost
FireWizard wrote: Friday 19 January 2024 16:28
is your process web-scraping is a node-red flow ?
Yes, it is.
Sound a bit complex considering the information present in waltervi API call suggestion?

You get:

Code: Select all

{
	"DomoticzUpdateURL" : "https://www.domoticz.com/download.php?channel=stable&type=release&system=linux&machine=aarch64",
	"HaveUpdate" : false,
	"Revision" : 15854,
	"SystemName" : "linux",
	"UseUpdate" : true,
	"build_time" : "2024-01-05 12:51:42",
	"dzvents_version" : "3.1.8",
	"hash" : "30067cce8",
	"python_version" : "None",
	"status" : "OK",
	"title" : "GetVersion",
	"version" : "2024.1 (build 15805)"
}
=> So you know you're on build 15805 and there is a 15854 available.

Maybe I miss something, but web scrapping the page may not be needed? That's really something to do when there is no other choice (because no API to get required info): Changes in page structure may need code change etc...

Did this (using python and BeautifulSoup module, as this was for something done in python) for my fixed phone spammers filtering service, to get some score/rank classification for incoming callers from web sites like shouldianswer or tellows... but that's because I did not found another free way (i.e. they provides API but you need to pay for access) for my own personal use!

Re: json for version or other command

Posted: Friday 19 January 2024 18:20
by FireWizard
Hello @lost.

You are correct, it is relative complex, as an URL is available. I made this once, a while ago, in order to show someone, how to do web scraping in Node-RED. I demonstrated it with the Domoticz web page and that is the reason I have it available.

Regards

json for version or other command

Posted: Friday 19 January 2024 19:43
by pierrotori
i scrapped the html page

Code: Select all

{"domoticz":"version"
{"mode":"release","os":"linux","bits":"armv7l.tgz","numero":"2024.2.15854","date":"2024-01-16","size":"14,36 MB"}
{"mode":"release","os":"linux","bits":"aarch64.tgz","numero":"2024.2.15854","date":"2024-01-16","size":"14,89 MB"}
{"mode":"release","os":"windows","bits":"x86.zip","numero":"2024.2.15854","date":"2024-01-15","size":"13,56 MB"}
{"mode":"release","os":"linux","bits":"x86","numero":"2024.2.15854","date":"2024-01-16","size":"15,72 MB"}
{"mode":"beta","os":"linux","bits":"armv7l.tgz","numero":"2024.2.15864","date":"2024-01-18","size":"14,35 MB"}
{"mode":"beta","os":"linux","bits":"aarch64.tgz","numero":"2024.2.15864","date":"2024-01-18","size":"14,04 MB"}
{"mode":"beta","os":"windows","bits":"x86.zip","numero":"2024.2.15865","date":"2024-01-18","size":"13,48 MB"}
{"mode":"beta","os":"linux","bits":"x86","numero":"2024.2.15864","date":"2024-01-18","size":"15,72 MB"}
}
now i can compare my version a the last version and push a alert when the new version is arrived
i can check with a script shell with json with jq or dzvents with json data

@FireWizard i have node-red but it's not in my domoticz container