Page 1 of 1
					
				device/info: state and statevalue are always "0"?
				Posted: Fri Mar 17, 2023 9:45 am
				by chobbert
				Dear all,
whenever I use the Live API and use "device/info" on a switch I get the following result:
Code: Select all
... "state":"0","statevalue":"0", ...
It shows "0" for both parameters no matter if the device is currently on or off (and the Telldus Live! website shows correctly whether the device is on or not).
What am I doing wrong? Is there anything I have to add to "supportedMethods"?
Best Regards
Robert
 
			 
			
					
				Re: device/info: state and statevalue are always "0"?
				Posted: Fri Mar 17, 2023 9:45 am
				by seaQ
				I'm having this issue aswell which makes it awfully hard to read if a IR sensor is on or off. Is it supposed to be working like this?
			 
			
					
				Re: device/info: state and statevalue are always "0"?
				Posted: Fri Mar 17, 2023 9:45 am
				by ritro
				Put the supportedMethod = 3 to enable ON/OFF and state return.
Regards,
Richard
			 
			
					
				Re: device/info: state and statevalue are always "0"?
				Posted: Fri Mar 17, 2023 9:45 am
				by chobbert
				Thanks, Richard, now it's working.
But where should I have looked for a documentation on supportedMethod? I did not find any information on what "3" means.
Best Regards
Robert
			 
			
					
				Re: device/info: state and statevalue are always "0"?
				Posted: Fri Mar 17, 2023 9:45 am
				by ritro
				Hi Robert,
See there in code sample of tdtool : 
http://developer.telldus.se/attachment/ ... sensors.py
Use 
http://api.telldus.com/explore/index# to debug.
3 is TURNON ored TURNOFF
TELLSTICK_TURNON = 1
TELLSTICK_TURNOFF = 2
TELLSTICK_BELL = 4
TELLSTICK_DIM = 16
TELLSTICK_UP = 128
TELLSTICK_DOWN = 256
Regards,
Richard
 
			 
			
					
				Re: device/info: state and statevalue are always "0"?
				Posted: Fri Mar 17, 2023 9:45 am
				by kristioi
				Hi,
I have a follow-up question for this. When I retrieve device info from a PHP script, I get an empty response for "statevalues":
...
        </name>
	<state>
		1
	</state>
	<statevalue />
	<statevalues state="2048" value="" />
	<methods>
		2050
	</methods>
	<type>
		device
	</type>
	<client>
...
using "$response = $consumer->sendRequest(constant('REQUEST_URI').'/device/info', $params, 'GET');"
with params "id" and "supportedMethods" like described.
However, when I use Telldus API explorer for the same device, I get this:
...
    "statevalue": null,
    "statevalues": [
        {
            "state": "2048",
            "value": {
                "setpoint": {
                    "heat": "22.0",
                    "eco-heat": "10.0"
                },
                "mode": "eco-heat"
            }
        }
    ],
    "methods": "0",
    "type": "device",
 ...
Why is the response different? Am I missing any params? Could there be some access rights?
Kristian