json for version or other command

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

User avatar
pierrotori
Posts: 101
Joined: Tuesday 15 May 2018 0:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

Re: json for version or other command

Post by pierrotori »

it's exactly that i search
is your process web-scraping is a node-red flow ?
rpi : Raspberry Pi 2 Model B Rev 1.1 / Modele : Cortex-A7 armv7l GNU/Linux / Os Name : bullseye
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: json for version or other command

Post by waltervl »

Why scraping??? Why not use whatchtower or diun as suggested earlier?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
pierrotori
Posts: 101
Joined: Tuesday 15 May 2018 0:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

Re: json for version or other command

Post 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
rpi : Raspberry Pi 2 Model B Rev 1.1 / Modele : Cortex-A7 armv7l GNU/Linux / Os Name : bullseye
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: json for version or other command

Post by waltervl »

You can also run a daily or weekly Cron just to pull the latest beta.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: json for version or other command

Post 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
lost
Posts: 616
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: json for version or other command

Post 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!
User avatar
FireWizard
Posts: 1745
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: json for version or other command

Post 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
Last edited by FireWizard on Friday 19 January 2024 21:25, edited 1 time in total.
User avatar
pierrotori
Posts: 101
Joined: Tuesday 15 May 2018 0:08
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

json for version or other command

Post 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
rpi : Raspberry Pi 2 Model B Rev 1.1 / Modele : Cortex-A7 armv7l GNU/Linux / Os Name : bullseye
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests