A database or a file is an appropriate medium to store information, manipulating it for reading and writing,
and it 'survives' when a function or computer stops.
As element in Domoticz the user variables are a means to keep values, with the nice aspect of individual adressing.
Also, after initiation they automatically become part of Domoticz' background database.
.
Is in Python 2.x and Python 3.x an equivalent available for those Domoticz' user variables?
Or required to mimick (howto?)?
Persistent data
Moderator: leecollings
-
- Posts: 843
- Joined: Sunday 23 February 2014 17:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: mixed
- Location: Hengelo(Ov)/NL
- Contact:
Persistent data
Last edited by Toulon7559 on Tuesday 07 June 2022 8:33, edited 1 time in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
-
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Persistent data
Are you looking for something like data pickle?
Debian buster on NUC and three RPi with buster.
-
- Posts: 843
- Joined: Sunday 23 February 2014 17:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: mixed
- Location: Hengelo(Ov)/NL
- Contact:
Re: Persistent data
Never heard of pickling, but the description looks promising, because really simple structure and very short scriptlines.
Have also been thinking of similar application of a Python dictionary as auxiliary file, but then script quickly expands.
Have also been thinking of similar application of a Python dictionary as auxiliary file, but then script quickly expands.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
-
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Persistent data
yes I use it in a python script, pretty easy to set-up
Debian buster on NUC and three RPi with buster.
-
- Posts: 843
- Joined: Sunday 23 February 2014 17:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: mixed
- Location: Hengelo(Ov)/NL
- Contact:
Re: Persistent data
Meanwhile (with help from Google, and side-looking to pickle) also found a setup making use of
- a default & working dictionary,
- at end of script-cycle saving the dictionary for backup as json-file, and
- at start of next script-cycle after read-back reconstruction as reference dictionary.
The script-segment in the spoiler below demonstrates an application of such setup for read-out for a weatherstation, and generation of some derived values.
BE AWARE THAT THIS IS NOT A RUNNING SCRIPT BY ITSELF, BUT A SEGMENT FOR DEMONSTRATION OF THE SETUP,
extracted from this Python3.x application!!!
- a default & working dictionary,
- at end of script-cycle saving the dictionary for backup as json-file, and
- at start of next script-cycle after read-back reconstruction as reference dictionary.
The script-segment in the spoiler below demonstrates an application of such setup for read-out for a weatherstation, and generation of some derived values.
BE AWARE THAT THIS IS NOT A RUNNING SCRIPT BY ITSELF, BUT A SEGMENT FOR DEMONSTRATION OF THE SETUP,
extracted from this Python3.x application!!!
- Spoiler: show
Last edited by Toulon7559 on Friday 17 June 2022 20:10, edited 7 times in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
-
- Posts: 843
- Joined: Sunday 23 February 2014 17:56
- Target OS: Raspberry Pi / ODroid
- Domoticz version: mixed
- Location: Hengelo(Ov)/NL
- Contact:
Re: Persistent data
Rummaging with Google for a completely different aspect, found this contribution by Xorfor:
is a setup which more directly links Python to the facilities & services of Domoticz, including the uservariables and devices.
IMHO it even enables that a Python-script and lua/dzVents-script share common data from Domoticz, avoiding seperate specific constructions & translations.
Seems quite useful, but although already existing a few years, must admit that never seen an application.
is a setup which more directly links Python to the facilities & services of Domoticz, including the uservariables and devices.
IMHO it even enables that a Python-script and lua/dzVents-script share common data from Domoticz, avoiding seperate specific constructions & translations.
Seems quite useful, but although already existing a few years, must admit that never seen an application.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
Who is online
Users browsing this forum: No registered users and 1 guest