Ankündigung

Einklappen
Keine Ankündigung bisher.

- √ - Dynamic icons

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    - √ - Dynamic icons

    Hi all,

    I'm trying to use the dynamic icons without success.

    I've tried:
    {{ icon.arrow(id~'metericon', '', 'rez.vest.h.sortie') }}
    {{ icon.arrow(id~'metericon', '', rez.vest.h.sortie) }}
    {{ icon.arrow(id~'metericon', 'rez.vest.h.sortie', 255) }}

    Does someone has any luck with these dynamic icons ?

    Kindly let me know.

    Thanks!

    #2
    Any specific requierements ?

    I tried
    {{ icon.arrow('metericon1', '', 'rez.vest.h.sortie') }}
    {{ icon.arrow('metericon2', '', rez.vest.h.sortie) }}
    {{ icon.arrow('metericon3', 'rez.vest.h.sortie', 255) }}
    {{ icon.meter('metericon4', '', 245) }}
    {{ icon.meter('metericon5', '', 25) }}

    without any success

    Kommentar


      #3
      Which backend do you use? If sh.py you should provide a debug log and your configuration. Maybe the problem is somewhere else. Can you just show the values of this item in the smartVISU with basic.value?
      Mit freundlichen Grüßen
      Niko Will

      Logiken und Schnittstelle zu anderen Systemen: smarthome.py - Visualisierung: smartVISU
      - Gira TS3 - iPhone & iPad - Mobotix T24 - ekey - Denon 2313 - Russound C5 (RIO over TCP Plugin) -

      Kommentar


        #4
        Thank you for your answer!

        You will see on the screenshot below the "144", "150", "165", "130" and "132" are the values of the items I want to use with the dynamic icons.

        Here's part of the html code used on that page.

        <td width="20%">Demande H2-3<br>
        {{ basic.symbol('dhs341', 'chauffe.h34', 'Oui', icon1~'audio_repeat.png') }}
        {{ basic.symbol('dhs342', 'chauffe.h34', 'Non', icon1~'control_x.png', 0) }}
        </td>
        <td width="10%"> {{ icon.arrow(id~'metericon', 'rez.vest.h.sortie', 255) }}</td>
        </tr>
        </table>



        {{ icon.arrow('metericon1', '', 'rez.vest.h.sortie') }}
        {{ icon.arrow('metericon2', '', rez.vest.h.sortie) }}
        {{ icon.arrow('metericon3', 'rez.vest.h.sortie', 255) }}
        {{ icon.meter('metericon4', '', 245) }}
        {{ icon.meter('metericon5', '', 25) }}



        <br>


        {{ myrtr.one ('srtr_buanderie', 'Buanderie', 'rez.buanderie.h.temp', 'rez.buanderie.h.cons', 'rez.buanderie.h.mode', 'rez.buanderie.h.mode', 'rez.buanderie.h.mode', 'rez.buanderie.h.sortie') }}
        {{ myrtr.one ('srtr_vest', 'Vestiaire', 'rez.vest.h.temp', 'rez.vest.h.cons', 'rez.vest.h.mode', 'rez.vest.h.mode', 'rez.vest.h.mode', 'rez.vest.h.sortie') }}
        {{ myrtr.one ('srtr_cuisine', 'Cuisine/SAM', 'rez.cuisine.h.temp', 'rez.cuisine.h.cons', 'rez.cuisine.h.mode', 'rez.cuisine.h.mode', 'rez.cuisine.h.mode', 'rez.cuisine.h.sortie') }}
        {{ myrtr.one ('srtr_salon', 'Salon', 'rez.salon.h.temp', 'rez.salon.h.cons', 'rez.salon.h.mode', 'rez.salon.h.mode', 'rez.salon.h.mode', 'rez.salon.h.sortie') }}
        {{ myrtr.one ('srtr_bureau', 'Bureau', 'etage.bureau.h.temp', 'etage.bureau.h.cons', 'etage.bureau.h.mode', 'etage.bureau.h.mode', 'etage.bureau.h.mode', 'etage.bureau.h.sortie') }}
        {{ myrtr.one ('srtr_etch', 'Chambre Parents', 'etage.ch.h.temp', 'etage.ch.h.cons', 'etage.ch.h.mode', 'etage.ch.h.mode', 'etage.ch.h.mode', 'etage.ch.h.sortie') }}
        {{ myrtr.one ('srtr_etsdb', 'SDB Parents', 'etage.sdb.h.temp', 'etage.sdb.h.cons', 'etage.sdb.h.mode', 'etage.sdb.h.mode', 'etage.sdb.h.mode', 'etage.sdb.h.sortie') }}
        Angehängte Dateien

        Kommentar


          #5
          Here's the sh.py log:

          Code:
          2014-04-03 00:09:39,630 DEBUG    Main         knx: 1.1.29 set 3/1/7 to 0680 -- __init__.py:parse_telegram:181
          2014-04-03 00:09:45,529 DEBUG    Main         knx: 1.1.47 set 0/2/3 to 00 -- __init__.py:parse_telegram:181
          2014-04-03 00:10:00,031 DEBUG    Main         knx: 1.1.38 set 3/4/9 to 0 -- __init__.py:parse_telegram:190
          2014-04-03 00:10:15,799 DEBUG    Main         knx: 1.1.47 set 0/2/3 to 00 -- __init__.py:parse_telegram:181
          2014-04-03 00:10:34,941 DEBUG    Main         knx: 1.1.22 set 3/1/2 to 15.32 -- __init__.py:parse_telegram:190
          2014-04-03 00:10:34,950 DEBUG    Main         Item rez.vest.h.temp = 15.32 via KNX 1.1.22 3/1/2 -- item.py:__update:363
          2014-04-03 00:10:34,958 DEBUG    Main         Item rez.vest.h = 15.32 via KNX 1.1.22 3/1/2 -- item.py:__update:363
          2014-04-03 00:10:39,321 DEBUG    env_stat     Item env.system.load = 0.13 via Logic None None -- item.py:__update:363
          2014-04-03 00:10:39,742 DEBUG    Scheduler    env_stat next time: 2014-04-03 00:15:39+00:00 -- scheduler.py:_next_time:289
          2014-04-03 00:10:46,236 DEBUG    Main         knx: 1.1.47 set 0/2/3 to 00 -- __init__.py:parse_telegram:181
          2014-04-03 00:10:57,441 DEBUG    Main         knx: 1.1.34 set 3/4/8 to 0 -- __init__.py:parse_telegram:190
          2014-04-03 00:11:08,586 DEBUG    Main         WebSocket: closing connection to 10.0.1.20:58042. -- __init__.py:rfc6455_parse:402
          2014-04-03 00:11:10,986 DEBUG    Main         knx: 1.1.42 set 3/1/11 to 18.17 -- __init__.py:parse_telegram:190
          2014-04-03 00:11:10,990 DEBUG    Main         Item enfants.cha.h.temp = 18.17 via KNX 1.1.42 3/1/11 -- item.py:__update:363
          2014-04-03 00:11:10,997 DEBUG    Main         Item enfants.cha.h = 18.17 via KNX 1.1.42 3/1/11 -- item.py:__update:363
          2014-04-03 00:11:12,320 DEBUG    Main         WebSocket: incoming connection from 10.0.1.20:59094 to 0.0.0.0:2424 -- connection.py:accept:187
          2014-04-03 00:11:12,335 ERROR    Main         Connection polling failed: release unlocked lock -- smarthome.py:start:344
          Traceback (most recent call last):
            File "/usr/local/smarthome/bin/smarthome.py", line 342, in start
              self.connections.poll()
            File "/usr/local/smarthome/lib/connection.py", line 103, in poll
              server.handle_connection()
            File "/usr/local/smarthome/plugins/visu/__init__.py", line 126, in handle_connection
              self._lock.release()
          RuntimeError: release unlocked lock
          2014-04-03 00:11:12,825 DEBUG    Main         10.0.1.20:59094 sent '{"cmd":"proto","ver":3}' -- __init__.py:json_parse:273
          2014-04-03 00:11:12,842 DEBUG    Main         10.0.1.20:59094 sent '{"cmd":"monitor","items":["chauffe.chaud","chauffe.h12","chauffe.h34","rez.buanderie.h.temp","rez.buanderie.h.cons","rez.buanderie.h.sortie","rez.buanderie.h.mode","rez.vest.h.temp","rez.vest.h.cons","rez.vest.h.sortie","rez.vest.h.mode","rez.cuisine.h.temp","rez.cuisine.h.cons","rez.cuisine.h.sortie","rez.cuisine.h.mode","rez.salon.h.temp","rez.salon.h.cons","rez.salon.h.sortie","rez.salon.h.mode","etage.bureau.h.temp","etage.bureau.h.cons","etage.bureau.h.sortie","etage.bureau.h.mode","etage.ch.h.temp","etage.ch.h.cons","etage.ch.h.sortie","etage.ch.h.mode","etage.sdb.h.temp","etage.sdb.h.cons","etage.sdb.h.sortie","etage.sdb.h.mode","enfants.hall.h.temp","enfants.hall.h.cons","enfants.hall.h.sortie","enfants.hall.h.mode","enfants.cha.h.temp","enfants.cha.h.cons","enfants.cha.h.sortie","enfants.cha.h.mode","enfants.sdb.h.temp","enfants.sdb.h.cons","enfants.sdb.h.sortie","enfants.sdb.h.mode","enfants.chm.h.temp","enfants.chm.h.cons","enfants.chm.h.sortie","enfants.chm.h.mode"]}' -- __init__.py:json_parse:273
          2014-04-03 00:11:15,132 DEBUG    Main         knx: 1.1.49 set 3/4/1 to 0 -- __init__.py:parse_telegram:190
          2014-04-03 00:11:16,621 DEBUG    Main         knx: 1.1.47 set 0/2/3 to 00 -- __init__.py:parse_telegram:181
          2014-04-03 00:11:27,477 DEBUG    Main         knx: 1.1.6 set 3/0/6 to 00 -- __init__.py:parse_telegram:181
          2014-04-03 00:11:27,549 DEBUG    Main         knx: 1.1.48 set 3/0/1 to False -- __init__.py:parse_telegram:190
          2014-04-03 00:11:27,588 DEBUG    Main         knx: 1.1.48 set 3/0/0 to False -- __init__.py:parse_telegram:190
          2014-04-03 00:11:27,880 DEBUG    Main         knx: 1.1.48 set 3/0/1 to False -- __init__.py:parse_telegram:190
          2014-04-03 00:11:27,915 DEBUG    Main         knx: 1.1.48 set 3/0/0 to False -- __init__.py:parse_telegram:190
          2014-04-03 00:11:28,241 DEBUG    Main         knx: 1.1.48 set 3/0/0 to False -- __init__.py:parse_telegram:190
          2014-04-03 00:11:28,586 DEBUG    Main         WebSocketHandler: closing socket 10.0.1.20:58042 -- connection.py:close:302
          2014-04-03 00:11:28,711 DEBUG    Main         knx: 1.1.48 set 3/0/0 to False -- __init__.py:parse_telegram:190
          I get the correct numbers when I display the values using basic.value... still no luck with the dynamic icons

          Kommentar


            #6
            Made a quick test page... the value is displayed correctly... the icons no

            Code:
            {% extends "full.html" %}
            
            {% block content %}
               <h1><img class="icon" src='{{ icon0 }}temp_control.png'/>Contrôle du chauffage</h1>
                
                <div class="preblock">
            
                 {{ basic.value('eeeet', 'rez.buanderie.h.sortie') }} 
                 
                 {{ icon.arrow('icon1', '', 'rez.buanderie.h.sortie') }}
                 {{ icon.meter('icon2', '', 'rez.buanderie.h.sortie') }}
                 {{ icon.battery('icon3', '', 'rez.buanderie.h.sortie') }}
                
                </div>      
                  
                  
            {% endblock %}
            Angehängte Dateien

            Kommentar


              #7
              do you know firebug in firefox or the development console in chrome? This would be the only way to look at the HTML output of the website and to debug the JavaScript code. I haven't used the dynamic icons yet, therefore I can not give you any other advice.
              Mit freundlichen Grüßen
              Niko Will

              Logiken und Schnittstelle zu anderen Systemen: smarthome.py - Visualisierung: smartVISU
              - Gira TS3 - iPhone & iPad - Mobotix T24 - ekey - Denon 2313 - Russound C5 (RIO over TCP Plugin) -

              Kommentar


                #8
                when I use the code of the icon widget on the page it works!

                Code:
                     <svg id="{{ uid(page, id) }}" data-widget="icon.meter" data-item="{{ 'rez.buanderie.h.sortie' }},  " data-min="{{ min|default('0') }}" data-max="{{ max|default('255') }}"
                        class="icon icon0" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 100 100">
                        <g>
                            <line x1="10" y1="40" x2="3" y2="32" />
                            <line x1="30" y1="30" x2="26" y2="22" />
                            <line x1="50" y1="24" x2="50" y2="13" />
                            <line x1="70" y1="30" x2="74" y2="22" />
                            <line x1="90" y1="40" x2="97" y2="32" />
                            <path d="M 10,40 Q 50,10 90,40" />
                            <polyline id="pointer" points="50,85, 15,48" />
                        </g>
                    </svg>

                Kommentar


                  #9
                  Solved!

                  Thanks for the help.

                  It was just a "{% import" missing.

                  Kommentar

                  Lädt...
                  X