Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. English
    3. Off Topic
    4. state value : needs integer instead of text

    NEWS

    • ioBroker goes Matter ... Matter Adapter in Stable

    • 15. 05. Wartungsarbeiten am ioBroker Forum

    • Monatsrückblick - April 2025

    state value : needs integer instead of text

    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      ClaudeCoppens last edited by

      to read values of adapters in loxone I need to be able to read values. Loxone cannot read text, only values. E.g. with the LG-think adapter the state values are text, while the corresponding numbers are also available, but not via the state variable. So I am looking for a way to easily read those values via the rest API. Can anyone help with this ?

      M 1 Reply Last reply Reply Quote 0
      • M
        MCU @ClaudeCoppens last edited by

        @claudecoppens Example

        on({ id: 'lg-thinq.device.state', change: 'any' }, function (obj) {
            let numValue;
            switch (obj.state.val) {
                case 'ON':
                    numValue = 1;
                    break;
                case 'OFF':
                    numValue = 0;
                    break;
                default:
                    numValue = -1; // or any default value
            }
            setState('0_userdata.0.device.numericState', numValue); // Replace with your target state
        });
        

        REST-API (simpleApi)

        GET http://<iobroker-ip>:8087/get/0_userdata.0.device.numericState
        
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        Support us

        ioBroker
        Community Adapters
        Donate

        937
        Online

        31.6k
        Users

        79.5k
        Topics

        1.3m
        Posts

        2
        2
        107
        Loading More Posts
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes
        Reply
        • Reply as topic
        Log in to reply
        Community
        Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
        The ioBroker Community 2014-2023
        logo