Skip to content

Responses contain an XML serialization error... #3

@Tjossul

Description

@Tjossul

Hello,

I have a FritzBox Cable and a Fritz Dect 210 registered there. Requesting the session ID is successfull but requesting devices with GetDevices(...) or GetDeviceInfos(...) using this requested session ID gives me an XML serialization error.

    private async Task RunFritz()
    {
        try
        {
            var homeAutomationClient = new Fritz.HomeAutomation.HomeAutomationClient();

            var sessionId = await homeAutomationClient.GetSessionId("myUserName", "myPassword");

            var devices = await  homeAutomationClient.GetDevices(sessionId);

            var info = await homeAutomationClient.GetDeviceInfos(sessionId, "myFritzDectAid");
        }
        catch(Exception ex)
        {

        }
    }

Error: "Instance validation error: 'manuell' is not a valid value for SwitchMode."

If I run the request urls in the browser I get the right XML response, e.g.:

http://fritz.box/webservices/homeautoswitch.lua?sid=68986fb1a557923b&switchcmd=getdevicelistinfos

<devicelist version="1" fwversion="7.57">
<device identifier="11657 0760001" id="16" functionbitmask="35712" fwversion="04.25" manufacturer="AVM" productname="FRITZ!DECT 210">
<present>1</present>
<txbusy>0</txbusy>
<name>FRITZ!DECT 210 #1</name>
<switch>
<state>1</state>
<mode>manuell</mode>
<lock>0</lock>
<devicelock>0</devicelock>
</switch>
<simpleonoff>
<state>1</state>
</simpleonoff>
<powermeter>
<voltage>232781</voltage>
<power>0</power>
<energy>0</energy>
</powermeter>
<temperature>
<celsius>220</celsius>
<offset>0</offset>
</temperature>
</device>
<group synchronized="0" identifier="grp8FD40C-3F744C05E" id="900" functionbitmask="37504" fwversion="1.0" manufacturer="AVM" productname="">
<present>1</present>
<txbusy>0</txbusy>
<name>Solar</name>
<switch>
<state>0</state>
<mode>manuell</mode>
<lock>0</lock>
<devicelock>0</devicelock>
</switch>
<simpleonoff>
<state>0</state>
</simpleonoff>
<powermeter>
<voltage>232781</voltage>
<power>0</power>
<energy>0</energy>
</powermeter>
<groupinfo>
<masterdeviceid>0</masterdeviceid>
<members>16</members>
</groupinfo>
</group>
</devicelist>

As you can see this mode is not part of your SwitchMode enums and additionally localised as German. Maybe you cannot use mode/SwitchMode as enum?!

I do not really know what to do or what the problem is. Could you give me some advice?

Thanks.
Sebastian.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions