How to add explanation between plugin parameters ?

Python and python framework

Moderator: leecollings

Post Reply
keros
Posts: 77
Joined: Saturday 27 July 2019 0:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

How to add explanation between plugin parameters ?

Post by keros »

Hello everyone,

I would to know if it is possibile to add explanation between parameters like for the Evohome via web API :
Sans titre.png
Sans titre.png (108.52 KiB) Viewed 1237 times
I looked at differents plugin github repositories but none of them has description integrated between each parameters. They all have the wiki code with only the label :

Code: Select all

<params>
        <param field="Address" label="IP Address" width="200px" required="true" default="127.0.0.1"/>
        <param field="Port" label="Port" width="30px" required="true" default="9090"/>
        <param field="Mode1" label="MAC Address" width="150px" required="false"/>
        <param field="Mode2" label="Shutdown Command" width="100px">
            <options>
                <option label="Hibernate" value="Hibernate"/>
                <option label="Suspend" value="Suspend"/>
                <option label="Shutdown" value="Shutdown"/>
                <option label="Ignore" value="Ignore" default="true" />
            </options>
        </param>
        <param field="Mode3" label="Notifications" width="75px">
            <options>
                <option label="True" value="True"/>
                <option label="False" value="False"  default="true" />
            </options>
        </param>
        <param field="Mode6" label="Debug" width="75px">
            <options>
                <option label="True" value="Debug"/>
                <option label="False" value="Normal"  default="true" />
            </options>
        </param>
    </params>
</plugin>
"""
Is it possibile to add the explanations ?
Moderator on Easydomoticz.com, the French DomoticZ forum.
French writer for ZigBeeForDomoticZ Plugin Wiki
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: How to add explanation between plugin parameters ?

Post by Dnpwwo »

Hi keros,

You can't in the current Domoticz stable but I liked this idea so I just pushed an update into the beta channel that allows it:

Code: Select all

<plugin key="Timeout" name="Timeout Tester" author="Dnpwwo" version="2.2.7" externallink="https://www.google.com">
    <description>
        <h2>Timeout Tester</h2><br/>
        Connect to URL and timeout with specified interval (milliseconds).
    </description>
    <params>
        <param field="Address" label="IP Address" width="200px" required="true" default="localhost"/>
        <param field="Mode1" label="Protocol" width="75px">
            <options>
                <option label="HTTPS" value="443"/>
                <option label="HTTP" value="8080"  default="true" />
            </options>
        </param>
        <param field="Mode2" label="Timeout" width="50px" required="true" default="250">
            <description>Values below 250 milliseconds will be ignored</description>
        </param>
        <param field="Mode6" label="Debug" width="150px">
            <description><h2>Debugging</h2>Select the desired level of debug messaging</description>
            <options>
                <option label="None" value="0"  default="true" />
                <option label="Python Only" value="2"/>
                <option label="Basic Debugging" value="62"/>
                <option label="Basic+Messages" value="126"/>
                <option label="Connections Only" value="16"/>
                <option label="Connections+Python" value="18"/>
                <option label="Connections+Queue" value="144"/>
                <option label="All" value="-1"/>
            </options>
        </param>
    </params>
</plugin>
the description is shown above the parameter and can contain embedded HTML so it can be styled
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
keros
Posts: 77
Joined: Saturday 27 July 2019 0:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to add explanation between plugin parameters ?

Post by keros »

Thank you very much Dnpwwo for your very quick action :P

I uptade to the lastest beta 13842 but I can not see the changes for the moment. That normal ? I have to wait for the next build ?
Moderator on Easydomoticz.com, the French DomoticZ forum.
French writer for ZigBeeForDomoticZ Plugin Wiki
pipiche
Posts: 2015
Joined: Monday 02 April 2018 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: France
Contact:

Re: How to add explanation between plugin parameters ?

Post by pipiche »

I like that


Envoyé de mon iPhone en utilisant Tapatalk
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices

If the plugin provides you value, you can support me with a donation Paypal.

Wiki is available here.

Zigbee for Domoticz FAQ
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: How to add explanation between plugin parameters ?

Post by Dnpwwo »

Yes, it should be in the next beta build.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
keros
Posts: 77
Joined: Saturday 27 July 2019 0:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to add explanation between plugin parameters ?

Post by keros »

Wonderfull :P

Thanks a lot
Moderator on Easydomoticz.com, the French DomoticZ forum.
French writer for ZigBeeForDomoticZ Plugin Wiki
keros
Posts: 77
Joined: Saturday 27 July 2019 0:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to add explanation between plugin parameters ?

Post by keros »

The build changed (13872 now) but the description still not appears in the plugin page :roll:
Is it a problem on my side, or the modifications haven't been pushed yet ?

EDIT : I looked at my log and I have those errors for my test plugin
2021-11-11 10:12:21.352 Error: Test: (Timeout) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Test/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2021-11-11 10:12:21.353 Error: Test: Module Import failed, exception: 'SyntaxError'
2021-11-11 10:12:21.353 Error: Test: Import detail: File: , Line: 1, offset: 1
2021-11-11 10:12:21.353 Error: Test: Error Line '<plugin key="Timeout" name="Timeout Tester" author="Dnpwwo" version="2.2.7" externallink="https://www.google.com">
2021-11-11 10:12:21.353 '
2021-11-11 10:12:21.353 Error: Test: No traceback available
The plugin.py is exactly the code you wrote above.
Moderator on Easydomoticz.com, the French DomoticZ forum.
French writer for ZigBeeForDomoticZ Plugin Wiki
JanJaap
Posts: 215
Joined: Thursday 12 October 2017 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Dev
Location: the Netherlands
Contact:

Re: How to add explanation between plugin parameters ?

Post by JanJaap »

Hi Keros,

At first glance there seems to be an error already on the first line of your plugin. Sure that is all correct?
RPi 3, Domoticz dev version, Aeon ZWave stick (with a whole bunch of slaves), Zigbee using Zigbee2MQTT, Nest thermo, P1 smart meter on RPi Zero
keros
Posts: 77
Joined: Saturday 27 July 2019 0:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to add explanation between plugin parameters ?

Post by keros »

Thanks for your reply JanJapp

I tooked exactly the example given just above by Dnpwwo :?

I tried with the wiki example code (which Dnpwwo has updated) and the description appears :D

Code: Select all

<plugin key="Kodi" name="Kodi Players" author="dnpwwo" version="1.0.0" wikilink="http://www.domoticz.com/wiki/plugins/Kodi.html" externallink="https://kodi.tv/">
    <description>
        <h2>Kodi Media Player Plugin</h2><br/>
        <h3>Features</h3>
        <ul style="list-style-type:square">
            <li>Comes with three selectable icon sets: Default, Black and Round</li>
            <li>Display Domoticz notifications on Kodi screen if a Notifier name is specified and events configured for that notifier</li>
            <li>Multiple Shutdown action options</li>
            <li>When network connectivity is lost the Domoticz UI will optionally show the device(s) with a Red banner</li>
        </ul>
        <h3>Devices</h3>
        <ul style="list-style-type:square">
            <li>Status - Basic status indicator, On/Off. Also has icon for Kodi Remote popup</li>
            <li>Volume - Icon mutes/unmutes, slider shows/sets volume</li>
            <li>Source - Selector switch for content source: Video, Music, TV Shows, Live TV, Photos, Weather</li>
            <li>Playing - Icon Pauses/Resumes, slider shows/sets percentage through media</li>
        </ul>
    </description>
    <params>
        <param field="Address" label="IP Address" width="200px" required="true" default="127.0.0.1"/>
        <param field="Port" label="Port" width="30px" required="true" default="9090"/>
        <param field="Mode1" label="MAC Address" width="150px" required="false"/>
        <param field="Mode2" label="Shutdown Command" width="100px">
            <options>
                <option label="Hibernate" value="Hibernate"/>
                <option label="Suspend" value="Suspend"/>
                <option label="Shutdown" value="Shutdown"/>
                <option label="Ignore" value="Ignore" default="true" />
            </options>
        </param>
        <param field="Mode3" label="Notifications" width="75px">
            <options>
                <option label="True" value="True"/>
                <option label="False" value="False"  default="true" />
            </options>
        </param>
        <param field="Mode6" label="Debug" width="75px">
            <description><h2>Debugging</h2>Select the desired level of debug messaging</description>
            <options>
                <option label="True" value="Debug"/>
                <option label="False" value="Normal"  default="true" />
            </options>
        </param>
    </params>
</plugin>
Moderator on Easydomoticz.com, the French DomoticZ forum.
French writer for ZigBeeForDomoticZ Plugin Wiki
User avatar
madpatrick
Posts: 667
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.1
Location: Netherlands
Contact:

Re: How to add explanation between plugin parameters ?

Post by madpatrick »

Does anybody know if you can use these check boxes in a Python plugin ?
2023-02-01 20_04_49-(1) Domoticz - Post a reply.png
2023-02-01 20_04_49-(1) Domoticz - Post a reply.png (10.95 KiB) Viewed 623 times
-= HP server GEN11 =- OZW -=- Toon2 (rooted) -=- Domoticz v2025.1 -=- Dashticz v3.14b on Tab8" =-
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest