Custom Image for text devices or custom text for contact switches

Python and python framework

Moderator: leecollings

Post Reply
ag74
Posts: 7
Joined: Wednesday 15 May 2019 10:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Custom Image for text devices or custom text for contact switches

Post by ag74 »

Hi,

I'm developping a plugin using the Python API.
I tried to create contact switch devices but when I update their numerical values and string values of the devices the string values are ignored and only Open or Close is displayed.
For example :

Code: Select all

Devices[ idx ].Update( nValue = 1, sValue="custom string", Image = Images[ 'testimg' ].ID )  # 'custom string' is never displayed.
So I tried using text devices but now I can't change the Image but it works with contact switch.

Code: Select all

Devices[ idx ].Update( nValue = 1, sValue="custom string", Image = Images[ 'testimg' ].ID )  # custom image is never displayed.
Custom images are added using...

Code: Select all

if 'testimg' not in Images:
			Domoticz.Image( 'Icons.zip' ).Create()
My questions are :
1. Is it possible to display custom text with contact switch devices ?
2. Is it possible to use custom image with text devices ?

Both are useful.
Using a custom image with text devices can help users to know the general state of the device without having to read the associated text and the fully description is in the associated text.
Using custom text with contact devices are very convenient when their are use as a read only on/off swicth. So their numerial state (on/off) can be used in dzVents scripts instead of comparing a text of a text device.
Post Reply

Who is online

Users browsing this forum: FireWizard, Google [Bot] and 1 guest