Page 1 of 1

only once set text in text-device

Posted: Sunday 03 November 2024 21:27
by BartSr
I intend to use text devices on floorplan as 'labels'
What is best way to set text in textdevice only once?

Re: only once set text in text-device

Posted: Monday 04 November 2024 0:35
by solarboy
In dzvents

Code: Select all

domoticz.devices('My Text Device').updateText('The Text I want to show')

Re: only once set text in text-device

Posted: Monday 04 November 2024 8:06
by waltervl
Or with a API call:

Code: Select all

/json.htm?type=command&param=udevice&idx=IDX&nvalue=0&svalue=TEXT
IDX = id of your device (This number can be found in the devices tab in the column "IDX")
TEXT = Text you want to display

https://www.domoticz.com/wiki/Domoticz_ ... ext_sensor

Re: only once set text in text-device

Posted: Monday 04 November 2024 8:18
by BartSr
thanks Walter. But how to run this code only once dz starts?

Re: only once set text in text-device

Posted: Monday 04 November 2024 8:52
by waltervl
BartSr wrote: Monday 04 November 2024 8:18 thanks Walter. But how to run this code only once dz starts?
If you mean the dzvents line, that was not mine proposal. If you want to use dzvents just make a script that runs every minute. Run that line or multiple lines for multiple text devices and stop the script after a few minutes (disable it).

Once the text is in the database there is no need to update the text devices, even after a restart of Domoticz.